0
Why every no. Is displayed in new line
All should be together
12 Respuestas
+ 1
The way you want to print the numbers is of your choice/pattren not according to loop.Loops only itterates the number according to condition.
Kindly explain your question what you are exactly asking for?kindly use tags for clear explanation.thanks
+ 1
You are asking about which language because in different language print statement are different .
Kindly explain about which language you are asking for??
+ 1
Harshit Gupta
for i in range(3):
print(i ,end=" ")
Now they are printing on same line with single space
Output:
0 1 2
+ 1
i = 1
while i <=5:
print(i,end=" ")
i = i + 1
print("Finished!")
Output:
1 2 3 4 5
Finished!
0
Since print function is used to print anything in it in one line then why all no. Are in seperate new line
0
There is question in pythin looping in which print statement is used and in output all no. Get seperate new line but previously when strings were in print function they were in same line in its output
0
i = 1
while i <=5:
print(i)
i = i + 1
print("Finished!")
Output:
1
2
3
4
5
Finished
0
Why every no. Is in new line
Kindly explain
0
Ok thanks
0
Harshit Gupta
A simple explanation of using "end" in print statement
The default value of end is \n meaning that after the print statement it will print a new line. So simply stated end is what you want to be printed after the print statement has been executed. Eg: - print ("hello",end=" +") will print hello +.
0
Printf("\n\n%d",variablename);