I can't figure out why there is a syntax error in this code

前端 未结 3 758
闹比i
闹比i 2021-01-29 09:39

So I have this python code that I\'m to run in my mac\'s terminal but when I try running it with python in the terminal it gives me a syntax error on line 27 like so:

         


        
相关标签:
3条回答
  • 2021-01-29 09:54
    self.data = raw_input(‘Enter Pressure,Temperature,WindDirection:’)
    

    This should be;

    self.data = raw_input('Enter Pressure,Temperature,WindDirection:')
    

    or

    self.data = raw_input("Enter Pressure,Temperature,WindDirection:")
    

    You're using wrong quotes.

    0 讨论(0)
  • 2021-01-29 09:58

    It's your quotes. They're funny. Delete them and enter normal ones.

    0 讨论(0)
  • 2021-01-29 09:59

    Instead of ASCII single or double quotes you're using U+2018 and U+2019 here, hence the syntax error.

    Wrong quotes here as well:

    event.split(“,”)
    
    0 讨论(0)
提交回复
热议问题