Below is the program to generate the following pattern.
n=int(input("Enter the number :"))
k=1
for i in range(1,n+1): # outer loop
for j in range(1,i+1): # inner loop
print(str(k)+" ",end="")
k=k+1
print("\r")
Output:
- Python tutorials
- Input and Output in Python
- f-strings in Python
- end and sep in Python
- Python QuickStart
- Variables in Python
- Data Types in Python
- Operators in Python
- Python program to compute net run rate
- Python program to get biggest number
- Python program to count the frequency of every element
- Python program of list and swap its content
- Python program to get max numbers
- Python program to generate patterns
- Python Program to Check ArmstrongÂ
- Python program to print multiplication table
- Python program for domestic electricity billÂ
- Python program to find maximum numberÂ
- Python program to check uppercase or lowercase letterÂ