+ 4

How can we add a full stop to the following statements without any space in front of it?

n = int(input()) #5 pn = str(n - 1) nn = str(n + 1) s = str(n) print("The next number for the number",s,"is",nn,".") print("The previous number for the number",s,"is",pn,".") #I expect it to print: -The next number for the number 5 is 6.- but it prints: -The next number for the number 5 is 6 .- #Thanks for the help

6th Apr 2017, 7:35 PM
Annerb
Annerb - avatar
6 Respuestas
+ 15
Before print statements write pn += "." nn += "." which is equivalent to pn = pn + ".". This way you won't need to write the full stop at the end
6th Apr 2017, 7:47 PM
Gami
Gami - avatar
+ 15
If that really helped can you mark my answer ss the best :)
7th Apr 2017, 10:57 AM
Gami
Gami - avatar
+ 14
There is a tick next to it ;) Just press that tick and it will get green :)
7th Apr 2017, 10:59 AM
Gami
Gami - avatar
+ 9
Maybe @Annerb is not update his/her Sololearn app https://www.sololearn.com/discuss/295094/?ref=app
7th Apr 2017, 12:39 PM
Agus Mei
Agus Mei - avatar
+ 4
Thanks a lot
6th Apr 2017, 8:08 PM
Annerb
Annerb - avatar
+ 3
....like upvote it? I liked it though
7th Apr 2017, 10:58 AM
Annerb
Annerb - avatar