What is wrong here? Keep getting invalid syntax at the colon on Line 6 | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

What is wrong here? Keep getting invalid syntax at the colon on Line 6

FIXED. Simple errors lol hourly = input() hours = input() goal = input() paid = float(hours)*float(hourly) if paid >= goal: print('Goal is met!') else: print('You need to work more') print(paid)

24th Mar 2022, 6:32 PM
Tonio Reign
3 Antworten
+ 2
paid = float (hours)*float (hourly) #remove first opening bracket
24th Mar 2022, 6:47 PM
Shadoff
Shadoff - avatar
+ 2
if paid >= goal: Here <paid> was a float and <goal> was a string. You can't properly compare these two.
24th Mar 2022, 7:15 PM
Ipang
+ 1
Yes, change goal = input() to goal = float(input()) or goal = int(input()) and it should work fine.
25th Mar 2022, 9:59 PM
Julia Marshall