PythonMosh学习笔记(6⼩时完全⼊门)Python Mosh 学习笔记
这两个博主写得都挺好的。
02:01:45 2D Lists
02:05:11 My Complete Python Course
02:06:00 List Methods
02:13:25 Tuples
02:15:34 Unpacking
02:18:21 Dictionaries
02:26:21 Emoji Converter
02:30:31 Functions
02:35:21 Parameters
02:39:24 Keyword Arguments
02:44:45 Return Statement
02:48:55 Creating a Reusable Function
02:53:42 Exceptions
02:59:14 Comments
03:01:46 Classes
03:07:46 Constructors
03:14:41 Inheritance
03:19:33 Modules
03:30:12 Packages
03:36:22 Generating Random Values
03:44:37 Working with Directories
03:50:47 Pypi and Pip
03:55:34 Project 1: Automation with Python
04:10:22 Project 2: Machine Learning with Python
04:58:37 Project 3: Building a Website with Django
⽬录
00:00:00 简介
00:01:49 安装Python 3
00:06:10 您的第⼀个Python程序
00:08:11 如何执⾏Python代码
00:11:24 学习Python需要多长时间
00:13:03 变量
00:18:21 接收输⼊
00:22:16 Python备忘单
00:22:46 型号转换
00:29:31 字符串
00:37:36 格式化字符串
00:40:50 字符串⽅法
00:48:33 算术运算
00:51:33 运算符优先级
00:55:04 数学函数
00:58:17 国际单项体育联合会声明
01:06:32 逻辑运算符
01:11:25 ⽐较运算符
01:16:17 重量转换器程序
01:20:43 While循环
01:24:07 制作猜谜游戏
01:30:51 打造汽车游戏
01:41:48 循环
01:47:46 嵌套循环
01:55:50 名单
02:01:45 ⼆维列表
02:05:11 我的完整蟒蛇课程
02:06:00 列表⽅法
02:13:25 元组
02:15:34 拆包
02:18:21 字典
02:26:21 表情转换器
02:30:31 功能
02:35:21 参数
02:39:24 关键字参数
02:44:45 返回语句
02:48:55 创建可重⽤函数
02:53:42 例外
02:59:14 评论
03:01:46 类
django项目实例03:07:46 施⼯⼈员
03:14:41 继承
03:19:33 模块
03:30:12 包裹
03:36:22 ⽣成随机值
03:44:37 使⽤⽬录
03:50:47 ⽪⽪和⽪⽪
03:55:34 项⽬1:使⽤Python实现⾃动化
04:10:22 项⽬2:使⽤Python进⾏机器学习04:58:37 项⽬3:与Django建⽴⽹站
来⾃于b站视频 BV14J411U7hj
6⼩时完全⼊门的代码/笔记
print("Hello World!")
print('o----')
print(' ||||')
print('*'*10)
price =10
price =20
print(price)
rating =4.9
name ='HELLO'
is_published =True
# python对⼤⼩写敏感,true这个就是错误的布尔值,必须是True i_published =False
patient_name ='John Smith'
patient_age =20
patient_status ='New'
patient_status_plus =True
is_new =True
# name = input('What is your name? ')
print('Hi '+ name)
name =input('What is your name? ')
color =input('What is your favorite color? ')
print(name +' likes '+ color +'.')
截⽌到0:38:51
birth_year =input('Birth year: ')
# input函数,⽆论你在终端输⼊什么,都会被认为是字符串类型的
# 2020 - ‘1999’ python don't know how to do
# int()
# float()
# bool()
# 以上函数是强制转换类型
# 获得变量的类型,并打印类型的函数 type()函数获取括号内变量的数据类型
print(type(birth_year))
age =2020-int(birth_year)
print(type(age))
print(age)
# 下⾯是错误范例 int(weight)
# weight是str类型的
# 通过 int(weight)函数,请问weight变成什么类型了
weight ='70'
int(weight)
print(type(weight))
# 可以看出<class 'str'>,weight依然是str类型的
# weight = input('What your weight in pounds? ')
# int(weight)
# weight_kg = weight * 0.45
# print(weight_kg)
# 所以改为如下
weight =input('What your weight in pounds? ')
weight_kg =int(weight)*0.45
print(weight_kg)
print(str(weight_kg)+'kg')
# course = 'Python's Course for Beginners' 这句会报错,因为在''s之前字符串就结束了# 双引号的作⽤这时候就可以运⽤双引号
course ="Python's Course for Beginners"
print(course)
# 同样单引号也有这种⽤法
course ='Python for "Beginners"'
print(course)
course ='''
Hi John
Here is our first email to you.
Thank you,
The support team
'''
print(course)
course ='Python for Beginners'
print(course[0])# 这个就是索引,我们在其它编程语⾔中没有的特性之⼀ P
print(course[-1])# s
print(course[-2])# r
print(course[0:3])# Pyt
print(course[0:])# Python for Beginners
print(course[1:])
print(course[:5])
# copy [:]
course ='Python for Beginners'
another = course[:]
print(another)
name ='Jennifer'
print(name[1:-1])
截⽌到0:59:28
import math  # import 要放在最上⽅
# You can search in Google : Python 3 math model, then you could see the file about it. il(2.9))# ceil向上取整
print(math.floor(2.9))# floor向下取整
first ='John'
last ='Smith'
message = first +' ['+ last +'] is a coder'
msg = f'{first} [{last}] is a coder'
print(message)
print(msg)
course ='Python for Beginners'
print(len(course))
print(course.upper())
print(course.lower())
print(course)
print(course.find('P'))
print(course.find('o'))
print(course.find('O'))
place('Beginners','Absolute Beginners'))
place('P','J'))
print('Python'in course)
print('python'in course)
# len()
# course.upper()
# course.lower()
# course.title()
# course.find()
# place()
# '...' in course
print(10//3)# 整除
print(10/3)
print(10%3)
print(10**3)# 10^3
x =10
x = x +3
x +=3
print(x)
# Operate Precedence
# Math Function
x =2.9
print(round(x))
print(abs(-2.9))# 取绝对值 absolute
截⽌到1:11:31

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。