python 第三天
来源:互联网 发布:js跨域请求的几种方式 编辑:程序博客网 时间:2024/06/18 08:08
今天只看了第五章if语句,剩余的时间看看斯科特杨的如何高效学习,总感觉自己的学习效率有点低,还有自己的专注也非常差,希望可以找到好的方法改善一下!这本书我非传上来供大家阅读!
今天就传两段小代码吧!
#if条件语句的学习和用法cars = ['audi','bmw','subaru','toyota']for car in cars:if car == 'bmw':#这行第一次编译失败,有不识别的字符,应该注意全英文输入print(car.upper ())else:print(car.title())#if-elseage = 12if age < 4:print("Your admission cost is $0.")elif age < 18:print("Your admission cost is $5." )else:print("Your admission cost is $10.")#检查特定值是否包含在列表中用in或者not inbanned_users = ['andrew','carolina','david']user = 'marie'if user not in banned_users:print(user.title() + ",you can post a response if you wish!")本文代码来自《python编程》
阅读全文
0 0
- Python第三天。
- Python 学习第三天
- Python学习第三天
- 学习python第三天
- Python: 第三天
- python学习第三天
- python第三天
- python 学习第三天
- 学习python第三天
- Python 学习第三天
- Python第三天
- 第三天学习python
- Python第三天-输入输出
- Python的第三天
- 初学Python第三天
- python 第三天
- python学习---第三天
- python基础第三天
- Java Activiti(10)--与spring整合配置文件activiti-context.xml
- 线性表综合实验之双链表的实现
- hdu 6161 Big binary tree
- 多路复用和多路分用
- POJ 2430 Lazy Cows 笔记
- python 第三天
- 微信小程序实战小小应用——豆瓣电影
- 氮氧碘磷初赛
- 动态规划问题3
- Springboot学习笔记005
- javascript基础之回调函数
- 003day(对变量及数据类型的学习)
- C++后台实践:古老的CGI与Web开发
- Source Tree 免登陆安装方法