Ask coding questions

← Back to all posts
save
LoganGG

please help me...
when i do insta 4 to save something to save 1, it saves to SAVED but never to SAVE1. please help me, as i am new to python 3, i have been coding 2.7 for 1 year now.

Answered by KeaganLandfried [earned 5 cycles]
View Answer
Voters
KeaganLandfried
LoganGG
Comments
hotnewtop
KeaganLandfried

Since you are receiving a raw input from the console, it is being read as a string. When checking for the input, make sure to put the numbers in quotes to ensure it checks for the string number and not the int number.
ex.)

Please mark this as answered if it answered your question :)

LoganGG

@KeaganLandfried ok thank you!!!

KeaganLandfried

@LoganGG
No problem m8, good luck!

KeaganLandfried

@LoganGG
No problem m8, good luck!

Kirit0

also instead of doing the entire \n thing in the beginning, you can do something like a console.clear command with the os module

Spacecraft

I think your input line is recorded as a string, but your IF statements are looking for integers, so they never match up. Try updating line 30 to this:

KeaganLandfried

@Spacecraft
This would work however it would break on a non-integer input.