How python prints strings multiple times
This article is about how python prints strings multiple times. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Print string multiple times
We can use the multiplication operator to print the string multiple times. This is a very effective way to repeat strings.
N = int (input ("How many times you need to repeat:")) my_string = "Python\ n" print (my_string*n)
Output quantity
How many times you need to repeat:3 PythonPythonPython, thank you for your reading! This is the end of the article on "how python prints strings many times". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!