today i was provoked by a message which reminded me of who i was and what i should at the sake of god. one endeavour,one poession. jesus love all .
what i learn today is one of the control flow of python --if control flow,kinda of awesome. let is take a look at it .
i write a script:
#! /usr/bin/python #what is the meaning of "#!"?remmber it ?
# Filename pythonif.py
number = 20
guess =int (raw_input('Enter an integer:'))
if guess == number : #take care of the : in c/c++ it is illegal
print 'you got it,dude!'
elif guess < number :
print 'it is a little higer than what you guess just now'
else :
print 'it is a little lower than what you guess just now'
print "over!"
ok! i save it as pythonif.py
the outcome of which is :
Enter an integer: 10
it is a little higer than what you guess just now
over!
a page a day 4
最新推荐文章于 2024-09-14 19:55:48 发布