How can I print a string on a new line?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I print a string on a new line??

Check this and help print all strings on a new line.. https://code.sololearn.com/cxNVzc5sSE9m/?ref=app

6th May 2019, 3:49 PM
anon
3 Answers
+ 9
Use '\n' to print in new line. Eg- def max(x, y, z): if x >y and x>z: return x elif y>x and y>z: return y else: return z x=float(input("Enter First No.")) y=float(input("\nEnter Second No.")) z=float(input("\nEnter Third No.")) a=str(max(x,y,z)) print("\nLargest no is "+a)
6th May 2019, 4:17 PM
VEDANG
VEDANG - avatar
6th May 2019, 4:45 PM
CodeFu
CodeFu - avatar
+ 1
If you want to use your max() function, then you need to rename it, since the max() function already exists. https://code.sololearn.com/cUfVQG75l9Ra/?ref=app
7th May 2019, 5:14 AM
Solo
Solo - avatar