Python if one condition is met, print "..." -


i student rather nee learning programming languages, decided pick python , enjoying far. might have stupid question cant seem find solution, have written part of program , user inputs 3 values. if 1 of values breaks statement should print out correct answer. have..

lengte = input("wat de lengte die u nodig hebt?") breedte = input("wat de breedte die u nodig hebt?") hoogte = input ("wat de hoogte die u nodig hebt?") = 140 aa = 100 aaa = 110 b = 220 bb = 115 bbb = 120 if(hoogte in range(a) , breedte in range(aa) , hoogte in range(aaa)):     print "type a" if(hoogte in range(a,b) or breedte in range(aa,bb) or hoogte in range(aaa,bbb)):     print "type b" 

but when give in 170 hoogte , 40, 40 breedte , hoogte still prints out "type a" while in eyes should "type b" because value exceeds aa lower bb..

any appreciated, sorry if seems "noob" question.. yeh pretty new this.

may mis-type first condition. type hoogte, may lengte.

if(lengte in range(a) , breedte in range(aa) , hoogte in range(aaa)):     print "type a" if(lengte in range(a,b) or breedte in range(aa,bb) or hoogte in range(aaa,bbb)):     print "type b" 

the first conditional logic print "type a" if conditions true, while second print "type b" if @ least 1 condition true.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -