Python课程,3小时快速入门

你觉得自己这辈子都学不会编程?超超超基础Python课程,3小时快速入门 【自学Python教程合集】【3小时快速入门Python】

https://www.bilibili.com/video/BV1944y1x7SW/?spm_id_from=333.337.search-card.all.click&vd_source=d10c649e248b08f4441d8cd6b76f46fc

P1先导篇1为什么做这个教程,UP主是闲得发慌吗
P2在你开始编程之前1为什么安装Python和PyCharm
P3 Windows |安装Python和PyCharm


P4 macOS|安装Python和PyCharm

P5 PyCharm|创建你的第一个项目

插件 安装chinese中文

P6 print | 让程序给你打印“爸爸”


P7 更多print |让程序给你打印一首诗

print('''
 关于入门Python后,下一步可以学什么的问题——
我和B站课堂官方合作的Python数据分析课上线啦!👉🏻 https://www.bilibili.com/cheese/play/ss2298
致力于帮你全面掌握Python数据技能,覆盖获取、读取、评估、清洗、整理、分析、可视化,还配合多个真实项目实战,简历更吸睛 👀
课程加餐还会教你把AI整合进数据工具(市面上其它数据分析课程没有的内容噢),让你的效率以一敌百!
课程风格仍然是视觉动画效果拉满+知识密集,帮你高效又轻松地掌握知识,一起武装起Python数据分析这个效率神器吧 [脱单doge]
''')

'''相当字符串模板'''
""""""""

P8 Python变量|怎么让程序记住你对象的手机号

msg="hello world"
print(msg)


P9 Python命名规则|哪些变量名算好名字

P10 Python数学运算|用代码秒杀计算器

https://docs.python.org/zh-cn/3/library/math.html

2**2 2的平方


import math

print(math.ceil(6.89))

P11 Python注释|悄悄在代码里骂用户?

"""
这是注释
"""

P12 Python数据类型1程序世界的物种们

字符串 str len(str) 长度 str[0]
整数 int
浮点数 float
布尔类型 bool True False
空值类型 NoneType None

type(var) 返回类型

P13 Python交互模式|读一行执行一行

文件py 命令模式

cmd 交互模式

P14 Python input|写个用户问答互动程序

name=str(input('please enter your name:'))
age=int(input('please enter your age:'))

print(f"name:{name},age:{age}")

P15 Python条件语句|对象今天会生气吗

star=int(input('current star:'))

if star>70:
    print('good')
else:
    print('bad')

P16 Python嵌套/多条件判断1对象今天会生气吗1

嵌套
star=int(input('current star:'))

if star>70:
    print('good')
elif star>60:
    print('great')
else:
    print('bad')

P17 Python逻辑运算1今年过节能收礼吗

andornot

P18 Python列表|创一个购物清单

s=s.upper()

max() min sorted

arr=[1,2,3,4,5]

# arr.append(8)

arr[0]='hello'

print(arr)

# print(len(arr))
#
# arr.remove(1)
#
# print(arr)

P19 Python字典|创个秒查流行语的词典

字典类似js的map 对象

不可变但又很像列表的数据结构 e_tuple=('x','k') 元组


in
del
len

dictionary={"koo":"KooTeam","john":"The Team"}

content=input('enter your search content:')

if content in dictionary:
    print(dictionary[content])
else:
    print('not exists')

P20 Python for循环|找出不正常体温

for 变量名 in 可迭代对象:

字典
temperature_dict.keys()#所有键
temperature_dict.values()#所有值
temperature_dict.items()#所有键值对

数组 字符串 字典 可迭代对象

dictionary={"koo":"KooTeam","john":"The Team"}

for key,value in dictionary.items():
    print(key,value)

P21 Python while循环|捕捉日落

index=0
while index<10:
    print(index)
    index += 1

P22 Python格式化字符串1优雅群发春节短信

name='koo'
age=23
# print(f"name:{name},age:{age}")
print("name:{name},age:{age}".format(name=name,age=age))

P23 Python函数(上)|不做代码复读机

P24 Python函数(下)|不做代码复读机

函数没有return语句,默认为return None

def func():
    return None

result=func()

P25 Python引入模块|别人写的,拿来吧你

内置函数 https://docs.python.org/zh-cn/3/library/functions.html

import语句
from...import….语句-

import math
math.floot()

//或
from math import floot
floot()

from math import *

pypi.org这个网站可以对第三方库进行搜索

P26 8分钟搞懂面向对象编程
P27 Python创建类(上)1没对象?实例化一个

P28 Python创建类(下)|当上帝的时刻到了

class Person:
    def __init__(self, name):
        self.name = name
    def speak(self):
        print('Hello ' + self.name)

p1 = Person('John')
p1.speak()

P29 Python 类继承|老鼠的儿子会打洞

class Person:
    def __init__(self, name):
        self.name = name
    def speak(self):
        print('Hello ' + self.name)

class Student(Person):
    def __init__(self,name,sid):
        super().__init__(name)
        self.sid = sid

s1 = Student('John','4')
s1.speak()

P30 Python文件路径|文件在哪里,代码咋知道

P31 Python文件操作(上)|会读文件,程序便有..

# f=open('./data.txt','r',encoding='utf-8')
# print(f.read())
# f.close()

# 自动关闭 f.close
with open('./data.txt','r',encoding='utf-8') as f:
    lines = f.readlines()
    for line in lines:
        print(line)

P32 Python文件操作(下)|会写文件,程序便有了..

r 读文件 文件不存在 会error

w 写文件 文件不存在 好创建 已经存在 会清空覆盖

a 追加内容

r+ 读写 追加

with open('./test.txt','w',encoding='utf-8') as f:
    f.write('hello world,\nI is kooteam,\nsceo')

P33 Python异常处理|程序炸之前,走一波预判

try:有可能产生错误的代码
except xxError:产生值错误时会运行
except xxError产生除零错误时会运行
except: 产生其它错误时会运行
else: 没有错误时会运行
finally: 不管发生错误与否都会运行

P34 Python测试(上)1不存在不写bug的程序员

assert 断言
unittest 单元测试

P35 Python测试(下)|高效率把bug揪出来

P36 Python高阶和匿名函数1脱了马甲也要认识

def func(num1,num2):
    return num1+num2

# 匿名函数
lambda num1,num2:num1+num2
# 立即执行
(lambda num1,num2:num1+num2)(1,2)

P37 Python入门啦|下一步是什么?

Python编程 从入门到实践(第3版)

《小白玩转Python数据分析》

《小白玩转AI大模型应用开发》

2

AI

https://yiyan.baidu.com/

qq浏览器 kimi 文心一言

posted @   KooTeam  阅读(82)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂
· 凌晨三点救火实录:Java内存泄漏的七个神坑,你至少踩过三个!
点击右上角即可分享
微信分享提示