摘要: Python基础(3) # 面向对象编程 根据类来创建对象称为实例化。这里只过一下大概的面向对象的内容,不做细讲。可以直接查阅资料。https://www.runoob.com/python3/python3-class.html ## 创建和使用类及实例 给出一个类的使用例子: ```python class Dog: 阅读全文
posted @ 2023-07-18 17:21 雪国北风 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Python基础(2) # if 语句 给出一个简单的示例 ```python cars = ["audi", "bmw", "subaru", "toyota"] for car in cars: if car == "bmw": print(car.upper()) else: print(car.title()) ` 阅读全文
posted @ 2023-07-18 15:09 雪国北风 阅读(77) 评论(0) 推荐(0) 编辑