+ 1
I have this program and it’s telling me theres a problem with the last s1
if h > 10: h1 = str(h) else: h1 = "0" + str(h) if m > 10: m1 = str(m) else: m1 = "0" + str(m) if s > 10: s1 = str(s) else: s1 = "0" + str(s) print (h1 , ":" , m1 , ":" s1)
8 odpowiedzi
+ 1
I don't use Python but I tested your code and there is a syntax error due to the comma like I mentioned. Try putting a comma after the last double quote just before 's1' and see if that fixes it. Otherwise just check your source code for any other characters that shouldn't be there.
Like so..
print(h1, ":", m1, ":", s1)
+ 1
Please specify the language !
+ 1
First off I don't know what language you're using as you didn't specify and I don't know where the variables you're using came from since. If you could provide more detailed information I may be able to help more. Although I noticed there isn't a comma in the last part of your print statement. It seems to have broken a common trend, could that be it?
+ 1
Thank you very much!!!
0
I'm using Python
0
I already tried the comma and it dodn't work
0
Could you please provide the error message you're getting about the 's1' variable?
0
SyntaxError: invalid sintax