• Free Template
  • Web Dev
    • CSS
    • PHP Scripting
    • HTML 5
    • Articles
  • Programming
    • Python
    • C++
    • Java
    • C Programming
    • Data Structure
    • Articles
  • Tips & Tricks
  • Technology
  • What's Hot
  • Subscribe Us

python Examples

  • Introduction
  • Hello World
  • Arithmetic Operations
  • Compare Variables
  • Multiplication Table
  • Prime Number
  • Armstrong Number
  • Factorial
  • Leap Year
  • Recursive Factorial
  • Fibonacci Series
  • 1's Complement
  • ASCII Conversion
  • Palindrome Number
  • Palindrome String
  • Matrix Addition
  • Matrix Multiplication
  • Remove Vowel
  • Class Object
  • Inheritance
  • Multiple Inheritance
  • Multilevel Inheritance
  • Polymorphism
  • Dictionary
  • List Data Structure
  • Swapping values
  • Star Pyramid
  • Directory
  • File Operation
  • Delete file & directory
  • Bubble Sort
  • Insertion Sort
  • Selection Sort
  • Quick Sort
  • Merge Sort
  • Heap Sort

Aug 10, 2021

Star Pyramid

Python Programming 4330 views
#!/usr/bin/evn python

for i in range(1,6):
    # String repetition using '*'
    print (' '*(5-i),'*'*(i*2))



#***** Output *****
#     **
#    ****
#   ******
#  ********
# **********

String

Tags:
Pythonpython programmingstar pyramidstring repetitionfor loop
Author: Geekboots
Share On
Geekboots © 2022 About UsContact UsTermsCookie PolicyPrivacySubmit Article