This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import dis | |
| def for_version(): | |
| y = 0 | |
| for x in [1, 2, 3]: | |
| y += x * 2 | |
| def iter_version(): | |
| _gen_ = iter([1, 2, 3]) | |
| y = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ Check your work by running python -m doctest -v popstar.py """ | |
| def gen_popstar_name(last_name, street, last_food): | |
| """Your pop star name is your last name followed | |
| by the name of the street your grew up on followed | |
| by the last food you ate. | |
| The only whitespace should be between each of the | |
| three parts, and the name should be uppercase. | |
| >>> gen_popstar_name("fox", "city lights", "bananas") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>Fibonacci (Animated)</title> | |
| <style> | |
| body { | |
| background: #f3f3f3; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Source: | |
| https://www.kaggle.com/nasa/astronaut-yearbook | |
| */ | |
| CREATE TABLE astronauts( | |
| Name TEXT PRIMARY KEY, | |
| Year INTEGER, | |
| GroupNum INTEGER, | |
| Status TEXT, | |
| Birth_Date TEXT, | |
| Birth_Place TEXT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Source: | |
| https://www.kaggle.com/jacobbaruch/nba-player-of-the-week | |
| */ | |
| CREATE TABLE players( | |
| Player TEXT, | |
| Team TEXT, | |
| Conference TEXT, | |
| Date TEXT, | |
| Position TEXT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE pokemon( | |
| Number INTEGER, | |
| Name TEXT PRIMARY KEY, | |
| Type_1 TEXT, | |
| Type_2 TEXT, | |
| Total INTEGER, | |
| HP INTEGER, | |
| Attack INTEGER, | |
| Defense INTEGER, | |
| Sp_Atk INTEGER, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE superbowls( | |
| Date TEXT PRIMARY KEY, | |
| SB TEXT, | |
| Winner TEXT, | |
| Winner_Pts INTEGER, | |
| Loser TEXT, | |
| Loser_Pts INTEGER, | |
| MVP TEXT, | |
| Stadium TEXT, | |
| City TEXT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {50, "L"}, | |
| {40, "XL"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### News Aggregators | |
| 127.0.0.1 redditate.com | |
| 127.0.0.1 news.google.com | |
| 127.0.0.1 news.yahoo.com | |
| 127.0.0.1 news.ycombinator.com | |
| ### News | |
| 127.0.0.1 cnn.com | |
| 127.0.0.1 recode.net | |
| 127.0.0.1 techcrunch.com | |
| 127.0.0.1 mashable.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from bs4 import BeautifulSoup | |
| import requests | |
| import string | |
| def save_to_file(filename, sayings): | |
| file = open(filename, "w") | |
| file.write("\n".join(sayings).encode("utf-8")) | |
| file.close() |