- 博客(18)
- 资源 (2)
- 收藏
- 关注
原创 Python程序设计基础 Chapter04
4-1 a = [] while True: ctn = input('would u continue to input(yes/no):') if ctn == 'yes': num = int(input('plz input the num:')) a.append(num) else: break def get_avg(l): sum = 0 for i in l: sum += i
2021-11-12 23:34:13
629
转载 Python程序设计基础(第2版)by董付国 习题答案
@[toc] Python程序设计基础(第2版)by董付国 习题答案 C1 C2 C3 C4
2021-11-12 21:47:21
8459
原创 Python Summary2
多输入 letters = input('x y z = ') x, y, z = sorted(letters.split()) print(x, y, z) letters = input('x, y, z = ') x, y, z = sorted(letters.split(',')) print(x, y, z)
2021-11-11 21:15:16
765
原创 Python程序设计基础 Chapter02
2-1 num = int(input('plz input an num:')) a = int(num / 100) b = int(num / 10) - a * 10 c = num % 10 print('ones, tens, hundreds') print(a, b, c) --------------------------------------------------------------------------------------------------------------
2021-11-11 21:07:48
591
原创 Python编程:从入门到实践 练习答案 Chapter11
20211107 11-1 city_functions.py def get_city_country(city, country): return city.title() + ', ' + country.title() test_cities.py import unittest from city_functions import get_city_country class CityTestCase(unittest.TestCase): def test_get
2021-11-07 23:52:15
594
原创 Python编程:从入门到实践 练习答案 Chapter10
9-1 9-2 9-1 9-1 utyrrs 9-2 ```javascript 9-2
2021-11-07 16:15:04
407
原创 Python编程:从入门到实践 练习答案 Chapter09
20211102 9-1 class Restaurant(): def __init__(self, restaurant_name, cuisine_type): #_init_ (x) self.name = restaurant_name self.type = cuisine_type def describe_restarant(self): print(self.name + ' ' +self.
2021-11-02 23:44:33
210
原创 Python编程:从入门到实践 练习答案 Chapter08
20211101 8-1 def display_message(): print("I'm learning Function!") display_message() 8-2 def favorite_book(name): print('One of my favorite books is ' + name.title()) favorite_book('bible') 8-3 def make_shirt(size, pattern): print('ur size
2021-11-01 23:18:19
196
原创 Python Summary1
print("(If u do not know, just enter 'n')\n\ plz enter the num of the song(s):") OUTPUT: (If u do not know, just enter 'n') plz enter the num of the song(s): print("(If u do not know, just enter '...
2021-11-01 21:58:08
103
原创 Python编程:从入门到实践 练习答案 Chapter07
20211101 7-1 car = input('What kind of car would u like to rent? ') print('Let me see if I can fond u a ' + car) 7-2 num = int(input('How many people are in your dinner party tonight?: ')) if num > 8: print('sorry!there is no more vacant table') e
2021-11-01 19:35:47
115
原创 Python嵌套(列表列表,列表字典,字典字典,字典列表)
列表,字典 2 * 2 = 4 列表列表,列表字典,字典字典,字典列表, many-users.py 3.字典字典(origional) users = {'aeinstein': {'first': 'albert', 'last': 'einstein', 'location': 'princeton'}, 'mcurie': {'first': 'marie',
2021-10-31 21:05:48
255
原创 Python编程:从入门到实践 练习答案 Chapter06
20211030 6-1 person = { 'first_name': 'S', 'last_name': 'G', 'age': 21, 'city': 'SY', } print(person['first_name']) print(person['last_name']) print(person['age']) print(person['city']) 6-2 nums = { 'CJR': 1, 'SZX': 2
2021-10-31 00:48:26
393
2
原创 Python编程:从入门到实践 练习答案 Chapter03
## CHAPTER 03 3-1 names = ['L','H','L','W'] print(names[0]) print(names[1]) print(names[2]) print(names[3]) 3-2 names = ['L','H','L','W'] print('Hello ' + names[0]) print('Hello ' + names[1]) print('Hello ' + names[2]) print('Hello ' + names[3]) 3-3 co
2021-10-30 22:52:56
172
原创 Python编程:从入门到实践 练习答案 Chapter05
5-1 car = 'suzuki' print('Is car == "suzuki"? I predict True') print(car == 'suzuki') car = 'Jaguar' print('Is car == "Jaguar"? I predict False') print(car == 'jaguar') ... 5-2 car = 'suzuki' print('Is car == "suzuki"? I predict True') print(car == 'suzu
2021-10-29 23:23:09
169
原创 Python编程:从入门到实践 练习答案 Chapter04
4-1 pizzas = ['pineapple','sausage','origional'] for pizza in pizzas: print(pizza) pizzas = ['pineapple','sausage','origional'] for pizza in pizzas: print('I like ' + pizza) pizzas = ['pineapple','sausage','origional'] for pizza in pizzas:
2021-10-28 09:45:08
161
原创 the Zen of Python
1.the zen of python Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren’t specia
2021-07-20 08:01:59
127
原创 Python编程:从入门到实践 练习答案 Chapter02
2-1 message = "sb" print(message) 2-2 message = "sb" print(message) message = "lnu sucks" print(message) 2-3 name = "Eric" print("Hello " + name +", would u like to learn some Python today?") 2-4 name = "george s" print(name.lower()) print(name.uppe
2021-07-18 23:30:43
265
转载 java_experiment1
实验内容 1.定义类; 2.创建对象并使用对象; 3.类成员访问控制; 4.方法调用及参数传递。 基本要求 1.编写体现面向对象思想的程序; 2.编写创建对象和调用对象的方法的程序; 3.编写体现方法参数传递和方法重载的程序; 4.编写一个类,其成员具有不同的成员访问控制权限; 5.理解static成员的含义和作用。 实验题目 p.306, 9.7 设计一个名为Account的类,它包括: • —个名为id的int类型私有数据域(默认值为0)。 • —个名为balance的double类型私有数据域(默认值
2021-04-05 09:20:02
226
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人