#s = raw_input('Enter some words:')
#frame='*'
#context='*'
#i=0
#while (i<len(s)):
# frame='%s*'%(frame)
# context='%s%s'%(context,s[i])
# i+=1
#frame='%s*'%(frame)
#context='%s*'%(context)
#print '%s\n%s\n%s'%(frame,context,frame)
注意把#号去掉就可以了,我用了5分钟,看来我不是高手啊
以上代码只能在python 2.x运行
不能在python 3.x运行
1 在python3.x中你要把raw_input()改为input()
2 把print调用,加上()
#s = input('Enter some words:')
#frame='*'
#context='*'
#i=0
#while (i<len(s)):
# frame='%s*'%(frame)
# context='%s%s'%(context,s[i])
# i+=1
#frame='%s*'%(frame)
#context='%s*'%(context)
#print('%s\n%s\n%s'%(frame,context,frame))
这样就可以在python 3.0中运行了
python编程出租车费计算有等待时间:
1、起步里程为3公里(含3公里),起步费13元。时速低于12公里/小时的慢速行驶时间计入等待时间,每等待1分钟加收1元。
2、载客里程3-15公里范围的,除起步费外,超过3公里的部分按基本单价2.3元/公里计算。
3、载客里程超过15公里的,15公里内的按照(2)计算,超过15公里的基本单价加收50%的费用。