- 博客(9)
- 收藏
- 关注
原创 Python学习日志 - 9.类(习题解答)
#9-1 餐馆class Restaurant(): def __init__(name, ctype): self.Restaurant_name = name self.Cuisine_type = ctype def describe_restaurant(): print("Name: " + str(self.Restaurant_n...
2018-04-16 09:38:09
260
原创 Python学习日志 - 8.函数(习题解答)
#8-1 消息def display_message(): print("This is a message")#8-2 喜欢的图书def favorite_book(title): print("One of my favorite book is " + title)#8-3 T恤def make_shirt(size, s): print("We will make a s...
2018-04-02 01:52:29
271
原创 Python学习日志 - 7.用户输入和while循环(习题解答)
#7-1 汽车租赁print("Enter the car you want:")car = input()print("Let me see if I can find you a " + car)#7-2 餐馆订位num = input()if num <= 8: print("Empty tables here")else: print("No empty table le...
2018-04-02 01:43:27
1148
原创 Python学习日志 - 6.字典(习题解答)
#6-1 人people = { "first_name" : "Bill", "last_name" : "Gate", "age" : 34, "city" : "Los Angeles"}#6-2 喜欢的数字numbers = { "bill" : 2, "john" : 3, &q
2018-04-02 01:35:47
170
原创 Python学习日志 - 5.if语句(习题解答)
# 5-3alien_color = "green"if alien_color == "green": print("You got 5 point")alien_color = "red"if alien_color == "green": print("You got 5 point")#5-4alien_color = "red"if alien_c
2018-03-25 14:53:24
706
原创 Python学习日志 - 4.操作列表(习题解答)
4-1比萨pizzas = ['chicken pizza', 'beef pizza', 'seafood pizza']for pizza in pizzas: print(pizza)for pizza in pizzas: print("I like {}".format(pizza))print("I really love pizza")4-2动物pets = [...
2018-03-18 23:00:00
361
原创 Python学习日志 - 3.列表简介(习题解答)
3-1姓名names = ['Billy', 'John', 'Jerry']for name in names: print(name)3-2问候语names = ['Billy', 'John', 'Jerry']for name in names: print("dear" + name + ":") print("\tIt is so nice to print...
2018-03-18 18:19:45
139
原创 Python学习日志 - 2.变量和简单数据类型(习题解答)
2-1简单消息msg = "this is a message"print(msg)2-2多条简单消息msg = "this is a message"print(msg)msg = "this is another message"print(msg)2-3个性化消息username = input()msg = "Hello {{name}}, would you like to l...
2018-03-11 16:58:45
254
原创 Python学习日志 - 1.入门&概览
本日志回答了如下两个问题1.浏览Python主页(https://www.python.org/),在博客上写下你有哪些发现和收获2.假设你已经成为一名Python编程高手,你打算实现怎样的程序?在博客上写下你的目标1.要说python官网留给我最大的印象就是这一款语言有两个发行版本,分别是3.6.4和2.7.14,而且这两个版本是不互相兼容的,这种不兼容性甚至能够体现在最普通的输出(print)...
2018-03-11 16:36:28
164
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人