[Python] My Input Validation is not working properly. It runs through fine, but it isn't returning the data after validating the input.
If you look at the screenshot I posted, when I enter the characters number, It does not start the if statement pertaining to that number. It just stops.
@518nad
okay so what should be happening right now
attach the code files ill open em
Its a huge class file.
After running the input validation, It should connect to the characters file. So I tested the input validation. I inputted negative numbers, it gave an error message. I inputted garbage letters, it gave an error message. But afterwards, when I input a valid number, it did not open the characters file.
is it only failing if u do the failing check case
Yes
i dont see how ur connecting that function back to your character then
u cant just break like that
What do you mean? D:
like u have to tie that input back in to the string of functions again
Oh after validating it? how would I do that? I thought since I am returning the value within the Input Validation Class, it automatically connects it with the characters class, just as it does if i dont use input validation.
well
the first choice if its wrong its not going to changing the variable
Hm? Does that mean I have to chance value to choice within my input validation?
yeah
O
set choice equal to that line
also not quite sure u actually are setting the new value hes inputting in that function yet but this is a start
wait so do i change value to choice or newValue to choice in my input validation?
so do the change i ask u first
then we can fix ur while statement after
I did.
okay now check if ur while statement is actually changing anything
before return value put print value
okay
okay now tell me if its actually changing the value properly
Thats what i get.
okay so ur value is actually not changing
Oh....
How would I make it so that it changed? Would I have to put value = NewValue? so that it reverts back to the old variable?
yeaq
or put return newValue
i dont get how that except value error is working there, wont that just cause u to skip through the loop without actually changing
but ya im pretty sure u can figure this out
thats the only problem u got, just make sure ur variable is actually being assigned something, my gf is getting impatient!! i g2g
Okay. :/ Thanks
hope u fix it!!
@518nad
Here is where I am at right now.
ok looks like ur returning the right value lets make sure now
so now ur characterintro is not coming up properly right
Yessir
put a print statement under userinpur= lets see if its registered there
i think i know whats going on
kay
So put print(userInput) under the function call?
It prints the 1
do print type(userInput)
or just do userInpunt = str(userInput)
Is that spelling error suppose to be there?
no lol
Oh. YAY IT WORKED! :D
THANKS! <3
hahaa okay get to work
You are so bae. No homo <3 Lol
hahaa okay just remove all those useless print statements now
Yep, done.
just do that next time its good to check everything like that, that was bug checking 101 for u
Haha aight. Will do :)
:)
Join our real-time social learning platform and learn together with your friends!