Python第一周学习总结
2018-03-04 14:42
357 查看
Python概述
Python这门语言可以用Python之禅来形容其特点 ''' python import this Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those! '''
Python的优缺点
优点:简单、直接、生态圈特别好、完美的平台可移植性缺点:执行效率低下、无法进行加密
Python中变量的类型
1.整型(int) 2.字符串类型(string) 3.浮点型(float) 4.布尔型(Boolean)
Python中的运算符
1.赋值运算符:= 2.算数运算符:>、<、==、>=、<=、 3.逻辑运算符:and、or 4.身份运算符:is、is not
Python中的分支结构
练习
'''python import math num = random.randint() if num > 3 : print('你是个瓜皮') else : print('你在玩蛇') '''
Python中的循环结构
练习
'''python fish=1 while True: total = fish is_enough = True for _ in range(5): if (total - 1) % 5 == 0: total = (total - 1) // 5 * 4 else: is_enough = False break if is_enough: print(fish) break fish += 1 '''
相关文章推荐
- python爬虫学习第一周总结
- Python第一周学习总结
- Python的第一周学习总结
- Python学习第五天——第一周总结
- Python 学习第一周总结
- python中字符串类型的一些学习总结
- python学习总结---一些函数
- 软件测试第一周学习总结
- Python学习第一周-知识点
- C#学习总结(第一周)
- python学习总结五
- 每周学习总结---ELM python实现
- Python学习总结-文件与IO
- python 学习总结(二)
- 20145213《Java程序设计》第一周学习总结
- 20145127 《Java程序设计》第一周学习总结
- Python:2D绘图库matplotlib学习总结
- 20145229吴姗珊《JAVA程序设计》第一周学习总结
- 20144303 《Java程序设计》第一周学习总结
- [Python学习]总结一下Cygwin安装与进阶学习列表