第四周作业——第七章
2018-03-28 19:17
387 查看
7-1 汽车租赁car=input('what kind of cars do you want?')
print("let's me see if i can find you a ",car)输出PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
what kind of cars do you want?Subaru
let's me see if i can find you a Subaru7-3 10的整数倍num=input("please enter a number: ")
num=int(num)
if num%10 == 0:
print('this number is an integer multiple of 10')
else:
print('this number is not an integer multiple of 10')输出PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
please enter a number: 25
this number is not an integer multiple of 10
PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
please enter a number: 20
this number is an integer multiple of 107-5 电影票i=0
while i<3:
i=input('how old are you? ')
i=int(i)
if i<3:
print('the ticket price is free.')
elif 3<= i<=12:
print('the ticket price is 10 dollar.')
else:
print('the ticket price is 15 dollar.')
i += 1输出PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
how old are you? 16
the ticket price is 15 dollar.
PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
how old are you? 11
the ticket price is 10 dollar.7-8 熟食店sandwichs = ['potato','apple','pear']
finished_sandwich=[]
while sandwichs:
sandwich= sandwichs.pop()
print("i made ",sandwich,"sandwich.")
finished_sandwich.append(sandwich)
for temp in finished_sandwich:
print(temp)输出i made pear sandwich.
i made apple sandwich.
i made potato sandwich.
pear
apple
potato
print("let's me see if i can find you a ",car)输出PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
what kind of cars do you want?Subaru
let's me see if i can find you a Subaru7-3 10的整数倍num=input("please enter a number: ")
num=int(num)
if num%10 == 0:
print('this number is an integer multiple of 10')
else:
print('this number is not an integer multiple of 10')输出PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
please enter a number: 25
this number is not an integer multiple of 10
PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
please enter a number: 20
this number is an integer multiple of 107-5 电影票i=0
while i<3:
i=input('how old are you? ')
i=int(i)
if i<3:
print('the ticket price is free.')
elif 3<= i<=12:
print('the ticket price is 10 dollar.')
else:
print('the ticket price is 15 dollar.')
i += 1输出PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
how old are you? 16
the ticket price is 15 dollar.
PS C:\Users\wula\Desktop\大二下课程\高编\python_work> python .\第七章.py
how old are you? 11
the ticket price is 10 dollar.7-8 熟食店sandwichs = ['potato','apple','pear']
finished_sandwich=[]
while sandwichs:
sandwich= sandwichs.pop()
print("i made ",sandwich,"sandwich.")
finished_sandwich.append(sandwich)
for temp in finished_sandwich:
print(temp)输出i made pear sandwich.
i made apple sandwich.
i made potato sandwich.
pear
apple
potato
相关文章推荐
- 高级编程技术作业第四周 第七章课后练习
- 【第四周】第七章作业
- 第四周作业——第七章动手试一试
- 第四周作业——图的表示
- 第四周作业2:打字成绩判断~!
- JavaScript第七章课后作业
- 第四周作业
- 第四周作业——图的表示
- 第四周作业
- 第四周作业
- 第四周作业(下)
- 第四周作业
- 【高级编程技术】【作业】【第四周】【1】
- 【第四周】第七章习题
- 第四周作业_Chapter 8课后练习
- Coursera deep learning 吴恩达 神经网络和深度学习 第四周 编程作业 Building your Deep Neural Network
- 第四周编程作业1 素数和
- 金立清第四周作业
- 第四周作业
- 第四周作业(三)