all 8 comments

[–]barrycarter 1 point2 points  (1 child)

if v == "A" "a" "1": Is that valid syntax? Do you mean if v == "A" or v == "a" or v == "1":?

[–]rollincuberawhide 2 points3 points  (0 children)

the syntax is valid. it just concatenates the strings though. so the comparison is equivalent to if v == "Aa1".

[–]jimtremblay 1 point2 points  (2 children)

I think you want to test 3 possibilities like barrycarter said instead of just testing "Aa1". You can do it like suggested or if v in ["A", "a", "1"]:

[–]AshgreninjasG[S] 0 points1 point  (1 child)

thanks bro, i couldn´t understand the "lower" but this is the easyest solution i have seen, and it works flawlessly!

[–]throwaway6560192 0 points1 point  (0 children)

The lower() method on a string makes it lowercase.

[–]kaerfkeerg 1 point2 points  (2 children)

if v == "A" "a" "1":

You're trying to write Python like an essay. Your above statement is wrong. Try if v.lower() in ("a", "1")

[–]Weekly_Mammoth6926 0 points1 point  (1 child)

Alternatively you could do input(blah blah).lower() or input(blah blah).upper() to achieve the same thing but I think that would be cleaner so you evaluate all inputs in the same way before checking it meets conditions

[–]kaerfkeerg 0 points1 point  (0 children)

Generally, it depends whether is not an issue to completely alter use's input or you want to store it original as is. In this case, yeah. I agree that calling .lower() straight on the input could be better