Python learning series day1-python basics

Python development learning directory
Development:
development language:
high-level language: Java, python (webpage and background), c #, c ++, PHP (write webpage), go ===》 bytecode
underlying language: c, assembly ===》 machine code

Types of Python / Interpreter:
JPython
IronPython
Cpython
JavaScriptPython
RubyPython

PyPy Python developed with CPython is the fastest

Installation:
Operating System:
perform the operations:
in accordance with the rules of a python, then the compiler to convert byte code into machine code converted to the operating system
python interpreter (own memory management)
Version:
Python 2 / to python3
environment variables
with the environment Variable: add software path exe file

 a. python基础
   -基础部分
		1.第一句python代码:
			print('hello world')
				需要注意的是文件保存方式对python的运行没有影响,即文件后缀名为。txt的文件也可以运行
				考虑到导入模块时,就不能用不同的文件保存方式
		2.python代码两种执行方式
			python解释器/python文件路径
			进入python解释器输入代码
		3.Linux系统中特别注意的情况
			文件外:./2.py
			文件内:需要在首行加上一句 #!/usr/bin/env python(解释器路径)
		4.编码
			# -*- coding:utf8 -*-(用在python2中,python3无需加)
			utf8编码方式:只用最少的位数表示字符,即能用8位表示的ascill码只用8位,可以用来压缩数据
		5.执行操作:
			input('请输入某个:')
		6.变量名
			#变量只能由字母/数字/下划线组成,且首字符不能为数字,并且某些关键字也不能使用
		7.条件语句
			一.if 条件:
					print('ok')
				else:
					print('error')
				补充:if/else可以进行嵌套
			二.if 条件:
					if 条件:
				else:
			三. if tiaojian:
			    elif tiaojian:
				else:
		8.字符串
			“shuaibi”
			"""shuaibi"""
			'shuaibi'
			'''shuaibi'''
			p,s,:字符串乘法为多少次重复叠加
			3**3:3的3次方
			40%7 :除法所得的余数
			40//7:得商为5
		9.循环
			死循环
			while True:
				print(('xxx')
		10.作业
			1、使用while循环输入 1 2 3 4 5 6     8 9 10
				i=1
				while i < 11:
					if i == 7:
						pass
					else:
						print(i)
					i = i+1
				print('----end-----')

			2、求1-100的所有数的和
				i = 1
				sum = 0
				while i < 101:
					sum=sum+i
					i=i+1
				print(sum)
			
			3、输出 1-100 内的所有奇数
				i = 1
				while i < 101:
					temp = i % 2
					if temp == 0:
						pass
					else:
						print(i)
					i = i + 1
				print('----end----')
			4、输出 1-100 内的所有偶数
				i = 1
				while i < 101:
					temp = i % 2
					if temp == 1:
						pass
					else:
						print(i)
					i = i + 1
				print('----end----')
				
			5、求1-2+3-4+5 ... 99的所有数的和
				i = 1
				sum = 0
				while i < 100:
					if i%2 == 1:
						sum = sum + i
					else:
						sum = sum - i
					i=i+1
				print(sum)
					
   -基本数据类型
   -函数
   -面向对象 
   
 b. 网络编程

 c. WEB框架

 d. 设计模式+算法

 e. 项目阶段
Published 4 original articles · Likes0 · Visits 63

Guess you like

Origin blog.csdn.net/weixin_45583352/article/details/105537126