0
With a while loop, how it is possible to output a list of number ending each with a dot.
input: x = 0 while x<=5: print(x) x += 1 expected output: 1. 2. 3. 4. 5.
3 Answers
+ 5
print(str(x) + '.')
+ 5
Read this page, especially the "Preventing Line Breaks" section. You can see the use of `end` argument for print() function to customize what to print at end of printing operation - when all arguments given for print() function had been printed.
https://realpython.com/JUMP_LINK__&&__python__&&__JUMP_LINK-print/
+ 3
Alexandre NAROLLES / Solutionist Thinker
print (str(x) + '.')