0
How to make them display on separate lines?
In my code [[["Enter a number: " and "Enter another number: " ]]] is displayed on the same line and the answer of the operation is displayed next to them. Can anyone suggest how to make them look neat and clean? *U can understand better once u run my code* 👇 https://code.sololearn.com/cgLrR0vd216a/?ref=app
9 Réponses
+ 3
a=int(input("Enter a number:\n "))
b=int(input("Enter another number:\n "))
print(a+b) # \n is used for line break
+ 2
Use the \n code to add a line break. Simply by string concatenation + "\n" +
+ 2
It's simple.
Just use "/n" there
+ 1
Just add a new line break after both input-messages (\n).
0
Okay.... Thanks to all , it worked 😊
0
But what if I want to add at the end as "The answer is - "
How to do this?
0
Anyone???
0
No bro , i asked -
What if I want to add at the end as "The answer is - "
How to do this?