Most popular tags

302 questions

410 answers

70 comments

310 users

Most active Members
this week:

    Recent Badges

    Notable Question
    - 14nicholsonc -
    Regular
    - 14swiftc -
    Old-Timer
    - 14swiftc -

    cant assign to operator?????????????????????

    0 votes

    i dont know how to fix it

    when you run it it says it cant assign to operator

     
    import random
     
     
    myName = input("Hello! What is your name? ")
     
    print("Well, ", myName, ", pick a toilet.")
     
     
    door_w/ghost = random.randint(1, 3)
     
     
    door = int( input("what door: ") )
     
    # is the player guessed correctly get out of the while loop
    if door == door_w/ghost:
        print("you died ")
     
    # if the player failed - let them know of the random number
    else:
        print ("you scored 1 point")
     
    # end of program
     
    asked Nov 17, 2016 in Python by 14scotta (350 points)

    2 Answers

    0 votes
    I am not sure, however i think there is something like this on codeacademy.
    answered Nov 23, 2016 by 14gregoryj (190 points)
    +1 vote

    i fixed the code. It turns out that Python hates / 's . I have got the working code here.

     

     

    import random
     
     
    myName = input("Hello! What is your name? ")
     
    print("Well, ", myName, ", pick a toilet.")
     
     
    door_wghost = random.randint(1, 3)
     
     
    door = int( input("what door: ") )
     
    # is the player guessed correctly get out of the while loop
    if door == door_wghost:
        print("you died ")
     
    # if the player failed - let them know of the random number
    else:
        print ("you scored 1 point")
     
    # end of program
    answered Nov 24, 2016 by 14cooksonj (690 points)
    Welcome to Selby Computing Q&A, where you can ask questions and receive answers from other students in Computer Science.
    ...