今儿学会了在IDIE里代码,按F5执行。代码如下:
#!/D:/软件们/python
# Filename: if.py
number = 23
guess = int(input('Enter an integer: '))
if guess == number:
print ( '恭喜你,对咧!' ) # New block starts here
print ( "(但是没有小炒喔)" ) # New block end here
elif guess < number:
print ( '再大一点儿' ) # Another block
# You can do whatever you want in a block...
else:
print ( '再碎一点儿' )
# you must have guess > numner to reach here
print ( '忒色!' )
# This last statement is always executed, after the if statment is executed
#!/D:/软件们/python
# Filename: if.py
number = 23
guess = int(input('Enter an integer: '))
if guess == number:
print ( '恭喜你,对咧!' ) # New block starts here
print ( "(但是没有小炒喔)" ) # New block end here
elif guess < number:
print ( '再大一点儿' ) # Another block
# You can do whatever you want in a block...
else:
print ( '再碎一点儿' )
# you must have guess > numner to reach here
print ( '忒色!' )
# This last statement is always executed, after the if statment is executed