Right Triangle Pattern in Python

Right triangle pattern in python. python programming language number pattern program. This is a simple series of pattern program written in python. To understand the principle of python programming, print the number pattern in the language.

lines = 5

for num in range(lines):

for i in range(num):

print(num, end=" ")

print(" ")

 

Output:

1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

print() Function in Python

The print() function outputs the message supplied to the screen or another standard output device. The message can be a string or any other object; the object will be converted to a string before being displayed on the screen. The print() function in Python is used to acquire the output and debug the code. This function outputs the supplied message or value to the console. The message could be a string or any other type of object.