I have a computing homework due in for tomorrow and I am really confused why it doesn't work! It is very simple, I hear, and so should be no problem for you to fix, if you would be so kind

The project is, that the user inputs a 4 digit decimal number and then answers a menu on how they would like it to be outputted - either a word place value or number place value. I am using strings to split the number, and have the code nearly ready, I think, however I keep getting syntax errors and am coming close to punching my computer! Here is the code:

- Code: Select all
`string=str(int(input("Enter a number <10000 ")))`

num1=int(string[0])

num2=int(string[1])

num3=int(string[2])

num4=int(string[3])

number1=num1*1

number2=num2*10

number3=num3*100

number4=num4*1000

answer1=("The number has: \n\

",num4,"thousands \n\

",num3,"hundeds \n\

",num2,"tens \n\

",num1,"units")

answer2=("Place value: \n\

",num4," ",number4" \n\

",num3," ",number3" \n\

",num2," ",number2" \n\

",num1," ",number1" \n)

menuanswer=int(input("Would you like to see: \n\

1. Word place value \n\

2. Number place value \n\

3. Both word & number place value")

if menuanswer == 1:

print(answer1)

elif menuanswer == 2:

print(answer2)

elif menuanswer == 3:

print(answer1,answer2)

else:

print("You have not inputted correctly")

Please help me, it would mean a lot And thank you for any help you choose to give!