0
getbase = input()
if getbase == 'b' or 'a' or 'c' or 'd':
    if getbase == 'b' or 'a':
        getnum = 2
    elif getbase == 'c' or 'd':
        getnum = 4
    else:
        getnum = 8
print(getnum)

based on this code it always return 2

I know I have to change the if blocks but still I am wondering why this happen in this case

maria
  • 25
  • 4

1 Answers1

0
if getbase == 'b' or getbase == 'a' or getbase == 'c'... 

you have to state what you are comparing each time

Derek Eden
  • 4,403
  • 3
  • 18
  • 31