- 博客(12)
- 收藏
- 关注
原创 SQL刷题--SELECT from WORLD Tutorial 练习
1.Read the notes about this table. Observe the result of running this SQL command to show the name, continent and population of all countries.SELECT name, continent, population FROM world2.How to use ...
2018-04-14 15:25:17 919
原创 sqlzoo练习--The JOIN operation
The JOIN operationuse world;select * from goal#1#Modify it to show the matchid and player name for all goals scored by Germany. #To identify German players, #check for: teamid = 'GER'select matchid,p...
2018-04-13 17:34:51 254
原创 爬取豆瓣小说
import requestsimport timefrom bs4 import BeautifulSoupurl='https://book.douban.com/tag/%E5%B0%8F%E8%AF%B4?start=0&type=T'urls=['https://book.douban.com/tag/%E5%B0%8F%E8%AF%B4?start={}'.format(str...
2018-03-07 11:01:11 617
原创 函数复习(放个假差点忘了......)
所有截图来自<python编程:从入门到实践>def make_shirt(size,pattern): print('My T-shirt size is '+size+'.\n'+'Print '+pattern.title()+' on it.')make_shirt('M','i love python')def make_shirt(size,pattern='i lo...
2018-02-22 13:31:15 232
原创 pygal--模拟投骰子
截图来自<Python编程:从入门到实践>die.pyfrom random import randintclass Die(): def __init__(self,num_sides=6): self.num_sides=num_sides def roll(self): return randint(1,self.n...
2018-02-21 01:02:05 555
原创 假期归来-matplotlib
截图来自<Python编程:从入门到实践>import matplotlib.pyplot as pltcubes=[x**3 for x in range(1,6)]input_values=list(range(1,6))plt.plot(input_values,cubes,linewidth=5,c='purple')plt.title('cube numbers',fonts...
2018-02-20 21:34:05 263
原创 Day3:字典练习
图片来自>'''6-1'''acquantanc_info={'first_name':'Alex','last_name':'Dexter','City':'Beijing','age':28}print(acquantanc_info)'''6-2'''numbers={ 'alex':5, 'bob':6,
2018-02-02 15:57:33 178
原创 Day3-if语句习题
图片来自Python编程:从入门到实践'''5-3'''alien_color=['green','yellow','red']if 'green' in alien_color: print('You got 5 points!')alien_color=['yellow','red']if 'green' in alien_color:
2018-02-02 11:43:11 337
原创 Day2:传递任意数量的实参
图片来自Python编程:从入门到实践'''8-12'''def make_sandwich(*whatever_you_want): print('\nAs you wish for your sandwich: ') for food in whatever_you_want: print('-' + food)make_sandw
2018-02-01 23:01:27 286
原创 Day2-传递列表练习
练习题图片来自本书8-9魔术师:magician_names=['Alex','Bob','Dexter']def show_magician(magician_names): for name in magician_names: print(name)show_magician(magician_names)8-10了不起的魔术师:'''8-10'''def make_great(magic
2018-02-01 21:24:16 216
原创 Day2:函数练习
所有截图来自def city_country(city_name,country_name): full_name=city_name + ', ' + country_name return full_namemy_country=city_country('tianjin','china')print(my_country.title())d
2018-02-01 16:05:33 175
原创 练习题-类-给属性指定默认值
截图来自我的代码如下:class Restaurant(): def __init__(self,restaurant_name,cuisine_type): self.restaurant_name=restaurant_name slef.cuisine_type=cuisine_type self.n
2018-01-31 14:36:53 1134
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人