0

Help

Can someone please tell me what end=“ “ in python means?

26th Mar 2018, 8:27 PM
Michaela KuttnerovĂĄ
Michaela KuttnerovĂĄ - avatar
5 Answers
+ 3
Since you probably don't know what functions are, the end=" " is telling Python that the value of i should end in a space not a new line. If that wasn't there the values would be on separate lines like... 1 2 3 4 instead of 1 2 3 4 (with end=" ")
26th Mar 2018, 8:34 PM
TurtleShell
TurtleShell - avatar
+ 1
print("hello") print("world") hello world print("Hello", end=" ") print("world") hello world doesn't only apply to i in loops, it works with print in general. it puts " " at the end of the line instead of ending the line
26th Mar 2018, 9:23 PM
LordHill
LordHill - avatar
0
Was the code something like print("text", end=" ")?
26th Mar 2018, 8:30 PM
TurtleShell
TurtleShell - avatar
0
print(i,end=“ “) it was used in for cycle
26th Mar 2018, 8:31 PM
Michaela KuttnerovĂĄ
Michaela KuttnerovĂĄ - avatar
0
it naturally ends in \n . its the ending character if im not mistaken. this makes it possible to get single line output from a for loop
26th Mar 2018, 8:35 PM
Markus Kaleton
Markus Kaleton - avatar