#!/usr/bin/env python
# FileName: if.py
number = 23
guess = int(raw_input(‘Enter an integer :‘))
if guess == number:
print ‘Congratulations ,you guessed it.‘
print ‘But you do not win any prizes!‘
elif guess > number:
print ‘No, it is a little higher than that.‘
else:
print ‘No,is is a little lower than that‘
print ‘Done‘
Python脚本之流程控制if语句
时间: 2024-10-24 13:49:52