Python Error

Asked 2 years ago, Updated 2 years ago, 23 views

a = int (input ('1. Celsius -> Fahrenheit\n2. Fahrenheit -> Celsius')
if a == 1:
    c = int(input('sub').'))
    changing = c *1.8 +32
    print (chaning)

else:
    f = int(input()'Fahrenheit. : '))
    changing1 = (f-32)/1.8
    print (chainging1)

I wrote the code like this, but the second line if a==1: keeps making errors in the semicolon, what's the problem??

python

2022-09-22 16:52

1 Answers

The front row int(input(blah) ← It's because there's one missing bracket to close.

If you use a code sniffing editor like VS Code or Sublime Text, you won't be able to meet this.

PS. The line variable 4 and the line variable 5 do not fit, and the line variable 9 and 10 do not fit. Check for typos.


2022-09-22 16:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.