- 博客(18)
- 资源 (2)
- 收藏
- 关注
原创 Python程序设计基础 Chapter04
4-1a = []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: breakdef get_avg(l): sum = 0 for i in l: sum += i
2021-11-12 23:34:13 563
原创 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 672
原创 Python程序设计基础 Chapter02
2-1num = int(input('plz input an num:'))a = int(num / 100)b = int(num / 10) - a * 10c = num % 10print('ones, tens, hundreds')print(a, b, c)--------------------------------------------------------------------------------------------------------------
2021-11-11 21:07:48 539
原创 Python编程:从入门到实践 练习答案 Chapter11
2021110711-1city_functions.pydef get_city_country(city, country): return city.title() + ', ' + country.title()test_cities.pyimport unittestfrom city_functions import get_city_countryclass CityTestCase(unittest.TestCase): def test_get
2021-11-07 23:52:15 503
原创 Python编程:从入门到实践 练习答案 Chapter09
202111029-1class 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 119
原创 Python编程:从入门到实践 练习答案 Chapter08
202111018-1def display_message(): print("I'm learning Function!")display_message()8-2def favorite_book(name): print('One of my favorite books is ' + name.title())favorite_book('bible')8-3def make_shirt(size, pattern): print('ur size
2021-11-01 23:18:19 137
原创 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 59
原创 Python编程:从入门到实践 练习答案 Chapter07
202111017-1car = input('What kind of car would u like to rent? ')print('Let me see if I can fond u a ' + car)7-2num = 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 63
原创 Python嵌套(列表列表,列表字典,字典字典,字典列表)
列表,字典2 * 2 = 4列表列表,列表字典,字典字典,字典列表,many-users.py3.字典字典(origional)users = {'aeinstein': {'first': 'albert', 'last': 'einstein', 'location': 'princeton'}, 'mcurie': {'first': 'marie',
2021-10-31 21:05:48 186
原创 Python编程:从入门到实践 练习答案 Chapter06
202110306-1person = { '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-2nums = { 'CJR': 1, 'SZX': 2
2021-10-31 00:48:26 256 2
原创 Python编程:从入门到实践 练习答案 Chapter03
## CHAPTER 033-1names = ['L','H','L','W']print(names[0])print(names[1])print(names[2])print(names[3])3-2names = ['L','H','L','W']print('Hello ' + names[0])print('Hello ' + names[1])print('Hello ' + names[2])print('Hello ' + names[3])3-3co
2021-10-30 22:52:56 108
原创 Python编程:从入门到实践 练习答案 Chapter05
5-1car = 'suzuki'print('Is car == "suzuki"? I predict True')print(car == 'suzuki')car = 'Jaguar'print('Is car == "Jaguar"? I predict False')print(car == 'jaguar')...5-2car = 'suzuki'print('Is car == "suzuki"? I predict True')print(car == 'suzu
2021-10-29 23:23:09 109
原创 Python编程:从入门到实践 练习答案 Chapter04
4-1pizzas = ['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 85
原创 the Zen of Python
1.the zen of pythonBeautiful 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 90
原创 Python编程:从入门到实践 练习答案 Chapter02
2-1message = "sb"print(message)2-2message = "sb"print(message)message = "lnu sucks"print(message)2-3name = "Eric"print("Hello " + name +", would u like to learn some Python today?")2-4name = "george s"print(name.lower())print(name.uppe
2021-07-18 23:30:43 195
转载 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 170
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人