Python的几个编程作业..求教TAT刚开始学....

Python的几个编程作业..求教TAT刚开始学....,第1张

作业要自己做

#!/如皮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财富值我都不干。浪费三四小时帮辩和明你做携告作业

啥指点迷津,这是要源码。棚樱实现难度不难,写一堆代码不累死


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12472878.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存