-2
I’m trying to solve this code but at the time of running the syntax error on the first line.
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> segundos_str = input("por favor, entre com o número de segundos que deseja converter: ")
tota_segs = int(segundos_str)
horas = total_segs // 3600
segs_restantes = total_segs % 3600
minutos = segs_restantes // 60
segs_restantes_final = segs_restantes % 60
print(horas, "horas, ", minutos, "minutos e", segs_restantes_final, "segundos.")
Try to paste the commands into the interpreter one at a time. There seems to be no syntax error in the first line. There must be some problem with an unprintable character at the end of the line. Looking at your screen, you can see that the second line prompt did not appear...
– ndvo
What it looks like is that you copied the code from somewhere and pasted it into the Python Shell. If it is, all this initial data is unnecessary in the file and breaks the syntax.
– Woss
Thank you very much to all who have collaborated, I am very grateful.
– Rafael Gimenez