n = int(input("Please enter the number of rows: ")) for num in range(1, n + 1): for i in range(num): print (num, end = " ") print() Output: Please enter the number of rows: 6 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6
इन्हें भी देखें।
- while loop
- for loop
- nested loops
- loop control statements (Break, Continue, Pass)
- if statement
- if-else statement
- if-elif statement
- nested if statement
- range() function
- keywords
- Identifiers (names)
- Literals
- Operators
- punctuatorts
Python Programs के लिये यहाँ click करें।