if 语句----习题29扩展练习。learn python the hard way.
来源:互联网 发布:数据段 代码段堆栈段 编辑:程序博客网 时间:2024/05/29 05:56
#coding=utf-8
#raw_input()函数输出的数据是"str",需要将其处理成数据,使用int()函数,将“str"转换成数据来处理
students = int(raw_input("students number"))
fees_per_person = 80
cost = students * 3
total_income = students * fees_per_person
total_profit = total_income - cost
#raw_input()函数输出的数据是"str",需要将其处理成数据,使用int()函数,将“str"转换成数据来处理
students = int(raw_input("students number"))
fees_per_person = 80
cost = students * 3
total_income = students * fees_per_person
total_profit = total_income - cost
print "Our total_income is : %d." % total_income
print "Our total_profit is : %d." % total_profit
print "Our total_profit is : %d." % total_profit
if total_profit > 1000:
print "\tWe are making big money now."
if total_profit > 5000:
print "\tWe are making super money now."
if total_profit <= 10000:
print "\tWe still need to work harder, to make more money."
if total_profit >= 10000:
print "We don't need to work for the rest of the life."
print "\tWe are making big money now."
if total_profit > 5000:
print "\tWe are making super money now."
if total_profit <= 10000:
print "\tWe still need to work harder, to make more money."
if total_profit >= 10000:
print "We don't need to work for the rest of the life."
0 0
- if 语句----习题29扩展练习。learn python the hard way.
- 【Python】Learn Python the hard way, ex29 if语句
- Learn Python The Hard Way学习(29) - 什么是If
- Learn Python the hard way. 习题30. If和else/elif
- 【Python】Learn Python the hard way, ex35 通过一个简单游戏,练习循环和分支语句
- 学习learn python the hard way习题46, ImportError问题
- Learn Python The Hard Way 习题41详解
- 函数与文件-习题20--learn python the hard way
- 列表的操作,习题38,learn python the hard way.
- Learn Python The Hard Way学习(30) - Else和If
- 【Python】Learn Python the hard way, ex24 函数综合练习
- 【Python】Learn Python the hard way, ex25 函数综合练习
- 【python练习】--《learn python the hard way》ex39
- 【python练习】《learn python the hard way》ex41 opp_test.py
- Learn Python The Hard Way
- Learn Python The Hard Way
- 【Python】Learn Python the hard way, ex1 简单print语句
- Learn Python The Hard Way学习(24) - 更多的练习
- 云华听课笔记
- Android Service完全解析,关于服务你所需知道的一切(下)
- 求线段相交交点坐标
- 结构型模式之代理PROXY
- java第一天
- if 语句----习题29扩展练习。learn python the hard way.
- mysql,mysqli,pdo方式连接数据库[no such file or directory]
- 抽象类和接口的区别
- IntelliJ IDEA里缺少javax.servlet
- 几种Java序列化方式的实现
- 最大映射
- 一个系统引导程序的简单示例1
- Haskell语言学习笔记(13)Monadic Functions
- linux