Python: can't assign to literal

后端 未结 8 2258
旧时难觅i
旧时难觅i 2020-11-29 10:43

My task is to write a program that asks the user to enter 5 names which it stores in a list. Next, it picks one of these names at random and declares that person as the winn

8条回答
  •  独厮守ぢ
    2020-11-29 11:08

    This is taken from the Python docs:

    Identifiers (also referred to as names) are described by the following lexical definitions:
    
    identifier ::=  (letter|"_") (letter | digit | "_")*
    
    letter     ::=  lowercase | uppercase
    
    lowercase  ::=  "a"..."z"
    
    uppercase  ::=  "A"..."Z"
    
    digit      ::=  "0"..."9"
    
    Identifiers are unlimited in length. Case is significant.
    

    That should explain how to name your variables.

提交回复
热议问题