#!/如皮usr/bin/env python
print '''I have 3 kinds of fruit:
apple: $1.29/lb
grage: $2.29/lb
orange: $1.5/lb'''
choice = raw_input('Which one do you want? ')
if choice == 'grape':
weight = float(raw_input('Ok, grape. How many pounds do you want? '))
print 'the cost is', round(weight*2.29,2)
elif choice == 'apple':
weight = float(raw_input('Ok, apple. How many pounds do you want? '))
print 'the cost is', round(weight*1.29,2)
elif choice == 'orange':
weight = float(raw_input('Ok, orange. How many pounds do you want? '))
print 'the cost is', round(weight*1.5,2)
else:
print 'Sorry, we don\'t have that.'
#!/usr/bin/env python
def smallest(x,y,z):
temp = y if y<z else z
return x if x<temp else temp
a = float(raw_input('Enter the 1st number: '袜镇))
b = float(raw_input('Enter the 2nd number: '))
c = float(raw_input('Enter the 3rd number: '))
print smallest(a,b,c),'is the smallest.'
#!/usr/bin/告橡粗env python
left = int(raw_input('Enter the beginning integer: '))
right = int(raw_input('Enter the ending integer: '))
print ("All the integers between %d and %d that are divisible by both 3 and 7 are:" %(left,right))
for i in range(left,right+1):
if i%21==0:
print i,
这都属于项目范围了。100行代码,悬赏300-500财富值我都不干。浪费三四小时帮辩和明你做携告作业
啥指点迷津,这是要源码。棚樱实现难度不难,写一堆代码不累死
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)