Most popular tags

306 questions

415 answers


329 users

Most active Members
this week:

    Recent Badges

    Notable Question
    - smartin -

    whats wrong with my code. Invalid variable names.

    +2 votes
    10p =0.10
    20p = 0.20
    50p = 0.50
    1pound = 1


    10p = float(input("how many 10ps do you have"))
    20p = float(input("how many 20ps do you have"))
    50p = float(input("how many 50ps do you have"))
    1pound = float(input("how many 1pounds do you have"))


    print ("you have")
    print (10p + 20p + 50p + 1pound)
    asked Nov 13, 2016 in Python by anonymous

    1 Answer

    0 votes
    Variable names MUST start with a letter.  
    10p is an invalid variable name.  You could use pence_10 or value_10 or p10 instead.
    answered Nov 13, 2016 by smartin (10,770 points)
    Welcome to Selby Computing Q&A, where you can ask questions and receive answers from other students in Computer Science.