0
Create a program to output numbers 1,2 and 3 each on a separate line
5 Antworten
+ 4
print(1, 2, 3, sep = '\n') # the numbers will be printed usually with a space as separator. but we can define a different separator. in this case it is a new-line sequence.
this is also a common way:
for i in [1,2,3]:
print(i)
or by using a list comprehension:
[print(i) for i in [1,2,3]]
+ 1
print('1\n'+'2\n'+'3')
+ 1
You can use more print, like:
print(1)
print(2)
or try to google end=' '
0
How I changed line to print 1,2 and 3 in python.because there no /n.
0
Enter·the·first·number:·1 Enter·the·second·number:·2
1·+·2·=·3 how to prog ram this when the output is this