For loop with If and elif or else in python -


question 1:

just tried execute program getting syntax error

i=input('enter value of i') j in range(10):     if i==j:         print'the value of %d'%(i)         elif i!=j:             print'please enter valid value'             else:                 print 'this not number' 

the difference between below 2 codes code 1 ask input once , loop trying compare, while code 2 ask input each loop (10x)...


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -