
python编程
python的学习过程
future_sky_word
好好生活。
展开
-
python编程:从入门到实践 练习11-2
代码一:city_functions.pydef city_country(city,country,population=""): if population: return city.title() + " " + country.title() + " " + population else: return city.title() + " " + country.title() 代码二:test_cities.pyimport unittes原创 2022-05-01 00:46:22 · 117 阅读 · 0 评论 -
python编程:从入门到实践 练习10-12
首先我仿照案例编写了一个程序,主要用函数import jsondef get_stored_numbers(): """获取以及存储过的数字""" file_name = "numbers.json" try: with open(file_name) as file_object: number = json.load(file_object) except FileNotFoundError: return N原创 2022-05-01 00:45:16 · 127 阅读 · 0 评论 -
python编程:从入门到实践 练习 9-6
首先我仿照案例编写了一个程序,主要用函数import jsondef get_stored_numbers(): """获取以及存储过的数字""" file_name = "numbers.json" try: with open(file_name) as file_object: number = json.load(file_object) except FileNotFoundError: return N原创 2022-05-01 00:44:41 · 421 阅读 · 0 评论 -
python编程:从入门到实践 练习 9-9
贴一下调试过程自己犯的错误,警示自己,还是不够熟练class Car(): def __init__(self,make,model,year): self.make = make self.model = model self.year = year self.odometer_reading = 0 def get_descriptive_name(self): long_name = str(self.原创 2022-05-01 00:43:16 · 127 阅读 · 0 评论