0

What's the significance of 'end' in python? please give examples.

21st Sep 2018, 5:47 PM
partha
partha - avatar
6 Respostas
+ 2
Are you asking about a print function parameter? If so, 'end' identifies what would be the printed string ending instead of a new line by default. >>> for _ in range(3): print(_) 0 1 2 >>> for _ in range(3): print(_, end=';') 0;1;2; >>>
21st Sep 2018, 8:03 PM
strawdog
strawdog - avatar
+ 1
John , was your answer a wild guess?
21st Sep 2018, 8:17 PM
strawdog
strawdog - avatar
0
end denotes a terminator for a method or a class. def function(numOne): # process data here. end Python isn't my primary language by any means but if you want me to elaborate more just ask.
21st Sep 2018, 6:46 PM
John
John - avatar
0
yea it was, I don't use python that much. Good answer.
22nd Sep 2018, 12:59 AM
John
John - avatar
0
now that I think about it, I'm getting lua mixed up with python. oops.
22nd Sep 2018, 12:59 AM
John
John - avatar
0
thanks guys
22nd Sep 2018, 1:01 AM
partha
partha - avatar