├── .gitignore ├── LICENSE ├── README.md ├── certificate.pdf ├── days001-010 ├── day001 │ ├── exercises │ │ ├── exe01.py │ │ ├── exe02.py │ │ ├── exe03.py │ │ └── exe04.py │ ├── lectures │ │ ├── lec01.py │ │ ├── lec02.py │ │ ├── lec03.py │ │ └── lec04.py │ └── project │ │ └── band_name_generator.py ├── day002 │ ├── exercises │ │ ├── exe01.py │ │ ├── exe02.py │ │ └── exe03.py │ ├── lectures │ │ ├── lec01.py │ │ ├── lec02.py │ │ ├── lec03.py │ │ └── lec04.py │ └── project │ │ └── tip_calculator.py ├── day003 │ └── project │ │ └── treasure_island.py ├── day004 │ ├── exercises │ │ ├── exe01.py │ │ ├── exe02.py │ │ └── exe03.py │ ├── lectures │ │ ├── lec01.py │ │ ├── lec02.py │ │ ├── lec03.py │ │ └── my_module.py │ └── project │ │ └── rock_paper_scissors.py ├── day005 │ ├── exercises │ │ ├── exe01.py │ │ ├── exe02.py │ │ ├── exe03.py │ │ └── exe04.py │ ├── lectures │ │ ├── lec01.py │ │ └── lec02.py │ └── project │ │ └── password_generator.py ├── day006 │ ├── lectures │ │ ├── lec01.py │ │ └── lec02.py │ └── reeborg │ │ ├── Challenges.ipynb │ │ ├── Lectures.ipynb │ │ ├── Project.ipynb │ │ └── imgs │ │ ├── alone1.png │ │ ├── alone2.png │ │ ├── alone3.png │ │ ├── alone4.png │ │ ├── alone5.png │ │ ├── hurdle1a.png │ │ ├── hurdle1b.png │ │ ├── hurdle2.png │ │ ├── hurdle3.png │ │ ├── hurdle4.png │ │ ├── maze1.png │ │ ├── maze2.png │ │ ├── maze3.png │ │ └── maze4.png ├── day007 │ ├── challenges │ │ ├── cha01.py │ │ ├── cha02.py │ │ ├── cha03.py │ │ └── cha04.py │ └── project │ │ ├── art.py │ │ ├── hangman.py │ │ └── words.py ├── day008 │ ├── exercises │ │ ├── exe01.py │ │ └── exe02.py │ ├── lectures │ │ ├── lec01.py │ │ └── lec02.py │ ├── project │ │ ├── art.py │ │ └── caesar_cipher.py │ └── steps │ │ ├── ste01.py │ │ ├── ste02.py │ │ └── ste03.py ├── day009 │ ├── exercises │ │ ├── exe01.py │ │ └── exe02.py │ ├── lectures │ │ ├── lec01.py │ │ └── lec02.py │ └── project │ │ ├── art.py │ │ └── secret_auction.py └── day010 │ ├── exercises │ └── exe.py │ ├── lectures │ ├── lec01.py │ ├── lec02.py │ └── lec03.py │ ├── project │ ├── art.py │ └── calculator.py │ └── steps │ ├── ste01.py │ ├── ste02.py │ ├── ste03.py │ └── ste04.py ├── days011-020 ├── day011 │ └── Blackjack Game Capstone │ │ ├── art.py │ │ └── main.py ├── day012 │ ├── lectures │ │ ├── lec01.py │ │ ├── lec02.py │ │ ├── lec03.py │ │ └── lec04.py │ └── project │ │ ├── art.py │ │ └── guessing_game.py ├── day013 │ ├── exercises │ │ ├── exe01.py │ │ ├── exe02.py │ │ └── exe03.py │ └── lectures │ │ ├── lec01.py │ │ ├── lec02.py │ │ ├── lec03.py │ │ ├── lec04.py │ │ ├── lec05.py │ │ └── lec06.py ├── day014 │ └── project │ │ ├── art.py │ │ ├── game_data.py │ │ └── higher_lower.py ├── day015 │ ├── lectures │ │ └── lec.py │ └── project │ │ ├── coffee_machine.py │ │ └── coffee_machine_requirements.pdf ├── day016 │ ├── lectures │ │ ├── another_module.py │ │ ├── lec01.py │ │ ├── lec02.py │ │ └── lec03.py │ └── project │ │ ├── coffee_machine.py │ │ ├── coffee_machine_doc.pdf │ │ ├── coffee_machine_requirements.pdf │ │ ├── coffee_maker.py │ │ ├── menu.py │ │ └── money_machine.py ├── day017 │ ├── lectures │ │ ├── lec01.py │ │ ├── lec02.py │ │ ├── lec03.py │ │ └── lec04.py │ └── project │ │ ├── data.py │ │ ├── question_model.py │ │ ├── quiz.py │ │ └── quiz_brain.py ├── day018 │ ├── challenges │ │ ├── cha01.py │ │ ├── cha02.py │ │ ├── cha03.py │ │ ├── cha04.py │ │ └── cha05.py │ ├── lectures │ │ ├── lec01.py │ │ ├── lec02.py │ │ ├── lec03.py │ │ ├── lec04.py │ │ ├── lec05.py │ │ ├── lec06.py │ │ └── lec07.py │ ├── project │ │ └── hirst_painting.py │ └── steps │ │ ├── color_palette.png │ │ └── ste.py ├── day019 │ ├── challenges │ │ └── cha.py │ ├── lectures │ │ ├── lec01.py │ │ └── lec02.py │ └── project │ │ └── turtle_race.py └── day020 │ └── steps │ ├── snake.py │ ├── ste01.py │ ├── ste02.py │ ├── ste03.py │ └── ste04.py ├── days021-030 ├── day021 │ ├── lectures │ │ ├── lec01.py │ │ └── lec02.py │ └── project │ │ ├── food.py │ │ ├── scoreboard.py │ │ ├── snake.py │ │ └── snake_game.py ├── day022 │ └── project │ │ ├── ball.py │ │ ├── paddle.py │ │ ├── pong_game.py │ │ └── scoreboard.py ├── day023 │ └── capstone │ │ ├── car_manager.py │ │ ├── crossing_game.py │ │ ├── player.py │ │ └── scoreboard.py ├── day024 │ ├── challenges │ │ ├── cha.py │ │ ├── data.txt │ │ ├── food.py │ │ ├── scoreboard.py │ │ └── snake.py │ └── project │ │ ├── Input │ │ ├── Letters │ │ │ └── starting_letter.txt │ │ └── Names │ │ │ └── invited_names.txt │ │ ├── Output │ │ └── ReadyToSend │ │ │ ├── example.txt │ │ │ ├── letter_for_Aang.txt │ │ │ ├── letter_for_Appa.txt │ │ │ ├── letter_for_Iroh.txt │ │ │ ├── letter_for_Katara.txt │ │ │ ├── letter_for_Momo.txt │ │ │ ├── letter_for_Sokka.txt │ │ │ ├── letter_for_Toph.txt │ │ │ ├── letter_for_Uncle.txt │ │ │ └── letter_for_Zuko.txt │ │ └── mail_merge.py ├── day025 │ ├── US States Game (turtle) copy │ │ ├── 50_states.csv │ │ ├── Learning-Report.csv │ │ ├── blank_states_img.gif │ │ ├── main.py │ │ └── quiz_handler.py │ └── lectures │ │ ├── lec01 │ │ ├── main.py │ │ └── weather_data.csv │ │ ├── lec02 │ │ ├── main.py │ │ ├── students_data.csv │ │ └── weather_data.csv │ │ └── lec03 │ │ ├── 2018_squirrel_census.csv │ │ ├── main.py │ │ ├── squirrel_count.csv │ │ └── squirrel_data.csv ├── day026 │ ├── exercises │ │ ├── exe01.py │ │ ├── exe02.py │ │ ├── exe03 │ │ │ ├── file1.txt │ │ │ ├── file2.txt │ │ │ └── main.py │ │ ├── exe04.py │ │ └── exe05.py │ ├── lectures │ │ ├── lec01.py │ │ ├── lec02 │ │ │ ├── 50_states.csv │ │ │ ├── blank_states_img.gif │ │ │ └── main.py │ │ ├── lec03.py │ │ └── lec04.py │ └── project │ │ ├── nato_alphabet.py │ │ └── nato_phonetic_alphabet.csv ├── day027 │ └── project │ │ └── unit_converter.py ├── day028 │ └── Pomodoro Technique (tk) copy │ │ ├── main.py │ │ └── tomato.png ├── day029 │ └── project │ │ ├── data.txt │ │ ├── logo.png │ │ └── password_manager.py └── day030 │ └── project │ ├── data.json │ ├── logo.png │ └── password_manager.py ├── days031-040 ├── day031 │ └── capstone │ │ ├── data │ │ ├── french_words.csv │ │ └── words_to_learn.csv │ │ ├── flashcard.py │ │ └── images │ │ ├── card_back.png │ │ ├── card_front.png │ │ ├── right.png │ │ └── wrong.png ├── day032 │ ├── challenges │ │ ├── cha.py │ │ └── quotes.txt │ ├── lectures │ │ ├── lec01.py │ │ ├── lec02.py │ │ ├── lec03.py │ │ └── lec04.py │ └── project │ │ ├── birthday_wisher.py │ │ ├── birthdays.csv │ │ └── letter_templates │ │ ├── letter_1.txt │ │ ├── letter_2.txt │ │ └── letter_3.txt ├── day033 │ └── ISS API (requests, APIs) copy │ │ ├── ISS_logo.png │ │ ├── algorithm.py │ │ ├── haversine.py │ │ ├── mail_client.py │ │ └── main.py ├── day034 │ ├── lectures │ │ └── lec.py │ └── project │ │ ├── data.py │ │ ├── images │ │ ├── false.png │ │ └── true.png │ │ ├── question_model.py │ │ ├── quiz_brain.py │ │ ├── quizzler.py │ │ └── ui.py ├── day035 │ ├── challenges │ │ └── cha.py │ ├── lectures │ │ ├── lec01.py │ │ └── lec02.py │ └── project │ │ └── rain_alert.py ├── day036 │ └── Watchlist Report (Alpha Vantage, D7 Networks, SMTP) │ │ ├── alerts_client.py │ │ ├── image_assets │ │ ├── addtowatchlist.png │ │ ├── generatereport.png │ │ └── viewwatchlist.png │ │ ├── main.py │ │ ├── news_client.py │ │ ├── stock_client.py │ │ ├── todo.txt │ │ ├── toplevels.py │ │ └── watchlist_data │ │ └── watchlist.csv ├── day037 │ ├── challenges │ │ └── cha.py │ └── project │ │ └── pixela_reading_tracker.py ├── day038 │ ├── project │ │ └── workout_tracker.py │ └── steps │ │ └── ste01.py ├── day039 │ └── Cheapest-Flight-Finder-GUI │ │ ├── data_manager.py │ │ ├── flight_search.py │ │ ├── image_assets │ │ └── menu_icon.png │ │ ├── main.py │ │ ├── notification_manager.py │ │ ├── report_generator.py │ │ ├── search_logs.txt │ │ ├── setup_readme.md │ │ └── windows.py └── day040 │ └── capstone │ ├── data_manager.py │ ├── flight_club.py │ ├── flight_data.py │ ├── flight_search.py │ └── notification_manager.py ├── days041-050 ├── day041 │ ├── Harrison Site (Rough) │ │ ├── css │ │ │ └── styles.css │ │ ├── images │ │ │ ├── angela.png │ │ │ ├── chillies.png │ │ │ ├── cloud.png │ │ │ ├── computer.png │ │ │ ├── data-research.png │ │ │ ├── database.png │ │ │ ├── favicon.ico │ │ │ ├── forecast-analytics.png │ │ │ ├── headshot.png │ │ │ ├── market-analysis.png │ │ │ ├── mountain.png │ │ │ ├── report.png │ │ │ └── risk-management.png │ │ └── index.html │ └── lectures │ │ └── lec.html ├── day043 │ └── project │ │ ├── css │ │ └── styles.css │ │ └── index.html ├── day045 │ ├── lectures │ │ ├── lec01 │ │ │ ├── main.py │ │ │ └── website.html │ │ └── lec02.py │ └── project │ │ ├── top_100_movies.py │ │ └── top_100_movies.txt ├── day046 │ └── project │ │ └── time_machine.py ├── day047 │ └── Amazon-Price-Scraper-WIP copy │ │ ├── amazon_scraper.py │ │ ├── email_handler.py │ │ ├── main.py │ │ └── settings.yaml ├── day048 │ ├── challenges │ │ ├── cha01.py │ │ ├── cha02.py │ │ └── cha03.py │ ├── lectures │ │ ├── lec01.py │ │ ├── lec02.py │ │ ├── lec03.py │ │ ├── lec04.py │ │ ├── lec05.py │ │ └── lec06.py │ └── project │ │ └── cookie-clicker-bot.py ├── day049 │ └── project │ │ └── job_application.py └── day050 │ └── project │ └── auto_tinder.py ├── days051-060 ├── day051 │ └── Twitter Bot Project │ │ ├── internet_speed.py │ │ └── twitter_bot.py ├── day052 │ └── Instagram Follower Bot (patched by Instagram) │ │ ├── Instagram-Follower-Bot.py │ │ ├── instabot_readme.md │ │ └── profile_urls.csv ├── day053 │ └── Zillow Scraper Capstone Project │ │ ├── csv_output │ │ └── Dallas TX-Scrape-Result.csv │ │ ├── image_assets │ │ ├── Zillow.png │ │ ├── forms1.png │ │ ├── forms2.png │ │ ├── forms3.png │ │ ├── forms4.png │ │ └── webdriver.png │ │ ├── main.py │ │ ├── outline.txt │ │ ├── readme.md │ │ └── scraper.py ├── day054 │ └── lecture │ │ ├── Multivariable-Regression-Capstone │ │ ├── decorators_101.py │ │ └── hello.py ├── day055 │ └── project │ │ ├── higher_lower_flask.py │ │ └── user.py ├── day056 │ ├── final_project │ │ └── moved_to.txt │ └── project │ │ ├── server.py │ │ ├── static │ │ └── styles.css │ │ └── templates │ │ ├── index.html │ │ └── personal.html ├── day057 │ ├── FinWeek │ │ ├── README.md │ │ ├── backend │ │ │ └── finnhub_cli.py │ │ ├── requirements.txt │ │ ├── server.py │ │ ├── static │ │ │ └── css │ │ │ │ └── styles.css │ │ └── templates │ │ │ ├── index.html │ │ │ └── symbol_news.html │ └── lectures │ │ ├── jinja-intro.py │ │ └── templates │ │ ├── ify.html │ │ └── index.html ├── day058 │ └── Bootstrap-installation │ │ ├── index.html │ │ ├── prototype.xd │ │ └── static │ │ ├── css │ │ └── styles.css │ │ └── img │ │ └── avatar_placeholder.png ├── day059 │ ├── README.md │ └── demo.gif └── day060 │ └── html-forms │ ├── output.txt │ ├── server.py │ └── templates │ └── index.html ├── days061-070 ├── day061 │ └── flask_secrets │ │ ├── README.md │ │ ├── main.py │ │ ├── poetry.lock │ │ ├── pyproject.toml │ │ ├── requirements.txt │ │ └── templates │ │ ├── bootstrap_support │ │ ├── denied_bootstrap.html │ │ ├── login_bootstrap.html │ │ └── login_bootstrap_quickform.html │ │ └── legacy │ │ ├── base_flask_template.html │ │ ├── denied.html │ │ ├── index.html │ │ ├── login.html │ │ └── success.html ├── day062 │ ├── README.md │ ├── coffee-and-wifi │ │ ├── backend │ │ │ ├── data.py │ │ │ └── forms.py │ │ ├── cafe-data.csv │ │ ├── main.py │ │ ├── requirements.txt │ │ ├── static │ │ │ └── css │ │ │ │ └── styles.css │ │ └── templates │ │ │ ├── add.html │ │ │ ├── cafes.html │ │ │ └── index.html │ └── img │ │ └── demo.gif ├── day063 │ ├── README.MD │ ├── bookshelf │ │ ├── backend │ │ │ ├── books-library.sqlite │ │ │ ├── database.py │ │ │ └── forms.py │ │ ├── main.py │ │ ├── poetry.lock │ │ ├── pyproject.toml │ │ ├── requirements.txt │ │ └── templates │ │ │ ├── add.html │ │ │ ├── edit.html │ │ │ └── index.html │ └── img │ │ └── demo.gif ├── day064 │ ├── README.md │ ├── img │ │ ├── edit.gif │ │ ├── index.gif │ │ └── new.gif │ └── movie-project │ │ ├── backend │ │ ├── forms.py │ │ ├── movies.sqlite │ │ └── omdb.py │ │ ├── main.py │ │ ├── requirements.txt │ │ ├── static │ │ └── css │ │ │ └── styles.css │ │ └── templates │ │ ├── add.html │ │ ├── edit.html │ │ ├── index.html │ │ └── select.html ├── day065 │ └── README.md ├── day066 │ ├── README.md │ └── RESTful-API-cafe │ │ ├── cafes.sqlite │ │ ├── main.py │ │ └── templates │ │ └── index.html ├── day067 │ └── README.md ├── day068 │ ├── README.md │ └── flask-auth │ │ ├── main.py │ │ ├── requirements.txt │ │ ├── static │ │ ├── css │ │ │ └── styles.css │ │ └── files │ │ │ └── cheat_sheet.pdf │ │ ├── templates │ │ ├── base.html │ │ ├── index.html │ │ ├── login.html │ │ ├── register.html │ │ └── secrets.html │ │ └── users.sqlite ├── day069 │ └── README.md └── day070 │ └── README.md ├── days071-080 ├── day071 │ ├── Pandas_Reference_1_The_Basics.ipynb │ └── salaries_by_college_major.csv ├── day072 │ ├── Pandas_Reference_2_Stackoverflow_Analysis.ipynb │ └── QueryResults.csv ├── day073 │ ├── Data │ │ ├── colors.csv │ │ ├── sets.csv │ │ └── themes.csv │ └── Lego_Analysis_for_Course.ipynb ├── day074 │ ├── Pandas_and_Matplotlib_Reference_4.ipynb │ └── data │ │ ├── Bitcoin Search Trend.csv │ │ ├── Daily Bitcoin Price.csv │ │ ├── TESLA Search Trend vs Price.csv │ │ ├── UE Benefits Search vs UE Rate 2004-19.csv │ │ └── UE Benefits Search vs UE Rate 2004-20.csv ├── day075 │ ├── Pandas_and_Plotly_Reference_5_Google_Play_Store_App_Analytics.ipynb │ └── data │ │ └── apps.csv ├── day076 │ ├── Computation_with_NumPy_Intro.ipynb │ └── image │ │ └── yummy_macarons.jpg ├── day077 │ ├── Reference_7_Seaborn_and_Linear_Regression.ipynb │ └── data │ │ └── cost_revenue_dirty.csv ├── day078 │ ├── Reference_8_Nobel_Prize_Analysis.ipynb │ └── data │ │ └── nobel_prize_data.csv ├── day079 │ ├── Reference_9_Ttest_&_Distributions.ipynb │ └── data │ │ ├── annual_deaths_by_clinic.csv │ │ └── monthly_deaths.csv └── day080 │ └── Housing-Price-Predictions-Capstone-Project │ ├── Multivariable_Regression_Capstone.ipynb │ └── data │ └── boston.csv ├── days081-090 ├── day081 │ ├── README.md │ └── text-to-morse-project │ │ ├── main.py │ │ └── morse_db.json ├── day082 │ └── README.md.md ├── day083 │ ├── README.md │ └── TicTacToe.py ├── day084 │ ├── Markit │ │ ├── app_icon.png │ │ ├── demo.png │ │ ├── gui.py │ │ ├── image_handler.py │ │ ├── log_client.py │ │ ├── markit_project_overview.txt │ │ ├── requirements.txt │ │ └── valid_filetypes.txt │ └── README.md ├── day085 │ ├── README.md │ └── Tactype │ │ ├── demo.gif │ │ ├── main.py │ │ ├── requirements.txt │ │ └── tactype_overview.txt ├── day086 │ ├── Breakout │ │ ├── ball.py │ │ ├── bricks.py │ │ ├── main.py │ │ ├── paddle.py │ │ └── scoreboard.py │ └── README.md ├── day087 │ └── README.md ├── day088 │ ├── README.md │ └── todo-app │ │ ├── db.sqlite │ │ ├── main.py │ │ ├── requirements.txt │ │ └── templates │ │ └── index.html ├── day089 │ ├── README.md │ └── webapp │ │ ├── app.py │ │ ├── demo.gif │ │ └── templates │ │ └── index.html └── day090 │ ├── README.md │ ├── pdf-to-speech.py │ └── requirements.txt ├── days091-100 ├── day091 │ ├── README.md │ └── image-to-color.py ├── day092 │ ├── README.md │ └── webscraper │ │ ├── output.csv │ │ ├── requirements.txt │ │ └── taapiio-indicators.py ├── day093 │ ├── README.md │ └── t-rex_bot.py ├── day094 │ ├── README.md │ └── Space-Invaders │ │ ├── assets │ │ ├── background-black.png │ │ ├── pixel_laser_blue.png │ │ ├── pixel_laser_green.png │ │ ├── pixel_laser_red.png │ │ ├── pixel_laser_yellow.png │ │ ├── pixel_ship_blue_small.png │ │ ├── pixel_ship_green_small.png │ │ ├── pixel_ship_red_small.png │ │ └── pixel_ship_yellow.png │ │ ├── main.py │ │ └── requirements.txt ├── day095 │ ├── README.md │ └── demo.gif ├── day096 │ ├── Online-Shop │ │ ├── public │ │ │ ├── cancel.html │ │ │ ├── checkout.html │ │ │ ├── style.css │ │ │ └── success.html │ │ ├── requirements.txt │ │ └── server.py │ └── README.md ├── day097 │ ├── README.md │ ├── data │ │ └── portfolios_input.xlsx │ ├── img │ │ └── demo.png │ ├── main.py │ ├── portfolio_report │ │ ├── __init__.py │ │ ├── _config.py │ │ ├── assets │ │ │ └── email_template.html │ │ ├── data.py │ │ ├── email_client.py │ │ ├── finnhub_client.py │ │ ├── process.py │ │ └── util.py │ └── requirements.txt ├── day098 │ ├── README.md │ ├── day98.ipynb │ └── mission_launches.csv ├── day099 │ ├── README.md │ ├── data │ │ ├── Deaths_by_Police_US.csv │ │ ├── Median_Household_Income_2015.csv │ │ ├── Pct_Over_25_Completed_High_School.csv │ │ ├── Pct_People_Below_Poverty_Level.csv │ │ └── Share_of_Race_By_City.csv │ └── day99.ipynb └── day100 │ ├── Determinants_of_Earnings.ipynb │ ├── README.md │ └── data │ ├── NLSY97_Variable_Names_and_Descriptions.csv │ └── NLSY97_subset.csv ├── gen.py └── syllabus.pdf /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | *.pyc 4 | venv 5 | **/.env -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Harrison Schick 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /certificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/certificate.pdf -------------------------------------------------------------------------------- /days001-010/day001/exercises/exe01.py: -------------------------------------------------------------------------------- 1 | # Write your code below this line 👇 2 | print("Day 1 - Python Print Function") 3 | print("The function is declared like this:") 4 | print("print('what to print')") 5 | -------------------------------------------------------------------------------- /days001-010/day001/exercises/exe02.py: -------------------------------------------------------------------------------- 1 | # Fix the code below 👇 2 | 3 | print("Day 1 - String Manipulation") 4 | print('String Concatenation is done with the "+" sign.') 5 | print('e.g. print("Hello " + "world")') 6 | print("New lines can be created with a backslash and n.") 7 | -------------------------------------------------------------------------------- /days001-010/day001/exercises/exe03.py: -------------------------------------------------------------------------------- 1 | # Write your code below this line 👇 2 | print(len(input("What's your name? "))) 3 | -------------------------------------------------------------------------------- /days001-010/day001/exercises/exe04.py: -------------------------------------------------------------------------------- 1 | # 🚨 Don't change the code below 👇 2 | a = input("a: ") 3 | b = input("b: ") 4 | # 🚨 Don't change the code above 👆 5 | 6 | #################################### 7 | # Write your code below this line 👇 8 | temp = a 9 | a = b 10 | b = temp 11 | 12 | # Write your code above this line 👆 13 | #################################### 14 | 15 | # 🚨 Don't change the code below 👇 16 | print("a: " + a) 17 | print("b: " + b) 18 | -------------------------------------------------------------------------------- /days001-010/day001/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | print("Hello world!") 2 | 3 | # SyntaxError 4 | # print("Hello world!) 5 | -------------------------------------------------------------------------------- /days001-010/day001/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | print("Hello world!") 2 | print("Hello world!") 3 | print("Hello world!") 4 | print() 5 | 6 | print("Hello world!\nHello world!") 7 | print() 8 | 9 | print("Hello world!\nHello world!\nHello world!") 10 | print() 11 | 12 | print("Hello" + "Angela") 13 | print("Hello" + " Angela") 14 | print("Hello " + "Angela") 15 | print("Hello" + " " + "Angela") 16 | 17 | # IndentationError 18 | # print("Hello" + " " + "Angela") 19 | -------------------------------------------------------------------------------- /days001-010/day001/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | print("What is your name?") 2 | input("What is your name? ") 3 | 4 | # input() will get user input in console 5 | # Then print() will print the word "Hello" and the user input 6 | print("Hello " + input("What is your name? ")) 7 | -------------------------------------------------------------------------------- /days001-010/day001/lectures/lec04.py: -------------------------------------------------------------------------------- 1 | input("What is your name? ") 2 | name = input("What is your name? ") 3 | print(name) 4 | print() 5 | 6 | name = "Jack" 7 | print(name) 8 | 9 | name = "Angela" 10 | print(name) 11 | print() 12 | 13 | name = input("What is your name? ") 14 | length = len(name) 15 | print(length) 16 | -------------------------------------------------------------------------------- /days001-010/day001/project/band_name_generator.py: -------------------------------------------------------------------------------- 1 | print("🎸 Welcome to the Band Name Generator! 🎸") 2 | 3 | city = input("What city did you grow up in?\n") 4 | pet = input("What's your pet's name?\n") 5 | 6 | band_name = city + ' ' + pet 7 | print("Your band name could be:\n🎸 " + band_name + " 🎸") 8 | -------------------------------------------------------------------------------- /days001-010/day002/exercises/exe01.py: -------------------------------------------------------------------------------- 1 | # 🚨 Don't change the code below 👇 2 | two_digit_number = input("Type a two digit number: ") 3 | # 🚨 Don't change the code above 👆 4 | 5 | #################################### 6 | # Write your code below this line 👇 7 | first_digit = int(two_digit_number[0]) 8 | last_digit = int(two_digit_number[1]) 9 | 10 | sum_digits = first_digit + last_digit 11 | print(sum_digits) 12 | -------------------------------------------------------------------------------- /days001-010/day002/exercises/exe02.py: -------------------------------------------------------------------------------- 1 | # 🚨 Don't change the code below 👇 2 | height = input("Enter your height in m: ") 3 | weight = input("Enter your weight in kg: ") 4 | # 🚨 Don't change the code above 👆 5 | 6 | # Write your code below this line 👇 7 | height = float(height) 8 | weight = float(weight) 9 | 10 | bmi = int(weight / height ** 2) 11 | print(bmi) 12 | -------------------------------------------------------------------------------- /days001-010/day002/exercises/exe03.py: -------------------------------------------------------------------------------- 1 | # 🚨 Don't change the code below 👇 2 | age = input("What is your current age? ") 3 | # 🚨 Don't change the code above 👆 4 | 5 | # Write your code below this line 👇 6 | years_left = 90 - int(age) 7 | months_left = years_left * 12 8 | weeks_left = years_left * 52 9 | days_left = years_left * 365 10 | 11 | print(f"You have {days_left} days, {weeks_left} weeks, and {months_left} months left.") 12 | -------------------------------------------------------------------------------- /days001-010/day002/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | print(len("Hello")) 2 | 3 | # TypeError 4 | # print(len(12352)) 5 | 6 | print("Hello"[0]) 7 | print("Hello"[4]) 8 | print("123" + "345") 9 | print() 10 | 11 | print(123 + 345) 12 | print(123_456_789) 13 | print(3.14159) 14 | print() 15 | 16 | print(True) 17 | print(False) 18 | -------------------------------------------------------------------------------- /days001-010/day002/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | # TypeError 2 | # print(len(4837)) 3 | 4 | num_char = len(input("What is your name? ")) 5 | 6 | # TypeError 7 | # print("Your name has " + num_char + " characters.") 8 | 9 | print(type(num_char)) 10 | new_num_char = str(num_char) 11 | print("Your name has " + new_num_char + " characters.") 12 | print() 13 | 14 | a = 123 15 | print(type(a)) 16 | 17 | a = str(123) 18 | print(type(a)) 19 | 20 | a = float(123) 21 | print(type(a)) 22 | print() 23 | 24 | print(70 + float("100.5")) 25 | print(str(70) + str(100)) 26 | -------------------------------------------------------------------------------- /days001-010/day002/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | print(3 + 5) 2 | print(7 - 3) 3 | print(3 * 2) 4 | print(6 / 3) 5 | print(type(6 / 3)) 6 | print(2 ** 2) 7 | print(2 ** 3) 8 | print() 9 | 10 | print(3 * 3 + 3 / 3 - 3) 11 | print(3 * (3 + 3) / 3 - 3) 12 | -------------------------------------------------------------------------------- /days001-010/day002/lectures/lec04.py: -------------------------------------------------------------------------------- 1 | print(8 / 3) 2 | print(int(8 / 3)) 3 | print(round(8 / 3)) 4 | print(round(8 / 3, 2)) 5 | print(round(2.666666666666, 2)) 6 | print(8 // 3) 7 | print(type(8 // 3)) 8 | print(type(8 / 3)) 9 | print(type(4 / 2)) 10 | print(4 / 2) 11 | print() 12 | 13 | result = 4 / 2 14 | result /= 2 15 | print(result) 16 | 17 | score = 0 18 | score += 1 19 | print(score) 20 | print() 21 | 22 | score = 0 23 | height = 1.8 24 | is_winning = True 25 | print(f"Your score is {score}, your height is {height}, and you are winning is {is_winning}") 26 | -------------------------------------------------------------------------------- /days001-010/day002/project/tip_calculator.py: -------------------------------------------------------------------------------- 1 | print("🧮 Welcome to the Tip Calculator! 🧮") 2 | 3 | bill = float(input("What was the total bill? $")) 4 | percentage_tip = int(input("What percentage tip would you like to give? 10, 12, or 15? ")) / 100 5 | num_people = int(input("How many people to split the bill? ")) 6 | 7 | final_bill = bill * (1 + percentage_tip) 8 | bill_per_person = final_bill / num_people 9 | print(f"🧮 Each person should pay: ${bill_per_person:.2f} 🧮") 10 | -------------------------------------------------------------------------------- /days001-010/day004/exercises/exe01.py: -------------------------------------------------------------------------------- 1 | # Write your code below this line 👇 2 | # Hint: Remember to import the random module first. 🎲 3 | import random 4 | 5 | coin = random.randint(0, 1) 6 | 7 | if coin == 0: 8 | print("Tails") 9 | else: 10 | print("Heads") 11 | -------------------------------------------------------------------------------- /days001-010/day004/exercises/exe02.py: -------------------------------------------------------------------------------- 1 | # Split string method 2 | import random 3 | 4 | names_string = input("Give me everybody's names, separated by a comma. ") 5 | names = names_string.split(", ") 6 | # 🚨 Don't change the code above 👆 7 | 8 | # Write your code below this line 👇 9 | index = random.randrange(0, len(names)) 10 | print(f'{names[index]} is going to buy the meal today!') 11 | -------------------------------------------------------------------------------- /days001-010/day004/exercises/exe03.py: -------------------------------------------------------------------------------- 1 | # 🚨 Don't change the code below 👇 2 | row1 = ["⬜️", "⬜️", "⬜️"] 3 | row2 = ["⬜️", "⬜️", "⬜️"] 4 | row3 = ["⬜️", "⬜️", "⬜️"] 5 | treasure_map = [row1, row2, row3] 6 | print(f"{row1}\n{row2}\n{row3}") 7 | position = input("Where do you want to put the treasure? ") 8 | # 🚨 Don't change the code above 👆 9 | 10 | # Write your code below this row 👇 11 | row = int(position[1]) - 1 12 | col = int(position[0]) - 1 13 | 14 | treasure_map[row][col] = '❎️' 15 | # Write your code above this row 👆 16 | 17 | # 🚨 Don't change the code below 👇 18 | print(f"{row1}\n{row2}\n{row3}") 19 | -------------------------------------------------------------------------------- /days001-010/day004/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | import my_module 4 | 5 | random_integer = random.randint(1, 10) 6 | print(random_integer) 7 | 8 | print(my_module.pi) 9 | 10 | random_float = random.random() 11 | print(random_float) 12 | 13 | random_float = random.random() * 5 14 | print(random_float) 15 | 16 | love_score = random.randint(1, 100) 17 | print(f'Your love score is {love_score}') 18 | -------------------------------------------------------------------------------- /days001-010/day004/lectures/my_module.py: -------------------------------------------------------------------------------- 1 | pi = 3.14159206358979 2 | -------------------------------------------------------------------------------- /days001-010/day005/exercises/exe01.py: -------------------------------------------------------------------------------- 1 | # 🚨 Don't change the code below 👇 2 | student_heights = input("Input a list of student heights ").split() 3 | for n in range(0, len(student_heights)): 4 | student_heights[n] = int(student_heights[n]) 5 | # 🚨 Don't change the code above 👆 6 | 7 | # Write your code below this row 👇 8 | total = 0 9 | count = 0 10 | for student_height in student_heights: 11 | total += student_height 12 | count += 1 13 | 14 | average = round(total / count) 15 | print(average) 16 | -------------------------------------------------------------------------------- /days001-010/day005/exercises/exe02.py: -------------------------------------------------------------------------------- 1 | # 🚨 Don't change the code below 👇 2 | student_scores = input("Input a list of student scores ").split() 3 | for n in range(0, len(student_scores)): 4 | student_scores[n] = int(student_scores[n]) 5 | # 🚨 Don't change the code above 👆 6 | 7 | # Write your code below this row 👇 8 | max_score = student_scores[0] 9 | for student_score in student_scores: 10 | if student_score > max_score: 11 | max_score = student_score 12 | print(f'The highest score in the class is: {max_score}') 13 | -------------------------------------------------------------------------------- /days001-010/day005/exercises/exe03.py: -------------------------------------------------------------------------------- 1 | # Write your code below this row 👇 2 | total = 0 3 | for number in range(2, 101, 2): 4 | total += number 5 | print(total) 6 | -------------------------------------------------------------------------------- /days001-010/day005/exercises/exe04.py: -------------------------------------------------------------------------------- 1 | # Write your code below this row 👇 2 | for number in range(1, 101): 3 | if number % 3 == 0 and number % 5 == 0: 4 | print("FizzBuzz") 5 | elif number % 5 == 0: 6 | print("Buzz") 7 | elif number % 3 == 0: 8 | print("Fizz") 9 | else: 10 | print(number) 11 | -------------------------------------------------------------------------------- /days001-010/day005/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | fruits = ["Apple", "Peach", "Pear"] 2 | 3 | for fruit in fruits: 4 | print(fruit) 5 | print(fruit + " Pie") 6 | print(fruits) 7 | print() 8 | 9 | for fruit in fruits: 10 | print(fruit) 11 | print(fruit + " Pie") 12 | print(fruits) 13 | 14 | -------------------------------------------------------------------------------- /days001-010/day005/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | for number in range(1, 10): 2 | print(number) 3 | print() 4 | 5 | for number in range(1, 11): 6 | print(number) 7 | print() 8 | 9 | for number in range(1, 11, 3): 10 | print(number) 11 | print() 12 | 13 | total = 0 14 | for number in range(1, 101): 15 | total += number 16 | print(total) 17 | -------------------------------------------------------------------------------- /days001-010/day006/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | def my_function(): 2 | print("Hello") 3 | print("Bye") 4 | 5 | 6 | print("Hello") 7 | num_char = len("Hello") 8 | print(num_char) 9 | 10 | my_function() 11 | -------------------------------------------------------------------------------- /days001-010/day006/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | fruits = ["Apple", "Pear", "Orange"] 2 | 3 | for fruit in fruits: 4 | print(fruit) 5 | print() 6 | 7 | for n in range(1, 6): 8 | print(n) 9 | 10 | # Infinite Loop 11 | # while 5 > 3: 12 | # print(5 > 3) 13 | -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/alone1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/alone1.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/alone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/alone2.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/alone3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/alone3.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/alone4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/alone4.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/alone5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/alone5.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/hurdle1a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/hurdle1a.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/hurdle1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/hurdle1b.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/hurdle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/hurdle2.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/hurdle3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/hurdle3.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/hurdle4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/hurdle4.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/maze1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/maze1.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/maze2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/maze2.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/maze3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/maze3.png -------------------------------------------------------------------------------- /days001-010/day006/reeborg/imgs/maze4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days001-010/day006/reeborg/imgs/maze4.png -------------------------------------------------------------------------------- /days001-010/day007/challenges/cha01.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | word_list = ["aardvark", "baboon", "camel"] 4 | 5 | chosen_word = random.choice(word_list) 6 | 7 | guess = input("Guess a letter: ").lower() 8 | 9 | for letter in chosen_word: 10 | if guess == letter: 11 | print("Right") 12 | else: 13 | print("Wrong") 14 | -------------------------------------------------------------------------------- /days001-010/day007/challenges/cha02.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | word_list = ["aardvark", "baboon", "camel"] 4 | 5 | chosen_word = random.choice(word_list) 6 | display = ['_'] * len(chosen_word) 7 | 8 | # Testing code 9 | print(f'Pssst, the solution is {chosen_word}.') 10 | 11 | guess = input("Guess a letter: ").lower() 12 | 13 | for idx, letter in enumerate(chosen_word): 14 | if guess == letter: 15 | display[idx] = letter 16 | 17 | print(display) 18 | -------------------------------------------------------------------------------- /days001-010/day007/challenges/cha03.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | word_list = ["aardvark", "baboon", "camel"] 4 | 5 | chosen_word = random.choice(word_list) 6 | display = ['_'] * len(chosen_word) 7 | 8 | # Testing code 9 | print(f'Pssst, the solution is {chosen_word}.') 10 | 11 | while '_' in display: 12 | print(display) 13 | guess = input("Guess a letter: ").lower() 14 | for idx, letter in enumerate(chosen_word): 15 | if guess == letter: 16 | display[idx] = letter 17 | print(display) 18 | print("You win!") 19 | -------------------------------------------------------------------------------- /days001-010/day008/exercises/exe01.py: -------------------------------------------------------------------------------- 1 | # Write your code below this line 👇 2 | from math import ceil 3 | 4 | 5 | def paint_calc(height, width, cover): 6 | num_cans = ceil(height * width / cover) 7 | print(f"You'll need {num_cans} cans of paint.") 8 | 9 | 10 | # Write your code above this line 👆 11 | # Define a function called paint_calc() so that the code below works. 12 | 13 | # 🚨 Don't change the code below 👇 14 | test_h = int(input("Height of wall: ")) 15 | test_w = int(input("Width of wall: ")) 16 | coverage = 5 17 | paint_calc(height=test_h, width=test_w, cover=coverage) 18 | -------------------------------------------------------------------------------- /days001-010/day008/exercises/exe02.py: -------------------------------------------------------------------------------- 1 | # Write your code below this line 👇 2 | def prime_checker(number): 3 | if number == 1: 4 | print("It's not a prime number.") 5 | else: 6 | for div in range(2, number): 7 | if number % div == 0: 8 | print("It's not a prime number.") 9 | break 10 | else: 11 | print("It's a prime number.") 12 | 13 | 14 | # Write your code above this line 👆 15 | 16 | # Do NOT change any of the code below👇 17 | n = int(input("Check this number: ")) 18 | prime_checker(number=n) 19 | -------------------------------------------------------------------------------- /days001-010/day008/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | def greet(): 2 | print("Hello") 3 | print("How do you do?") 4 | print("Isn't the weather nice today?") 5 | 6 | 7 | def greet_with_name(name): 8 | print(f"Hello {name}") 9 | print(f"How do you do {name}?") 10 | 11 | 12 | greet() 13 | print() 14 | 15 | greet_with_name("Angela") 16 | print() 17 | 18 | greet_with_name("Billie") 19 | -------------------------------------------------------------------------------- /days001-010/day008/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | def greet_with(name, location): 2 | print(f"Hello {name}") 3 | print(f"What is it like in {location}?") 4 | 5 | 6 | greet_with("Jack Bauer", "Nowhere") 7 | print() 8 | 9 | greet_with("Nowhere", "Jack Bauer") 10 | print() 11 | 12 | greet_with(name="Angela", location="London") 13 | print() 14 | 15 | greet_with(location="London", name="Angela") 16 | -------------------------------------------------------------------------------- /days001-010/day008/project/art.py: -------------------------------------------------------------------------------- 1 | logo = r""" 2 | ,adPPYba, ,adPPYYba, ,adPPYba, ,adPPYba, ,adPPYYba, 8b,dPPYba, 3 | a8" "" "" `Y8 a8P_____88 I8[ "" "" `Y8 88P' "Y8 4 | 8b ,adPPPPP88 8PP""""""" `"Y8ba, ,adPPPPP88 88 5 | "8a, ,aa 88, ,88 "8b, ,aa aa ]8I 88, ,88 88 6 | `"Ybbd8"' `"8bbdP"Y8 `"Ybbd8"' `"YbbdP"' `"8bbdP"Y8 88 7 | 88 88 8 | "" 88 9 | 88 10 | ,adPPYba, 88 8b,dPPYba, 88,dPPYba, ,adPPYba, 8b,dPPYba, 11 | a8" "" 88 88P' "8a 88P' "8a a8P_____88 88P' "Y8 12 | 8b 88 88 d8 88 88 8PP""""""" 88 13 | "8a, ,aa 88 88b, ,a8" 88 88 "8b, ,aa 88 14 | `"Ybbd8"' 88 88`YbbdP"' 88 88 `"Ybbd8"' 88 15 | 88 16 | 88 17 | """ 18 | -------------------------------------------------------------------------------- /days001-010/day008/project/caesar_cipher.py: -------------------------------------------------------------------------------- 1 | import art 2 | 3 | 4 | def caesar(cipher_text, shift_amount, cipher_direction): 5 | alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 6 | 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] 7 | if cipher_direction == 'decode': 8 | shift_amount *= -1 9 | 10 | new_text = '' 11 | for char in cipher_text: 12 | if char in alphabet: 13 | index = (alphabet.index(char) + shift_amount) % len(alphabet) 14 | new_text += alphabet[index] 15 | else: 16 | new_text += char 17 | print(f"The {cipher_direction}d text is:\n🔏 {new_text} 🔏") 18 | 19 | 20 | print(art.logo) 21 | 22 | 23 | go_again = 'yes' 24 | 25 | while go_again == 'yes': 26 | direction = input("Type 'encode' to encrypt, type 'decode' to decrypt:\n") 27 | text = input("Type your message:\n").lower() 28 | shift = int(input("Type the shift number:\n")) 29 | 30 | caesar(text, shift, direction) 31 | go_again = input("Type 'yes' if you want to go again: ").lower() 32 | print("👋 Goodbye! 👋") 33 | -------------------------------------------------------------------------------- /days001-010/day008/steps/ste01.py: -------------------------------------------------------------------------------- 1 | def encrypt(plain_text, shift_amount): 2 | alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 3 | 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] 4 | encrypt_text = '' 5 | for char in plain_text: 6 | index = (alphabet.index(char) + shift_amount) % len(alphabet) 7 | encrypt_text += alphabet[index] 8 | print(f"The encoded text is:\n🔏 {encrypt_text} 🔏") 9 | 10 | 11 | # direction = input("Type 'encode' to encrypt, type 'decode' to decrypt:\n") 12 | text = input("Type your message:\n").lower() 13 | shift = int(input("Type the shift number:\n")) 14 | encrypt(text, shift) 15 | -------------------------------------------------------------------------------- /days001-010/day008/steps/ste03.py: -------------------------------------------------------------------------------- 1 | def caesar(cipher_text, shift_amount, cipher_direction): 2 | alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 3 | 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] 4 | if cipher_direction == 'decode': 5 | shift_amount *= -1 6 | 7 | new_text = '' 8 | for char in cipher_text: 9 | index = (alphabet.index(char) + shift_amount) % len(alphabet) 10 | new_text += alphabet[index] 11 | print(f"The {cipher_direction}d text is:\n🔏 {new_text} 🔏") 12 | 13 | 14 | direction = input("Type 'encode' to encrypt, type 'decode' to decrypt:\n") 15 | text = input("Type your message:\n").lower() 16 | shift = int(input("Type the shift number:\n")) 17 | 18 | caesar(text, shift, direction) 19 | -------------------------------------------------------------------------------- /days001-010/day009/exercises/exe01.py: -------------------------------------------------------------------------------- 1 | student_scores = { 2 | "Harry": 81, 3 | "Ron": 78, 4 | "Hermione": 99, 5 | "Draco": 74, 6 | "Neville": 62, 7 | } 8 | # 🚨 Don't change the code above 👆 9 | student_grades = {} 10 | 11 | for student, score in student_scores.items(): 12 | if score > 90: 13 | student_grades[student] = "Outstanding" 14 | elif score > 80: 15 | student_grades[student] = "Exceeds Expectations" 16 | elif score > 70: 17 | student_grades[student] = "Acceptable" 18 | else: 19 | student_grades[student] = "Fail" 20 | 21 | # 🚨 Don't change the code below 👇 22 | print(student_grades) 23 | -------------------------------------------------------------------------------- /days001-010/day009/exercises/exe02.py: -------------------------------------------------------------------------------- 1 | def add_new_country(country, visits, cities): 2 | new_dict = { 3 | "country": country, 4 | "visits": visits, 5 | "cities": cities 6 | } 7 | travel_log.append(new_dict) 8 | 9 | 10 | # 🚨 Do NOT change the code below 👇 11 | travel_log = [ 12 | { 13 | "country": "France", 14 | "visits": 12, 15 | "cities": ["Paris", "Lille", "Dijon"] 16 | }, 17 | { 18 | "country": "Germany", 19 | "visits": 5, 20 | "cities": ["Berlin", "Hamburg", "Stuttgart"] 21 | } 22 | ] 23 | 24 | add_new_country("Russia", 2, ["Moscow", "Saint Petersburg"]) 25 | print(travel_log) 26 | -------------------------------------------------------------------------------- /days001-010/day009/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | capitals = { 2 | "France": "Paris", 3 | "Germany": "Berlin" 4 | } 5 | print(capitals) 6 | 7 | travel_log = { 8 | "France": ["Paris", "Lille", "Dijon"], 9 | "Germany": ["Berlin", "Hamburg", "Stuttgart"] 10 | } 11 | print(travel_log) 12 | 13 | travel_log = { 14 | "France": { 15 | "cities_visited": ["Paris", "Lille", "Dijon"], 16 | "total_visits": 12 17 | }, 18 | "Germany": { 19 | "cities_visited": ["Berlin", "Hamburg", "Stuttgart"], 20 | "total_visits": 5 21 | } 22 | } 23 | print(travel_log) 24 | 25 | travel_log = [ 26 | { 27 | "country": "France", 28 | "cities_visited": ["Paris", "Lille", "Dijon"], 29 | "total_visits": 12 30 | }, 31 | { 32 | "country": "Germany", 33 | "cities_visited": ["Berlin", "Hamburg", "Stuttgart"], 34 | "total_visits": 5 35 | } 36 | ] 37 | print(travel_log) 38 | -------------------------------------------------------------------------------- /days001-010/day009/project/art.py: -------------------------------------------------------------------------------- 1 | logo = r''' 2 | ___________ 3 | \ / 4 | )_______( 5 | |"""""""|_.-._,.---------.,_.-._ 6 | | | | | | | ''-. 7 | | |_| |_ _| |_..-' 8 | |_______| '-' `'---------'` '-' 9 | )"""""""( 10 | /_________\ 11 | .-------------. 12 | /_______________\ 13 | ''' 14 | -------------------------------------------------------------------------------- /days001-010/day009/project/secret_auction.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import art 4 | 5 | 6 | def get_max(bids_dict): 7 | max_bid = 0 8 | max_bidder = '' 9 | for bidder, bid_amount in bids_dict.items(): 10 | if bid_amount > max_bid: 11 | max_bid = bid_amount 12 | max_bidder = bidder 13 | print(f"The winner is '{max_bidder}' with a bid of: ${max_bid:.2f}") 14 | 15 | 16 | bids = {} 17 | more_bids = 'yes' 18 | while more_bids == 'yes': 19 | print(art.logo) 20 | print("Welcome to the Secret Action Program!\n") 21 | 22 | name = input("What's your name? ") 23 | bid = float(input("What's your bid? $")) 24 | bids[name] = bid 25 | 26 | more_bids = input("Are there any other bidders? Type 'yes' or 'no': ").lower() 27 | os.system('cls' if os.name == 'nt' else 'clear') 28 | get_max(bids) 29 | 30 | -------------------------------------------------------------------------------- /days001-010/day010/exercises/exe.py: -------------------------------------------------------------------------------- 1 | def is_leap(a_year): 2 | return a_year % 4 == 0 and a_year % 100 != 0 or a_year % 400 == 0 3 | 4 | 5 | def days_in_month(a_year, a_month): 6 | month_days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] 7 | if a_month == 2 and is_leap(a_year): 8 | return 29 9 | return month_days[a_month - 1] 10 | 11 | 12 | # 🚨 Do NOT change any of the code below 👇 13 | year = int(input("Enter a year: ")) 14 | month = int(input("Enter a month: ")) 15 | days = days_in_month(year, month) 16 | print(days) 17 | -------------------------------------------------------------------------------- /days001-010/day010/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | def format_name1(f_name, l_name): 2 | print(f_name.title()) 3 | print(l_name.title()) 4 | 5 | 6 | def format_name2(f_name, l_name): 7 | formatted_f_name = f_name.title() 8 | formatted_l_name = l_name.title() 9 | 10 | print(f'{formatted_f_name} {formatted_l_name}') 11 | 12 | 13 | def format_name3(f_name, l_name): 14 | formatted_f_name = f_name.title() 15 | formatted_l_name = l_name.title() 16 | 17 | return f'{formatted_f_name} {formatted_l_name}' 18 | 19 | 20 | format_name1("angela", "ANGELA") 21 | print() 22 | 23 | format_name2("AnGElA", "YU") 24 | 25 | formatted_string = format_name3("AnGEla", "YU") 26 | print(formatted_string) 27 | 28 | print(format_name3("AnGEla", "YU")) 29 | print() 30 | 31 | output = len("Angela") 32 | print(output) 33 | -------------------------------------------------------------------------------- /days001-010/day010/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | def format_name1(f_name, l_name): 2 | formatted_f_name = f_name.title() 3 | formatted_l_name = l_name.title() 4 | 5 | return f'{formatted_f_name} {formatted_l_name}' 6 | print("This got printed!") # It didn't 7 | 8 | 9 | def format_name2(f_name, l_name): 10 | formatted_f_name = f_name.title() 11 | formatted_l_name = l_name.title() 12 | 13 | return f'Result: {formatted_f_name} {formatted_l_name}' 14 | 15 | 16 | def format_name3(f_name, l_name): 17 | if f_name == "" or l_name == "": 18 | return "You didn't provide valid inputs." 19 | 20 | formatted_f_name = f_name.title() 21 | formatted_l_name = l_name.title() 22 | 23 | return f'Result: {formatted_f_name} {formatted_l_name}' 24 | 25 | 26 | print(format_name1("AnGEla", "YU")) 27 | print(format_name2(input("What is your first name? "), input("What is your last name? "))) 28 | print(format_name3(input("What is your first name? "), input("What is your last name? "))) 29 | -------------------------------------------------------------------------------- /days001-010/day010/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | def format_name(f_name, l_name): 2 | """Take a first and last name and format it to 3 | return the title case version of the name.""" 4 | if f_name == "" or l_name == "": 5 | return "You didn't provide valid inputs." 6 | 7 | formatted_f_name = f_name.title() 8 | formatted_l_name = l_name.title() 9 | 10 | return f'Result: {formatted_f_name} {formatted_l_name}' 11 | 12 | 13 | print(format_name("paula", "RODRIGUES")) 14 | -------------------------------------------------------------------------------- /days001-010/day010/steps/ste01.py: -------------------------------------------------------------------------------- 1 | def add(n1, n2): 2 | return n1 + n2 3 | 4 | 5 | def sub(n1, n2): 6 | return n1 - n2 7 | 8 | 9 | def mul(n1, n2): 10 | return n1 * n2 11 | 12 | 13 | def div(n1, n2): 14 | return n1 / n2 15 | 16 | 17 | operations = { 18 | '+': add, 19 | '-': sub, 20 | '*': mul, 21 | '/': div 22 | } 23 | 24 | num1 = int(input("What's the first number? ")) 25 | 26 | for symbol in operations: 27 | print(symbol, end=' ') 28 | operation_symbol = input("\nPick an operation from the line above: ") 29 | 30 | num2 = int(input("What's the second number? ")) 31 | 32 | calculation_function = operations[operation_symbol] 33 | answer = calculation_function(num1, num2) 34 | 35 | print(f"{num1} {operation_symbol} {num2} = {answer}") 36 | -------------------------------------------------------------------------------- /days001-010/day010/steps/ste02.py: -------------------------------------------------------------------------------- 1 | def add(n1, n2): 2 | return n1 + n2 3 | 4 | 5 | def sub(n1, n2): 6 | return n1 - n2 7 | 8 | 9 | def mul(n1, n2): 10 | return n1 * n2 11 | 12 | 13 | def div(n1, n2): 14 | return n1 / n2 15 | 16 | 17 | operations = { 18 | '+': add, 19 | '-': sub, 20 | '*': mul, 21 | '/': div 22 | } 23 | 24 | num1 = int(input("What's the first number? ")) 25 | 26 | print(" ".join(operations)) 27 | operation_symbol = input("Pick an operation from the line above: ") 28 | 29 | num2 = int(input("What's the second number? ")) 30 | 31 | calculation_function1 = operations[operation_symbol] 32 | answer1 = calculation_function1(num1, num2) 33 | 34 | print(f"{num1} {operation_symbol} {num2} = {answer1}") 35 | 36 | operation_symbol = input("\nPick another operation: ") 37 | 38 | num3 = int(input("What's the next number? ")) 39 | 40 | calculation_function2 = operations[operation_symbol] 41 | answer2 = calculation_function2(calculation_function1(num1, num2), num3) 42 | 43 | print(f'{answer1 } {operation_symbol} {num3} = {answer2}') 44 | -------------------------------------------------------------------------------- /days001-010/day010/steps/ste03.py: -------------------------------------------------------------------------------- 1 | def add(n1, n2): 2 | return n1 + n2 3 | 4 | 5 | def sub(n1, n2): 6 | return n1 - n2 7 | 8 | 9 | def mul(n1, n2): 10 | return n1 * n2 11 | 12 | 13 | def div(n1, n2): 14 | return n1 / n2 15 | 16 | 17 | operations = { 18 | '+': add, 19 | '-': sub, 20 | '*': mul, 21 | '/': div 22 | } 23 | 24 | num1 = int(input("What's the first number? ")) 25 | 26 | print(" ".join(operations)) 27 | 28 | keep_calculating = 'c' 29 | while keep_calculating == 'c': 30 | operation_symbol = input("Pick an operation: ") 31 | 32 | num2 = int(input("What's the next number? ")) 33 | 34 | calculation_function = operations[operation_symbol] 35 | answer = calculation_function(num1, num2) 36 | 37 | print(f"{num1} {operation_symbol} {num2} = {answer}") 38 | num1 = answer 39 | 40 | keep_calculating = input(f"Type 'c' to continue calculating with {answer}: ").lower() 41 | -------------------------------------------------------------------------------- /days011-020/day012/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | def increase_enemies(): 2 | enemies = 2 3 | print(f"enemies inside function: {enemies}") 4 | 5 | 6 | def drink_potion1(): 7 | potion_strength = 2 8 | print(potion_strength) 9 | 10 | 11 | def drink_potion2(): 12 | print(player_health) 13 | 14 | 15 | def game(): 16 | def drink_potion3(): 17 | print("Drinking...") 18 | 19 | drink_potion3() 20 | 21 | 22 | enemies = 1 23 | increase_enemies() 24 | print(f"enemies outside function: {enemies}") 25 | 26 | drink_potion1() 27 | 28 | # NameError 29 | # print(potion_strength) 30 | 31 | player_health = 10 32 | drink_potion2() 33 | print(player_health) 34 | 35 | game() 36 | 37 | # NameError 38 | # drink_potion3() 39 | -------------------------------------------------------------------------------- /days011-020/day012/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | def create_enemy(): 2 | enemies1 = ["Skeleton", "Zombie", "Alien"] 3 | if game_level < 5: 4 | new_enemy1 = enemies1[0] 5 | print(new_enemy1) 6 | 7 | 8 | game_level = 3 9 | enemies2 = ["Skeleton", "Zombie", "Alien"] 10 | if game_level < 5: 11 | new_enemy2 = enemies2[0] 12 | print(new_enemy2) 13 | 14 | create_enemy() 15 | 16 | # NameError 17 | # print(new_enemy1) 18 | -------------------------------------------------------------------------------- /days011-020/day012/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | def increase_enemies1(): 2 | # UnboundLocalError 3 | # enemies += 1 4 | pass 5 | 6 | 7 | def increase_enemies2(): 8 | global enemies 9 | enemies += 1 10 | print(f"enemies inside function: {enemies}") 11 | 12 | 13 | def increase_enemies3(): 14 | return enemies + 1 15 | 16 | 17 | enemies = 1 18 | increase_enemies2() 19 | print(f"enemies outside function: {enemies}") 20 | 21 | enemies = 1 22 | print(f"enemies before function: {enemies}") 23 | enemies = increase_enemies3() 24 | print(f"enemies after function: {enemies}") 25 | -------------------------------------------------------------------------------- /days011-020/day012/lectures/lec04.py: -------------------------------------------------------------------------------- 1 | PI = 3.14159 2 | URL = "https://www.google.com" 3 | TWITTER_HANDLE = "@yu_angela" 4 | 5 | print(PI) 6 | print(URL) 7 | print(TWITTER_HANDLE) 8 | -------------------------------------------------------------------------------- /days011-020/day013/exercises/exe01.py: -------------------------------------------------------------------------------- 1 | number = int(input("Which number do you want to check? ")) 2 | 3 | if number % 2 == 0: 4 | print("This is an even number.") 5 | else: 6 | print("This is an odd number.") 7 | -------------------------------------------------------------------------------- /days011-020/day013/exercises/exe02.py: -------------------------------------------------------------------------------- 1 | year = int(input("Which year do you want to check? ")) 2 | 3 | if year % 4 == 0: 4 | if year % 100 == 0: 5 | if year % 400 == 0: 6 | print("Leap year.") 7 | else: 8 | print("Not leap year.") 9 | else: 10 | print("Leap year.") 11 | else: 12 | print("Not leap year.") 13 | -------------------------------------------------------------------------------- /days011-020/day013/exercises/exe03.py: -------------------------------------------------------------------------------- 1 | for number in range(1, 101): 2 | if number % 3 == 0 and number % 5 == 0: 3 | print("FizzBuzz") 4 | elif number % 3 == 0: 5 | print("Fizz") 6 | elif number % 5 == 0: 7 | print("Buzz") 8 | else: 9 | print(number) 10 | -------------------------------------------------------------------------------- /days011-020/day013/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | # Describe Problem 2 | # The problem is that i will never be 20. 3 | # def my_function(): 4 | # for i in range(1, 20): 5 | # if i == 20: 6 | # print("You got it") 7 | 8 | def my_function(): 9 | for i in range(1, 21): 10 | if i == 20: 11 | print("You got it") 12 | 13 | 14 | my_function() 15 | -------------------------------------------------------------------------------- /days011-020/day013/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | from random import randint 2 | dice_imgs = ["❶", "❷", "❸", "❹", "❺", "❻"] 3 | 4 | # Reproduce the Bug 5 | # The problem is that dice_num is in the interval [1, 6] 6 | # and the indexes of dice_imgs are in the interval [0, 5] 7 | # Therefore, currently 0 is never picked and sometimes 6, 8 | # is chosen which gives an IndexError. 9 | # dice_num = randint(1, 6) 10 | 11 | # IndexError 12 | # print(dice_imgs[6]) 13 | 14 | dice_num = randint(0, 5) 15 | print(dice_imgs[dice_num]) 16 | -------------------------------------------------------------------------------- /days011-020/day013/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | year = int(input("What's your year of birth? ")) 2 | 3 | # Play Computer 4 | # If year is 1994 the user isn't classified as anything. 5 | # if year > 1980 and year < 1994: 6 | # print("You are a millennial.") 7 | # elif year > 1994: 8 | # print("You are a Gen Z.") 9 | 10 | if year > 1980 and year < 1994: 11 | print("You are a millennial.") 12 | elif year >= 1994: 13 | print("You are a Gen Z.") 14 | -------------------------------------------------------------------------------- /days011-020/day013/lectures/lec04.py: -------------------------------------------------------------------------------- 1 | # Fix the Errors 2 | # age is a str so we can't compare it with 18 which is an int, 3 | # block of code for the if is not indented, and missing the f, 4 | # of the f-string. 5 | # age = input("How old are you? ") 6 | # if age >= 18: 7 | # print("You can drive at age {age}.") 8 | 9 | age = int(input("How old are you? ")) 10 | if age >= 18: 11 | print(f"You can drive at age {age}.") 12 | -------------------------------------------------------------------------------- /days011-020/day013/lectures/lec05.py: -------------------------------------------------------------------------------- 1 | pages = 0 2 | word_per_page = 0 3 | 4 | # #Print is Your Friend 5 | # Notice the == instead of =. 6 | # word_per_page is never changed. 7 | 8 | print(f'pages: {pages}') 9 | print(f'word_per_page: {word_per_page}') 10 | 11 | pages = int(input("Number of pages: ")) 12 | word_per_page == int(input("Number of words per page: ")) 13 | 14 | print(f'pages: {pages}') 15 | print(f'word_per_page: {word_per_page}') 16 | 17 | total_words = pages * word_per_page 18 | print(total_words) 19 | print() 20 | 21 | # Fixing it... 22 | pages = int(input("Number of pages: ")) 23 | word_per_page = int(input("Number of words per page: ")) 24 | total_words = pages * word_per_page 25 | print(total_words) 26 | -------------------------------------------------------------------------------- /days011-020/day013/lectures/lec06.py: -------------------------------------------------------------------------------- 1 | # Use a Debugger 2 | # The append is only executed once since is outside the for loop. 3 | # Add a breakpoint on line 7, then run the debugger. 4 | def mutate(a_list): 5 | b_list = [] 6 | for item in a_list: 7 | new_item = item * 2 8 | b_list.append(new_item) 9 | print(b_list) 10 | 11 | 12 | mutate([1, 2, 3, 5, 8, 13]) 13 | 14 | 15 | # Fixing it... 16 | def mutate(a_list): 17 | b_list = [] 18 | for item in a_list: 19 | new_item = item * 2 20 | b_list.append(new_item) 21 | print(b_list) 22 | 23 | 24 | mutate([1, 2, 3, 5, 8, 13]) 25 | -------------------------------------------------------------------------------- /days011-020/day014/project/art.py: -------------------------------------------------------------------------------- 1 | logo = r""" 2 | __ ___ __ 3 | / / / (_)___ _/ /_ ___ _____ 4 | / /_/ / / __ `/ __ \/ _ \/ ___/ 5 | / __ / / /_/ / / / / __/ / 6 | /_/ ///_/\__, /_/ /_/\___/_/ 7 | / / /____/_ _____ _____ 8 | / / / __ \ | /| / / _ \/ ___/ 9 | / /___/ /_/ / |/ |/ / __/ / 10 | /_____/\____/|__/|__/\___/_/ 11 | """ 12 | 13 | vs = r""" 14 | _ __ 15 | | | / /____ 16 | | | / / ___/ 17 | | |/ (__ ) 18 | |___/____(_) 19 | """ 20 | -------------------------------------------------------------------------------- /days011-020/day015/lectures/lec.py: -------------------------------------------------------------------------------- 1 | print("Hello world!") 2 | -------------------------------------------------------------------------------- /days011-020/day015/project/coffee_machine_requirements.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days011-020/day015/project/coffee_machine_requirements.pdf -------------------------------------------------------------------------------- /days011-020/day016/lectures/another_module.py: -------------------------------------------------------------------------------- 1 | another_variable = 12 2 | -------------------------------------------------------------------------------- /days011-020/day016/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | import another_module 4 | 5 | print(another_module.another_variable) 6 | timmy = turtle.Turtle() 7 | -------------------------------------------------------------------------------- /days011-020/day016/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | 3 | timmy = Turtle() 4 | print(timmy) 5 | 6 | timmy.shape("turtle") 7 | timmy.color("coral") 8 | timmy.forward(100) 9 | 10 | my_screen = Screen() 11 | print(my_screen.canvheight) 12 | 13 | my_screen.exitonclick() 14 | -------------------------------------------------------------------------------- /days011-020/day016/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | from prettytable import PrettyTable 2 | 3 | table = PrettyTable() 4 | print(table) 5 | 6 | table.add_column("Pokemon Name", ["Pikachu", "Squirtle", "Charmander"]) 7 | table.add_column("Type", ["Electric", "Water", "Fire"]) 8 | print(table) 9 | 10 | print(f'alignment: {table.align}') 11 | table.align = 'l' 12 | print(f'alignment: {table.align}') 13 | print(table) 14 | -------------------------------------------------------------------------------- /days011-020/day016/project/coffee_machine.py: -------------------------------------------------------------------------------- 1 | from menu import Menu, MenuItem 2 | from coffee_maker import CoffeeMaker 3 | from money_machine import MoneyMachine 4 | 5 | 6 | def coffee_machine(menu, coffee_maker, money_machine): 7 | drink_name = input(f"What would you like? ({menu.get_items()}\b): ") 8 | if drink_name == 'off': 9 | return 10 | if drink_name == 'report': 11 | coffee_maker.report() 12 | money_machine.report() 13 | else: 14 | drink = menu.find_drink(drink_name) 15 | if coffee_maker.is_resource_sufficient(drink) and money_machine.make_payment(drink.cost): 16 | coffee_maker.make_coffee(drink) 17 | coffee_machine(menu, coffee_maker, money_machine) 18 | 19 | 20 | def machine(): 21 | menu = Menu() 22 | coffee_maker = CoffeeMaker() 23 | money_machine = MoneyMachine() 24 | coffee_machine(menu, coffee_maker, money_machine) 25 | 26 | 27 | machine() 28 | -------------------------------------------------------------------------------- /days011-020/day016/project/coffee_machine_doc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days011-020/day016/project/coffee_machine_doc.pdf -------------------------------------------------------------------------------- /days011-020/day016/project/coffee_machine_requirements.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days011-020/day016/project/coffee_machine_requirements.pdf -------------------------------------------------------------------------------- /days011-020/day017/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | class User: 2 | pass 3 | 4 | 5 | user = User() 6 | -------------------------------------------------------------------------------- /days011-020/day017/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | class User: 2 | def __init__(self): 3 | print("New User being created...") 4 | 5 | 6 | user1 = User() 7 | user2 = User() 8 | 9 | user1.id = "001" 10 | user1.username = "angela" 11 | print(f'user1.id: {user1.id}, user1.username: {user1.username}') 12 | 13 | user2.id = "002" 14 | user2.username = "jack" 15 | print(f'user2.id: {user2.id}, user2.username: {user2.username}') 16 | -------------------------------------------------------------------------------- /days011-020/day017/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | class User: 2 | def __init__(self, user_id, username): 3 | self.id = user_id 4 | self.username = username 5 | self.followers = 0 6 | 7 | 8 | user1 = User("001", "angela") 9 | user2 = User("002", "jack") 10 | 11 | # TypeError 12 | # user3 = User() 13 | 14 | print(f'user1.id: {user1.id}, user1.username: {user1.username}, user1.followers: {user1.followers}') 15 | print(f'user2.id: {user2.id}, user2.username: {user2.username}, user2.followers: {user2.followers}') 16 | -------------------------------------------------------------------------------- /days011-020/day017/lectures/lec04.py: -------------------------------------------------------------------------------- 1 | class User: 2 | def __init__(self, user_id, username): 3 | self.id = user_id 4 | self.username = username 5 | self.followers = 0 6 | self.following = 0 7 | 8 | def follow(self, other): 9 | other.followers += 1 10 | self.following += 1 11 | 12 | 13 | user1 = User("001", "angela") 14 | user2 = User("002", "jack") 15 | 16 | print(f'user1.id: {user1.id}, user1.username: {user1.username}, ' 17 | f'user1.followers: {user1.followers}, user1.following: {user1.following}') 18 | print(f'user2.id: {user2.id}, user2.username: {user2.username}, ' 19 | f'user2.followers: {user2.followers}, user2.following: {user2.following}') 20 | 21 | user1.follow(user2) 22 | 23 | print(f'user1.id: {user1.id}, user1.username: {user1.username}, ' 24 | f'user1.followers: {user1.followers}, user1.following: {user1.following}') 25 | print(f'user2.id: {user2.id}, user2.username: {user2.username}, ' 26 | f'user2.followers: {user2.followers}, user2.following: {user2.following}') 27 | -------------------------------------------------------------------------------- /days011-020/day017/project/question_model.py: -------------------------------------------------------------------------------- 1 | class Question: 2 | def __init__(self, text, answer): 3 | self.text = text 4 | self.answer = answer 5 | -------------------------------------------------------------------------------- /days011-020/day017/project/quiz.py: -------------------------------------------------------------------------------- 1 | from data import question_data, question_data_api 2 | from quiz_brain import QuizBrain 3 | from question_model import Question 4 | 5 | question_bank = [] 6 | 7 | choice = input("Do you wish to get data from API? ").lower() 8 | if choice == 'yes': 9 | for question in question_data_api: 10 | question_bank.append(Question(question['question'], question['correct_answer'])) 11 | else: 12 | for question in question_data: 13 | question_bank.append(Question(question['text'], question['answer'])) 14 | 15 | quiz = QuizBrain(question_bank) 16 | 17 | while quiz.still_has_questions(): 18 | quiz.next_question() 19 | 20 | print("You've completed the quiz") 21 | print(f"Your final score was: {quiz.score}/{quiz.question_number}") 22 | -------------------------------------------------------------------------------- /days011-020/day017/project/quiz_brain.py: -------------------------------------------------------------------------------- 1 | class QuizBrain: 2 | def __init__(self, question_list): 3 | self.question_list = question_list 4 | self.question_number = 0 5 | self.score = 0 6 | 7 | def next_question(self): 8 | question = self.question_list[self.question_number] 9 | self.question_number += 1 10 | answer = input(f'Q.{self.question_number}: {question.text} (True/False)?: ') 11 | self.check_answer(answer, question.answer) 12 | 13 | def still_has_questions(self): 14 | return self.question_number < len(self.question_list) 15 | 16 | def check_answer(self, user_answer, correct_answer): 17 | if user_answer.lower() == correct_answer.lower(): 18 | print("You got it right!") 19 | self.score += 1 20 | else: 21 | print("That's wrong.") 22 | print(f"The correct answer was: {correct_answer}") 23 | print(f"Your current score is: {self.score}/{self.question_number}.\n") 24 | -------------------------------------------------------------------------------- /days011-020/day018/challenges/cha01.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | 3 | tim = Turtle() 4 | screen = Screen() 5 | 6 | for _ in range(4): 7 | tim.lt(90) 8 | tim.fd(100) 9 | 10 | screen.exitonclick() 11 | -------------------------------------------------------------------------------- /days011-020/day018/challenges/cha02.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | 3 | tim = Turtle() 4 | screen = Screen() 5 | 6 | for _ in range(15): 7 | tim.fd(10) 8 | tim.pu() 9 | tim.fd(10) 10 | tim.pd() 11 | 12 | screen.exitonclick() 13 | 14 | -------------------------------------------------------------------------------- /days011-020/day018/challenges/cha03.py: -------------------------------------------------------------------------------- 1 | from random import shuffle 2 | from turtle import Turtle, Screen 3 | 4 | tim = Turtle() 5 | screen = Screen() 6 | 7 | colors = ['chartreuse', 'blue', 'dark green', 'dark orange', 'purple', 'salmon', 'red', 'crimson'] 8 | shuffle(colors) 9 | 10 | tim.pu() 11 | tim.goto(0, 100) 12 | tim.pd() 13 | 14 | for num_sides, color in enumerate(colors, 3): 15 | angle = 360 / num_sides 16 | tim.color(color) 17 | for _ in range(num_sides): 18 | tim.fd(100) 19 | tim.rt(angle) 20 | 21 | screen.exitonclick() 22 | -------------------------------------------------------------------------------- /days011-020/day018/challenges/cha04.py: -------------------------------------------------------------------------------- 1 | from random import choice 2 | from turtle import Turtle, Screen 3 | 4 | tim = Turtle(visible=False) 5 | screen = Screen() 6 | 7 | colors = ['chartreuse', 'blue', 'dark green', 'dark orange', 'purple', 'salmon', 'red', 'crimson'] 8 | 9 | tim.pensize(15) 10 | tim.speed(0) 11 | for _ in range(200): 12 | tim.seth(choice([0, 90, 180, 270])) 13 | tim.color(choice(colors)) 14 | tim.fd(30) 15 | 1 16 | screen.exitonclick() 17 | -------------------------------------------------------------------------------- /days011-020/day018/challenges/cha05.py: -------------------------------------------------------------------------------- 1 | from random import choice, randint 2 | from turtle import Turtle, Screen, colormode 3 | 4 | 5 | def random_color(): 6 | r = randint(0, 255) 7 | g = randint(0, 255) 8 | b = randint(0, 255) 9 | return r, g, b 10 | 11 | 12 | colormode(255) 13 | tim = Turtle(visible=False) 14 | screen = Screen() 15 | 16 | tim.speed(0) 17 | for heading in range(0, 360, 5): 18 | tim.seth(heading) 19 | tim.color(random_color()) 20 | tim.circle(100) 21 | 22 | screen.exitonclick() 23 | -------------------------------------------------------------------------------- /days011-020/day018/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | 3 | timmy_the_turtle = Turtle() 4 | timmy_the_turtle.shape("turtle") 5 | timmy_the_turtle.color("red") 6 | 7 | timmy_the_turtle.forward(100) 8 | timmy_the_turtle.right(90) 9 | 10 | screen = Screen() 11 | screen.exitonclick() 12 | -------------------------------------------------------------------------------- /days011-020/day018/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | 3 | tim = turtle.Turtle() 4 | -------------------------------------------------------------------------------- /days011-020/day018/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | tim = Turtle() 4 | tom = Turtle() 5 | terry = Turtle() 6 | -------------------------------------------------------------------------------- /days011-020/day018/lectures/lec04.py: -------------------------------------------------------------------------------- 1 | from turtle import * 2 | from random import * 3 | 4 | forward(100) 5 | print(choice([1, 2, 3])) 6 | 7 | exitonclick() 8 | -------------------------------------------------------------------------------- /days011-020/day018/lectures/lec05.py: -------------------------------------------------------------------------------- 1 | import turtle as t 2 | 3 | import heroes 4 | 5 | tim = t.Turtle() 6 | print(heroes.gen()) 7 | -------------------------------------------------------------------------------- /days011-020/day018/lectures/lec06.py: -------------------------------------------------------------------------------- 1 | my_tuple = (1, 3, 8) 2 | 3 | print(my_tuple) 4 | print(my_tuple[0]) 5 | print(my_tuple[1]) 6 | print(my_tuple[2]) 7 | 8 | # TypeError 9 | # my_tuple[2] = 12 10 | 11 | print(list(my_tuple)) 12 | -------------------------------------------------------------------------------- /days011-020/day018/lectures/lec07.py: -------------------------------------------------------------------------------- 1 | from random import choice, randint 2 | from turtle import Turtle, Screen, colormode 3 | 4 | 5 | def random_color(): 6 | r = randint(0, 255) 7 | g = randint(0, 255) 8 | b = randint(0, 255) 9 | return r, g, b 10 | 11 | 12 | colormode(255) 13 | tim = Turtle(visible=False) 14 | screen = Screen() 15 | 16 | tim.pensize(15) 17 | tim.speed(0) 18 | for _ in range(200): 19 | tim.seth(choice([0, 90, 180, 270])) 20 | tim.color(random_color()) 21 | tim.fd(30) 22 | 1 23 | screen.exitonclick() 24 | -------------------------------------------------------------------------------- /days011-020/day018/project/hirst_painting.py: -------------------------------------------------------------------------------- 1 | from random import choice 2 | from turtle import Turtle, Screen, colormode 3 | 4 | 5 | def random_color(): 6 | colors = [(10, 9, 3), (95, 99, 79), (0, 255, 0), (82, 255, 184), 7 | (251, 177, 60), (255, 233, 0), (68, 3, 129), (216, 17, 89)] 8 | return choice(colors) 9 | 10 | 11 | def draw_line(num_dots): 12 | for _ in range(num_dots): 13 | tim.dot(20, random_color()) 14 | tim.fd(50) 15 | 16 | 17 | colormode(255) 18 | tim = Turtle(visible=False) 19 | screen = Screen() 20 | 21 | tim.pu() 22 | tim.speed(0) 23 | 24 | tim.goto(-250, 250) 25 | for y in range(-250, 250, 50): 26 | tim.goto(-250, y) 27 | draw_line(10) 28 | 29 | screen.exitonclick() 30 | -------------------------------------------------------------------------------- /days011-020/day018/steps/color_palette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days011-020/day018/steps/color_palette.png -------------------------------------------------------------------------------- /days011-020/day018/steps/ste.py: -------------------------------------------------------------------------------- 1 | import colorgram 2 | 3 | original_colors = colorgram.extract('color_palette.png', 8) 4 | 5 | colors = [] 6 | for original_color in original_colors: 7 | color = original_color.rgb 8 | r = color.r 9 | g = color.g 10 | b = color.b 11 | rgb = (r, g, b) 12 | colors.append(rgb) 13 | 14 | print(colors) 15 | -------------------------------------------------------------------------------- /days011-020/day019/challenges/cha.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | 3 | 4 | def move_forwards(): 5 | tim.fd(10) 6 | 7 | 8 | def move_backwards(): 9 | tim.bk(10) 10 | 11 | 12 | def turn_left(): 13 | tim.lt(10) 14 | 15 | 16 | def turn_right(): 17 | tim.rt(10) 18 | 19 | 20 | def clear(): 21 | tim.reset() 22 | 23 | 24 | tim = Turtle() 25 | screen = Screen() 26 | 27 | screen.listen() 28 | screen.onkey(key='w', fun=move_forwards) 29 | screen.onkey(key='s', fun=move_backwards) 30 | screen.onkey(key='a', fun=turn_left) 31 | screen.onkey(key='d', fun=turn_right) 32 | screen.onkey(key='c', fun=clear) 33 | 34 | screen.exitonclick() 35 | -------------------------------------------------------------------------------- /days011-020/day019/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | 3 | 4 | def move_forwards(): 5 | tim.forward(10) 6 | 7 | 8 | tim = Turtle() 9 | screen = Screen() 10 | 11 | screen.listen() 12 | screen.onkey(key='space', fun=move_forwards) 13 | 14 | screen.exitonclick() 15 | 16 | -------------------------------------------------------------------------------- /days011-020/day019/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | def add(n1, n2): 2 | return n1 + n2 3 | 4 | 5 | def sub(n1, n2): 6 | return n1 - n2 7 | 8 | 9 | def mul(n1, n2): 10 | return n1 * n2 11 | 12 | 13 | def div(n1, n2): 14 | return n1 / n2 15 | 16 | 17 | def calculator(n1, n2, func): 18 | return func(n1, n2) 19 | 20 | 21 | result = calculator(2, 3, add) 22 | print(result) 23 | 24 | result = calculator(2, 3, sub) 25 | print(result) 26 | 27 | result = calculator(2, 3, mul) 28 | print(result) 29 | 30 | result = calculator(2, 3, div) 31 | print(result) 32 | -------------------------------------------------------------------------------- /days011-020/day020/steps/ste01.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | 3 | screen = Screen() 4 | screen.setup(width=600, height=600) 5 | screen.bgcolor('black') 6 | screen.title("🐍 My Snake Game 🐍") 7 | 8 | starting_pos = [(0, 0), (-20, 0), (-40, 0)] 9 | segments = [] 10 | for pos in starting_pos: 11 | segments.append(Turtle('square')) 12 | segments[-1].color('white') 13 | segments[-1].pu() 14 | segments[-1].goto(pos) 15 | 16 | screen.exitonclick() 17 | 18 | -------------------------------------------------------------------------------- /days011-020/day020/steps/ste02.py: -------------------------------------------------------------------------------- 1 | import time 2 | from turtle import Turtle, Screen 3 | 4 | STARTING_POS = [(0, 0), (-20, 0), (-40, 0)] 5 | 6 | screen = Screen() 7 | screen.setup(width=600, height=600) 8 | screen.bgcolor('black') 9 | screen.title("🐍 My Snake Game 🐍") 10 | screen.tracer(0) 11 | 12 | segments = [] 13 | for pos in STARTING_POS: 14 | segments.append(Turtle('square')) 15 | segments[-1].color('white') 16 | segments[-1].pu() 17 | segments[-1].goto(pos) 18 | 19 | game_over = False 20 | while not game_over: 21 | screen.update() 22 | time.sleep(0.1) 23 | for idx in range(len(segments) - 1, 0, -1): 24 | pos = segments[idx - 1].pos() 25 | segments[idx].goto(pos) 26 | segments[0].fd(20) 27 | 28 | 29 | 30 | screen.exitonclick() 31 | 32 | -------------------------------------------------------------------------------- /days011-020/day020/steps/ste03.py: -------------------------------------------------------------------------------- 1 | import time 2 | from turtle import Screen 3 | 4 | from snake import Snake 5 | 6 | screen = Screen() 7 | screen.setup(width=600, height=600) 8 | screen.bgcolor('black') 9 | screen.title("🐍 My Snake Game 🐍") 10 | screen.tracer(0) 11 | 12 | snake = Snake() 13 | 14 | game_over = False 15 | while not game_over: 16 | screen.update() 17 | time.sleep(0.1) 18 | snake.move() 19 | 20 | screen.exitonclick() 21 | -------------------------------------------------------------------------------- /days011-020/day020/steps/ste04.py: -------------------------------------------------------------------------------- 1 | import time 2 | from turtle import Screen 3 | 4 | from snake import Snake 5 | 6 | screen = Screen() 7 | screen.setup(width=600, height=600) 8 | screen.bgcolor('black') 9 | screen.title("🐍 My Snake Game 🐍") 10 | screen.tracer(0) 11 | 12 | snake = Snake() 13 | 14 | screen.listen() 15 | 16 | screen.onkey(snake.up, "Up") 17 | screen.onkey(snake.down, "Down") 18 | screen.onkey(snake.left, "Left") 19 | screen.onkey(snake.right, "Right") 20 | 21 | game_over = False 22 | while not game_over: 23 | screen.update() 24 | time.sleep(0.1) 25 | snake.move() 26 | 27 | screen.exitonclick() 28 | -------------------------------------------------------------------------------- /days021-030/day021/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | class Animal: 2 | def __init__(self): 3 | self.num_eyes = 2 4 | 5 | def breathe(self): 6 | print('Inhale, exhale...') 7 | 8 | 9 | class Fish(Animal): 10 | def __init__(self): 11 | super().__init__() 12 | 13 | def breathe(self): 14 | super().breathe() 15 | print("...doing this underwater!") 16 | 17 | def swim(self): 18 | print("Moving in water...") 19 | 20 | 21 | nemo = Fish() 22 | 23 | nemo.swim() 24 | nemo.breathe() 25 | print(nemo.num_eyes) 26 | -------------------------------------------------------------------------------- /days021-030/day021/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | piano_keys = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] 2 | piano_tuple = ('do', 're', 'mi', 'fa', 'so', 'la', 'ti') 3 | 4 | print(piano_keys[2:5]) 5 | print(piano_keys[2:]) 6 | print(piano_keys[:5]) 7 | print(piano_keys[2:5:2]) 8 | print(piano_keys[::2]) 9 | print(piano_keys[::-1]) 10 | print() 11 | 12 | print(piano_tuple[2:5]) 13 | -------------------------------------------------------------------------------- /days021-030/day021/project/food.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | from random import randint 3 | 4 | 5 | class Food(Turtle): 6 | def __init__(self): 7 | super().__init__('circle') 8 | self.pu() 9 | self.shapesize(stretch_len=0.5, stretch_wid=0.5) 10 | self.color("red") 11 | self.speed(0) 12 | self.refresh() 13 | 14 | def refresh(self): 15 | self.goto(randint(-280, 280), randint(-280, 280)) 16 | 17 | -------------------------------------------------------------------------------- /days021-030/day021/project/scoreboard.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | ALIGNMENT = 'center' 4 | FONT_SCORE = ('Atari Classic Chunky', 20, 'normal') 5 | FONT_GAME_OVER = ('Atari Classic Chunky', 36, 'normal') 6 | FONT_GAME_OVER_SCORE = ('Atari Classic Chunky', 16, 'normal') 7 | 8 | 9 | class Scoreboard(Turtle): 10 | def __init__(self): 11 | super().__init__(visible=False) 12 | self.score = 0 13 | 14 | self.pu() 15 | self.color('white') 16 | self.goto(0, 270) 17 | self.update_scoreboard() 18 | 19 | def update_scoreboard(self): 20 | self.write(f'Score: {self.score}', font=FONT_SCORE, align=ALIGNMENT) 21 | 22 | def increase_score(self): 23 | self.score += 1 24 | self.clear() 25 | self.update_scoreboard() 26 | 27 | def game_over(self): 28 | self.clear() 29 | self.goto(0, 0) 30 | self.write('GAME OVER', font=FONT_GAME_OVER, align=ALIGNMENT) 31 | self.goto(0, -100) 32 | self.write(f'Final score: {self.score}', font=FONT_GAME_OVER_SCORE, align=ALIGNMENT) 33 | -------------------------------------------------------------------------------- /days021-030/day022/project/paddle.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | 4 | class Paddle(Turtle): 5 | def __init__(self, pos): 6 | super().__init__('square') 7 | self.speed(0) 8 | self.pu() 9 | self.goto(pos) 10 | self.shapesize(stretch_wid=5, stretch_len=1) 11 | self.color('white') 12 | 13 | def up(self): 14 | x = self.xcor() 15 | y = self.ycor() + 20 16 | if y < 280: 17 | self.goto(x, y) 18 | 19 | def down(self): 20 | x = self.xcor() 21 | y = self.ycor() - 20 22 | if y > -280: 23 | self.goto(x, y) 24 | -------------------------------------------------------------------------------- /days021-030/day023/capstone/crossing_game.py: -------------------------------------------------------------------------------- 1 | import time 2 | from turtle import Screen 3 | from player import Player 4 | from car_manager import CarManager 5 | from scoreboard import Scoreboard 6 | 7 | screen = Screen() 8 | screen.setup(width=600, height=600) 9 | screen.tracer(0) 10 | 11 | 12 | player = Player() 13 | scoreboard = Scoreboard() 14 | car_manager = CarManager() 15 | 16 | screen.listen() 17 | 18 | screen.onkey(player.move, 'Up') 19 | 20 | reps = 0 21 | game_over = False 22 | while not game_over: 23 | time.sleep(0.1) 24 | screen.update() 25 | if reps % 6 == 0: 26 | car_manager.create_car() 27 | reps += 1 28 | car_manager.move_cars() 29 | if car_manager.is_collision(player): 30 | game_over = True 31 | if player.at_finish_line(): 32 | player.set_player() 33 | scoreboard.level_up() 34 | car_manager.level_up() 35 | 36 | player.game_over() 37 | car_manager.game_over() 38 | scoreboard.game_over() 39 | 40 | screen.exitonclick() 41 | -------------------------------------------------------------------------------- /days021-030/day023/capstone/player.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | STARTING_POSITION = (0, -280) 4 | MOVE_DISTANCE = 10 5 | FINISH_LINE_Y = 280 6 | 7 | 8 | class Player(Turtle): 9 | def __init__(self): 10 | super().__init__('turtle') 11 | self.penup() 12 | self.seth(90) 13 | self.set_player() 14 | 15 | def set_player(self): 16 | self.goto(STARTING_POSITION) 17 | 18 | def at_finish_line(self): 19 | return self.ycor() >= 280 20 | 21 | def move(self): 22 | self.fd(MOVE_DISTANCE) 23 | 24 | def game_over(self): 25 | self.ht() 26 | -------------------------------------------------------------------------------- /days021-030/day023/capstone/scoreboard.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | FONT = ('Atari Classic Chunky', 12, 'normal') 4 | GAME_OVER_FONT = ('Atari Classic Chunky', 36, 'normal') 5 | 6 | POSITION = (-220, 270) 7 | 8 | 9 | class Scoreboard(Turtle): 10 | def __init__(self): 11 | super().__init__(visible=False) 12 | self.level = 0 13 | self.pu() 14 | self.goto(POSITION) 15 | self.level_up() 16 | 17 | def level_up(self): 18 | self.clear() 19 | self.level += 1 20 | self.write(f"Level: {self.level}", align='center', font=FONT) 21 | 22 | def game_over(self): 23 | self.reset() 24 | self.write("GAME OVER", align='center', font=GAME_OVER_FONT) 25 | self.goto(0, -50) 26 | self.write(f"Final level: {self.level}", align='center', font=FONT) 27 | -------------------------------------------------------------------------------- /days021-030/day024/challenges/data.txt: -------------------------------------------------------------------------------- 1 | 4 -------------------------------------------------------------------------------- /days021-030/day024/challenges/food.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | from random import randint 3 | 4 | 5 | class Food(Turtle): 6 | def __init__(self): 7 | super().__init__('circle') 8 | self.pu() 9 | self.shapesize(stretch_len=0.5, stretch_wid=0.5) 10 | self.color("red") 11 | self.speed(0) 12 | self.refresh() 13 | 14 | def refresh(self): 15 | self.goto(randint(-280, 280), randint(-280, 280)) 16 | 17 | -------------------------------------------------------------------------------- /days021-030/day024/project/Input/Letters/starting_letter.txt: -------------------------------------------------------------------------------- 1 | Dear [name], 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Input/Names/invited_names.txt: -------------------------------------------------------------------------------- 1 | Aang 2 | Zuko 3 | Appa 4 | Katara 5 | Sokka 6 | Momo 7 | Uncle Iroh 8 | Toph -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/example.txt: -------------------------------------------------------------------------------- 1 | Dear Aang, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/letter_for_Aang.txt: -------------------------------------------------------------------------------- 1 | Dear Aang, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/letter_for_Appa.txt: -------------------------------------------------------------------------------- 1 | Dear Appa, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/letter_for_Iroh.txt: -------------------------------------------------------------------------------- 1 | Dear Iroh, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/letter_for_Katara.txt: -------------------------------------------------------------------------------- 1 | Dear Katara, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/letter_for_Momo.txt: -------------------------------------------------------------------------------- 1 | Dear Momo, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/letter_for_Sokka.txt: -------------------------------------------------------------------------------- 1 | Dear Sokka, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/letter_for_Toph.txt: -------------------------------------------------------------------------------- 1 | Dear Toph, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/letter_for_Uncle.txt: -------------------------------------------------------------------------------- 1 | Dear Uncle, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/Output/ReadyToSend/letter_for_Zuko.txt: -------------------------------------------------------------------------------- 1 | Dear Zuko, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Angela 8 | -------------------------------------------------------------------------------- /days021-030/day024/project/mail_merge.py: -------------------------------------------------------------------------------- 1 | with open('Input/Letters/starting_letter.txt') as file: 2 | template_letter = file.read() 3 | 4 | with open('Input/Names/invited_names.txt') as file: 5 | names = file.read().split() 6 | 7 | letters = {} 8 | for name in names: 9 | letters[f'letter_for_{name}'] = template_letter.replace('[name]', name) 10 | 11 | for filename, letter in letters.items(): 12 | with open(f'Output/ReadyToSend/{filename}.txt', mode='w') as file: 13 | file.write(letter) 14 | 15 | 16 | -------------------------------------------------------------------------------- /days021-030/day025/US States Game (turtle) copy/Learning-Report.csv: -------------------------------------------------------------------------------- 1 | ,States Missed,States Correct 2 | 0,Pennsylvania,Washington 3 | 1,Louisiana,Hawaii 4 | 2,North Carolina,Arkansas 5 | 3,Alaska,Nevada 6 | 4,Rhode Island,- 7 | 5,New Hampshire,- 8 | 6,Ohio,- 9 | 7,Iowa,- 10 | 8,Arizona,- 11 | 9,Montana,- 12 | 10,Colorado,- 13 | 11,West Virginia,- 14 | 12,Utah,- 15 | 13,Maine,- 16 | 14,Massachusetts,- 17 | 15,Mississippi,- 18 | 16,Connecticut,- 19 | 17,Florida,- 20 | 18,Vermont,- 21 | 19,Maryland,- 22 | 20,South Carolina,- 23 | 21,Nebraska,- 24 | 22,Wisconsin,- 25 | 23,Indiana,- 26 | 24,Delaware,- 27 | 25,Kentucky,- 28 | 26,South Dakota,- 29 | 27,Michigan,- 30 | 28,New Mexico,- 31 | 29,Virginia,- 32 | 30,Alabama,- 33 | 31,North Dakota,- 34 | 32,Oregon,- 35 | 33,Oklahoma,- 36 | 34,Kansas,- 37 | 35,Illinois,- 38 | 36,Texas,- 39 | 37,Missouri,- 40 | 38,Minnesota,- 41 | 39,New York,- 42 | 40,California,- 43 | 41,Tennessee,- 44 | 42,Georgia,- 45 | 43,Idaho,- 46 | 44,New Jersey,- 47 | 45,Wyoming,- 48 | -------------------------------------------------------------------------------- /days021-030/day025/US States Game (turtle) copy/blank_states_img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days021-030/day025/US States Game (turtle) copy/blank_states_img.gif -------------------------------------------------------------------------------- /days021-030/day025/lectures/lec01/main.py: -------------------------------------------------------------------------------- 1 | import csv 2 | 3 | import pandas as pd 4 | 5 | with open('weather_data.csv') as data_file: 6 | raw_data = data_file.readlines() 7 | print(raw_data) 8 | 9 | with open('weather_data.csv') as data_file: 10 | data = csv.reader(data_file) 11 | print(data) 12 | temperatures = [] 13 | for row in data: 14 | if row[1] != 'temp': 15 | temperatures.append(int(row[1])) 16 | print(row) 17 | print(temperatures) 18 | 19 | print() 20 | data = pd.read_csv('weather_data.csv') 21 | print(data) 22 | print(data['temp']) 23 | -------------------------------------------------------------------------------- /days021-030/day025/lectures/lec01/weather_data.csv: -------------------------------------------------------------------------------- 1 | day,temp,condition 2 | Monday,12,Sunny 3 | Tuesday,14,Rain 4 | Wednesday,15,Rain 5 | Thursday,14,Cloudy 6 | Friday,21,Sunny 7 | Saturday,22,Sunny 8 | Sunday,24,Sunny -------------------------------------------------------------------------------- /days021-030/day025/lectures/lec02/main.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | 4 | def to_fahrenheit(temp): 5 | return round(temp * 1.8 + 32, 2) 6 | 7 | 8 | data = pd.read_csv('weather_data.csv') 9 | print(type(data)) 10 | print(type(data['temp'])) 11 | 12 | data_dict = data.to_dict() 13 | print(data_dict) 14 | 15 | temp_list = data['temp'].to_list() 16 | print(len(temp_list)) 17 | 18 | print(data['temp'].mean()) 19 | print(data['temp'].max()) 20 | print() 21 | 22 | print(data['condition']) 23 | print(data.condition) 24 | print() 25 | 26 | print(data[data.day == "Monday"]) 27 | 28 | print(data[data.temp == data.temp.max()]) 29 | 30 | monday = data[data.day == "Monday"] 31 | print(monday.condition) 32 | print() 33 | 34 | print(to_fahrenheit(int(monday.temp))) 35 | print() 36 | 37 | data_dict = { 38 | "students": ["Amy", "James", "Angela"], 39 | "scores": [76, 56, 65] 40 | } 41 | 42 | data = pd.DataFrame(data_dict) 43 | print(data) 44 | data.to_csv("students_data.csv", index=False) 45 | -------------------------------------------------------------------------------- /days021-030/day025/lectures/lec02/students_data.csv: -------------------------------------------------------------------------------- 1 | students,scores 2 | Amy,76 3 | James,56 4 | Angela,65 5 | -------------------------------------------------------------------------------- /days021-030/day025/lectures/lec02/weather_data.csv: -------------------------------------------------------------------------------- 1 | day,temp,condition 2 | Monday,12,Sunny 3 | Tuesday,14,Rain 4 | Wednesday,15,Rain 5 | Thursday,14,Cloudy 6 | Friday,21,Sunny 7 | Saturday,22,Sunny 8 | Sunday,24,Sunny -------------------------------------------------------------------------------- /days021-030/day025/lectures/lec03/main.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | df = pd.read_csv("2018_squirrel_census.csv") 4 | 5 | # My solution 6 | new_df = df.groupby("Primary Fur Color", as_index=False).count()[['Primary Fur Color', 'X']] 7 | 8 | columns = { 9 | 'Primary Fur Color': 'Fur Color', 10 | 'X': 'Count' 11 | } 12 | new_df.rename(columns=columns, inplace=True) 13 | 14 | new_df.to_csv('squirrel_data.csv', index=False) 15 | 16 | # Lecture solution 17 | num_gray = len(df[df["Primary Fur Color"] == 'Gray']) 18 | num_cinnamon = len(df[df["Primary Fur Color"] == 'Cinnamon']) 19 | num_black = len(df[df["Primary Fur Color"] == 'Black']) 20 | 21 | print(num_gray, num_cinnamon, num_black) 22 | 23 | data_dict = { 24 | "Fur Color": ["Gray", "Cinnamon", "Black"], 25 | "Count": [num_gray, num_cinnamon, num_black] 26 | } 27 | 28 | new_df = pd.DataFrame(data_dict) 29 | new_df.to_csv("squirrel_count.csv") 30 | -------------------------------------------------------------------------------- /days021-030/day025/lectures/lec03/squirrel_count.csv: -------------------------------------------------------------------------------- 1 | ,Fur Color,Count 2 | 0,Gray,2473 3 | 1,Cinnamon,392 4 | 2,Black,103 5 | -------------------------------------------------------------------------------- /days021-030/day025/lectures/lec03/squirrel_data.csv: -------------------------------------------------------------------------------- 1 | Fur Color,Count 2 | Black,103 3 | Cinnamon,392 4 | Gray,2473 5 | -------------------------------------------------------------------------------- /days021-030/day026/exercises/exe01.py: -------------------------------------------------------------------------------- 1 | numbers = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55] 2 | # 🚨 Do Not Change the code above 👆 3 | 4 | # Write your 1 line code 👇 below: 5 | squared_numbers = [n ** 2 for n in numbers] 6 | 7 | # Write your code 👆 above: 8 | 9 | print(squared_numbers) 10 | -------------------------------------------------------------------------------- /days021-030/day026/exercises/exe02.py: -------------------------------------------------------------------------------- 1 | numbers = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55] 2 | # 🚨 Do Not Change the code above 3 | 4 | # Write your 1 line code 👇 below: 5 | result = [n for n in numbers if n % 2 == 0] 6 | 7 | # Write your code 👆 above: 8 | 9 | print(result) 10 | -------------------------------------------------------------------------------- /days021-030/day026/exercises/exe03/file1.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 6 3 | 5 4 | 8 5 | 33 6 | 12 7 | 7 8 | 4 9 | 72 10 | 2 11 | 42 12 | 13 13 | -------------------------------------------------------------------------------- /days021-030/day026/exercises/exe03/file2.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 6 3 | 13 4 | 5 5 | 7 6 | 89 7 | 12 8 | 3 9 | 33 10 | 34 11 | 1 12 | 344 13 | 42 14 | -------------------------------------------------------------------------------- /days021-030/day026/exercises/exe03/main.py: -------------------------------------------------------------------------------- 1 | with open('file1.txt') as file: 2 | numbers1 = [int(line) for line in file.readlines()] 3 | 4 | with open('file2.txt') as file: 5 | numbers2 = [int(line) for line in file.readlines()] 6 | 7 | result = [n for n in numbers1 if n in numbers2] 8 | 9 | # Write your code above 👆 10 | 11 | print(result) 12 | -------------------------------------------------------------------------------- /days021-030/day026/exercises/exe04.py: -------------------------------------------------------------------------------- 1 | sentence = "What is the Airspeed Velocity of an Unladen Swallow?" 2 | # Don't change code above 👆 3 | 4 | # Write your code below 👇 5 | result = {word: len(word) for word in sentence.split()} 6 | 7 | print(result) 8 | -------------------------------------------------------------------------------- /days021-030/day026/exercises/exe05.py: -------------------------------------------------------------------------------- 1 | weather_c = { 2 | "Monday": 12, 3 | "Tuesday": 14, 4 | "Wednesday": 15, 5 | "Thursday": 14, 6 | "Friday": 21, 7 | "Saturday": 22, 8 | "Sunday": 24, 9 | } 10 | 11 | 12 | # 🚨 Don't change code above 👆 13 | 14 | # Write your code below 👇 15 | def to_fahrenheit(temp): 16 | return round(temp * 1.8 + 32, 1) 17 | 18 | 19 | weather_f = {weekday: to_fahrenheit(temp) for weekday, temp in weather_c.items()} 20 | print(weather_f) 21 | -------------------------------------------------------------------------------- /days021-030/day026/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | numbers = [1, 2, 3] 2 | new_numbers = [n + 1 for n in numbers] 3 | print(new_numbers) 4 | 5 | name = "Angela" 6 | letters = [letter for letter in name] 7 | print(letters) # ['A', 'n', 'g', 'e', 'l', 'a'] 8 | 9 | range_list = [n * 2 for n in range(1, 5)] 10 | print(range_list) 11 | 12 | names = ["Alex", "Beth", "Caroline", "Dave", "Eleanor", "Freddie"] 13 | short_names = [name for name in names if len(name) < 5] 14 | print(short_names) 15 | 16 | long_names = [name.upper() for name in names if len(name) >= 5] 17 | print(long_names) 18 | -------------------------------------------------------------------------------- /days021-030/day026/lectures/lec02/50_states.csv: -------------------------------------------------------------------------------- 1 | state,x,y 2 | Alabama,139,-77 3 | Alaska,-204,-170 4 | Arizona,-203,-40 5 | Arkansas,57,-53 6 | California,-297,13 7 | Colorado,-112,20 8 | Connecticut,297,96 9 | Delaware,275,42 10 | Florida,220,-145 11 | Georgia,182,-75 12 | Hawaii,-317,-143 13 | Idaho,-216,122 14 | Illinois,95,37 15 | Indiana,133,39 16 | Iowa,38,65 17 | Kansas,-17,5 18 | Kentucky,149,1 19 | Louisiana,59,-114 20 | Maine,319,164 21 | Maryland,288,27 22 | Massachusetts,312,112 23 | Michigan,148,101 24 | Minnesota,23,135 25 | Mississippi,94,-78 26 | Missouri,49,6 27 | Montana,-141,150 28 | Nebraska,-61,66 29 | Nevada,-257,56 30 | New Hampshire,302,127 31 | New Jersey,282,65 32 | New Mexico,-128,-43 33 | New York,236,104 34 | North Carolina,239,-22 35 | North Dakota,-44,158 36 | Ohio,176,52 37 | Oklahoma,-8,-41 38 | Oregon,-278,138 39 | Pennsylvania,238,72 40 | Rhode Island,318,94 41 | South Carolina,218,-51 42 | South Dakota,-44,109 43 | Tennessee,131,-34 44 | Texas,-38,-106 45 | Utah,-189,34 46 | Vermont,282,154 47 | Virginia,234,12 48 | Washington,-257,193 49 | West Virginia,200,20 50 | Wisconsin,83,113 51 | Wyoming,-134,90 -------------------------------------------------------------------------------- /days021-030/day026/lectures/lec02/blank_states_img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days021-030/day026/lectures/lec02/blank_states_img.gif -------------------------------------------------------------------------------- /days021-030/day026/lectures/lec02/main.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | import pandas 3 | 4 | screen = turtle.Screen() 5 | screen.title("U.S. States Game") 6 | image = "blank_states_img.gif" 7 | screen.addshape(image) 8 | turtle.shape(image) 9 | 10 | data = pandas.read_csv("50_states.csv") 11 | all_states = data.state.to_list() 12 | guessed_states = [] 13 | 14 | while len(guessed_states) < 50: 15 | answer_state = screen.textinput(title=f"{len(guessed_states)}/50 States Correct", 16 | prompt="What's another state's name?").title() 17 | if answer_state == "Exit": 18 | missing_states = [state for state in all_states if state not in guessed_states] 19 | new_data = pandas.DataFrame(missing_states) 20 | new_data.to_csv("states_to_learn.csv") 21 | break 22 | if answer_state in all_states: 23 | guessed_states.append(answer_state) 24 | t = turtle.Turtle() 25 | t.hideturtle() 26 | t.penup() 27 | state_data = data[data.state == answer_state] 28 | t.goto(int(state_data.x), int(state_data.y)) 29 | t.write(answer_state) 30 | -------------------------------------------------------------------------------- /days021-030/day026/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | from random import randint 2 | 3 | names = ["Alex", "Beth", "Caroline", "Dave", "Eleanor", "Freddie"] 4 | 5 | student_scores = {student: randint(0, 100) for student in names} 6 | print(student_scores) 7 | 8 | passed_students = {student: score for student, score in student_scores.items() if score >= 60} 9 | print(passed_students) 10 | -------------------------------------------------------------------------------- /days021-030/day026/lectures/lec04.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | student_dict = { 4 | "student": ["Angela", "James", "Lily"], 5 | "score": [56, 76,98] 6 | } 7 | 8 | for key, value in student_dict.items(): 9 | print(f'{key}: {value}') 10 | 11 | student_df = pd.DataFrame(student_dict) 12 | print(student_df) 13 | print() 14 | 15 | for key, value in student_df.items(): 16 | print(key) 17 | print(value) 18 | print() 19 | 20 | for index, row in student_df.iterrows(): 21 | print(index) 22 | print(row) 23 | print() 24 | 25 | for index, row in student_df.iterrows(): 26 | print(row.student, row.score) 27 | print() 28 | 29 | for index, row in student_df.iterrows(): 30 | if row.student == 'Angela': 31 | print(row.score) 32 | -------------------------------------------------------------------------------- /days021-030/day026/project/nato_alphabet.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | 4 | def generate_nato(): 5 | word = input("Enter a word: ").upper() 6 | try: 7 | nato_list = [nato_dict[letter] for letter in word] 8 | except KeyError: 9 | print("Sorry, only letter in the english alphabet, please.") 10 | generate_nato() 11 | else: 12 | print(nato_list) 13 | 14 | 15 | df = pd.read_csv('nato_phonetic_alphabet.csv') 16 | nato_dict = {row.letter: row.code for index, row in df.iterrows()} 17 | 18 | generate_nato() 19 | -------------------------------------------------------------------------------- /days021-030/day026/project/nato_phonetic_alphabet.csv: -------------------------------------------------------------------------------- 1 | letter,code 2 | A,Alfa 3 | B,Bravo 4 | C,Charlie 5 | D,Delta 6 | E,Echo 7 | F,Foxtrot 8 | G,Golf 9 | H,Hotel 10 | I,India 11 | J,Juliet 12 | K,Kilo 13 | L,Lima 14 | M,Mike 15 | N,November 16 | O,Oscar 17 | P,Papa 18 | Q,Quebec 19 | R,Romeo 20 | S,Sierra 21 | T,Tango 22 | U,Uniform 23 | V,Victor 24 | W,Whiskey 25 | X,X-ray 26 | Y,Yankee 27 | Z,Zulu -------------------------------------------------------------------------------- /days021-030/day027/project/unit_converter.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | FONT = ("Make Wonderful Moments Script", 30) 4 | 5 | 6 | def to_km(num_miles): 7 | return 1.60934 * num_miles 8 | 9 | 10 | def display_km(): 11 | num_miles = float(entry.get()) 12 | km_label['text'] = f'{to_km(num_miles):.2f}' 13 | 14 | 15 | window = Tk() 16 | 17 | window.title("️⛽️ Mile to Km Converter ⛽️") 18 | window.config(padx=20, pady=20) 19 | 20 | miles_text = Label(text='Miles', font=FONT) 21 | km_text = Label(text='km', font=FONT) 22 | result_text = Label(text='is equal to', font=FONT) 23 | km_label = Label(text='0', font=FONT) 24 | 25 | button = Button(text='Calculate', font=FONT, command=display_km) 26 | 27 | entry = Entry(width=7, font=FONT) 28 | entry.insert(END, '0') 29 | 30 | miles_text.grid(column=2, row=0) 31 | km_text.grid(column=2, row=1) 32 | result_text.grid(column=0, row=1) 33 | km_label.grid(column=1, row=1) 34 | button.grid(column=1, row=2) 35 | entry.grid(column=1, row=0) 36 | 37 | window.mainloop() 38 | -------------------------------------------------------------------------------- /days021-030/day028/Pomodoro Technique (tk) copy/tomato.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days021-030/day028/Pomodoro Technique (tk) copy/tomato.png -------------------------------------------------------------------------------- /days021-030/day029/project/data.txt: -------------------------------------------------------------------------------- 1 | Secret | harrison@email.com | sec123 2 | Amazon | harrison@email.com | prime 3 | Facebook | harrison@email.com | 56Zj*a#hJEcF2j(*1 4 | Udemy | harrison@email.com | B%K&v48QIcHgY 5 | Door | harrison@email.com | +TvO5m#$wAdA!7Yu 6 | Twitter | harrison@email.com | ztq7nkE4)OU#d 7 | Orkut | harrison@email.com | GMu83hm(hwc$ 8 | -------------------------------------------------------------------------------- /days021-030/day029/project/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days021-030/day029/project/logo.png -------------------------------------------------------------------------------- /days021-030/day030/project/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "Amazon": { 3 | "email/username": "harrison@email.com", 4 | "password": "!X+ZtHq3WoSk84$" 5 | }, 6 | "Twitter": { 7 | "email/username": "harrison@email.com", 8 | "password": "brdkQ+%%SThH7C9(6" 9 | }, 10 | "Facebook": { 11 | "email/username": "harrison@email.com", 12 | "password": "c1#34Lst!A$HIO7" 13 | }, 14 | "Netflix": { 15 | "email/username": "harrison@email.com", 16 | "password": "2O2&Vo$4NCjxG0Q" 17 | } 18 | } -------------------------------------------------------------------------------- /days021-030/day030/project/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days021-030/day030/project/logo.png -------------------------------------------------------------------------------- /days031-040/day031/capstone/data/words_to_learn.csv: -------------------------------------------------------------------------------- 1 | French,English 2 | histoire,history 3 | chercher,search 4 | genre,kind 5 | frère,brother 6 | mettre,to put 7 | aucun,no 8 | eux,them 9 | ville,city 10 | parlé,speak 11 | arrivé,come 12 | devrait,should 13 | longtemps,long time 14 | vont,will 15 | revoir,meet again 16 | compris,understood 17 | donné,given 18 | train,train 19 | façon,way 20 | écoute,listen 21 | dont,whose 22 | main,hand 23 | première,first 24 | vieux,old 25 | sois,be 26 | tiens,here 27 | tellement,so much 28 | point,point 29 | suite,after 30 | vers,towards 31 | minutes,minutes 32 | chambre,bedroom 33 | droit,law 34 | mari,husband 35 | espère,hope 36 | eau,water 37 | nouvelle,new 38 | boulot,job 39 | terre,Earth 40 | loin,far 41 | -------------------------------------------------------------------------------- /days031-040/day031/capstone/images/card_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day031/capstone/images/card_back.png -------------------------------------------------------------------------------- /days031-040/day031/capstone/images/card_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day031/capstone/images/card_front.png -------------------------------------------------------------------------------- /days031-040/day031/capstone/images/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day031/capstone/images/right.png -------------------------------------------------------------------------------- /days031-040/day031/capstone/images/wrong.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day031/capstone/images/wrong.png -------------------------------------------------------------------------------- /days031-040/day032/challenges/cha.py: -------------------------------------------------------------------------------- 1 | import os 2 | import random 3 | import smtplib 4 | import datetime as dt 5 | 6 | 7 | def get_message(): 8 | with open('quotes.txt') as file: 9 | lines = file.readlines() 10 | return f'Subject: Motivational Friday!\n\n{random.choice(lines)}' 11 | 12 | 13 | def day_of_week(): 14 | weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] 15 | now = dt.datetime.now() 16 | return weekdays[now.weekday()] 17 | 18 | 19 | def send_email(message): 20 | from_email = os.getenv('EMAIL') 21 | to_email = os.getenv('OTHER_EMAIL') 22 | password = os.getenv('EMAIL_PASS') 23 | with smtplib.SMTP("smtp.gmail.com", port=587) as connection: 24 | connection.starttls() 25 | connection.login(user=from_email, password=password) 26 | connection.sendmail(from_addr=from_email, 27 | to_addrs=to_email, 28 | msg=message) 29 | 30 | 31 | if day_of_week() == 'Friday': 32 | send_email(get_message()) 33 | -------------------------------------------------------------------------------- /days031-040/day032/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | import os 2 | import smtplib 3 | 4 | from_email = os.getenv('EMAIL') 5 | password = os.getenv('EMAIL_PASS') 6 | to_email = os.getenv('OTHER_EMAIL') 7 | 8 | connection = smtplib.SMTP("smtp.gmail.com", port=587) 9 | connection.starttls() 10 | connection.login(user=from_email, password=password) 11 | connection.sendmail(from_addr=from_email, to_addrs=to_email, msg="Hello!") 12 | connection.close() 13 | -------------------------------------------------------------------------------- /days031-040/day032/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | import os 2 | import smtplib 3 | 4 | from_email = os.getenv('EMAIL') 5 | password = os.getenv('EMAIL_PASS') 6 | to_email = os.getenv('OTHER_EMAIL') 7 | 8 | connection = smtplib.SMTP("smtp.gmail.com", port=587) 9 | connection.starttls() 10 | connection.login(user=from_email, password=password) 11 | connection.sendmail(from_addr=from_email, 12 | to_addrs=to_email, 13 | msg="Subject:Hello\n\nThis is the body of my email!") 14 | connection.close() 15 | -------------------------------------------------------------------------------- /days031-040/day032/lectures/lec03.py: -------------------------------------------------------------------------------- 1 | import os 2 | import smtplib 3 | 4 | from_email = os.getenv('EMAIL') 5 | password = os.getenv('EMAIL_PASS') 6 | to_email = os.getenv('OTHER_EMAIL') 7 | 8 | with smtplib.SMTP("smtp.gmail.com", port=587) as connection: 9 | connection.starttls() 10 | connection.login(user=from_email, password=password) 11 | connection.sendmail(from_addr=from_email, 12 | to_addrs=to_email, 13 | msg="Subject:Hello\n\nThis is the body of my other email!") 14 | -------------------------------------------------------------------------------- /days031-040/day032/lectures/lec04.py: -------------------------------------------------------------------------------- 1 | import datetime as dt 2 | 3 | now = dt.datetime.now() 4 | print(now) 5 | print(type(now)) 6 | print() 7 | 8 | year = now.year 9 | month = now.month 10 | weekday = now.weekday() 11 | print(f'year: {year}, month: {month}, weekday: {weekday}') 12 | 13 | birthday = dt.datetime(year=1996, month=6, day=21, hour=7, minute=20) 14 | print(birthday) 15 | -------------------------------------------------------------------------------- /days031-040/day032/project/birthday_wisher.py: -------------------------------------------------------------------------------- 1 | import os 2 | import random 3 | import smtplib 4 | import datetime as dt 5 | 6 | import pandas as pd 7 | 8 | 9 | def get_message(a_name): 10 | letter_filename = random.choice(('letter_1.txt', 'letter_2.txt', 'letter_3.txt')) 11 | with open(f'letter_templates/{letter_filename}') as file: 12 | letter = file.read() 13 | return f"Subject:Happy Birthday!\n\n{letter.replace('[NAME]', a_name)}" 14 | 15 | 16 | def send_email(a_name, to_email): 17 | from_email = os.getenv('EMAIL') 18 | password = os.getenv('EMAIL_PASS') 19 | with smtplib.SMTP("smtp.gmail.com", port=587) as connection: 20 | connection.starttls() 21 | connection.login(user=from_email, password=password) 22 | connection.sendmail(from_addr=from_email, 23 | to_addrs=to_email, 24 | msg=get_message(a_name)) 25 | 26 | 27 | df = pd.read_csv('birthdays.csv') 28 | now = dt.datetime.now() 29 | birthdays = {row['name']: row.email for _, row in df.iterrows() if row.month == now.month and row.day == now.day} 30 | for name, email in birthdays.items(): 31 | send_email(name, email) 32 | -------------------------------------------------------------------------------- /days031-040/day032/project/birthdays.csv: -------------------------------------------------------------------------------- 1 | name,email,year,month,day 2 | Test,test@email.com,1961,12,21 3 | Paula,paula@email.com,1996,6,12 4 | Anna,anna@email.com, 1920,6,12 5 | -------------------------------------------------------------------------------- /days031-040/day032/project/letter_templates/letter_1.txt: -------------------------------------------------------------------------------- 1 | Dear [NAME], 2 | 3 | Happy birthday! 4 | 5 | All the best for the year! 6 | 7 | Harrison -------------------------------------------------------------------------------- /days031-040/day032/project/letter_templates/letter_2.txt: -------------------------------------------------------------------------------- 1 | Hey [NAME], 2 | 3 | Happy birthday! Have a wonderful time today and eat lots of cake! 4 | 5 | Lots of love, 6 | 7 | Harrison -------------------------------------------------------------------------------- /days031-040/day032/project/letter_templates/letter_3.txt: -------------------------------------------------------------------------------- 1 | Dear [NAME], 2 | 3 | It's your birthday! Have a great day! 4 | 5 | All my love, 6 | 7 | Harrison -------------------------------------------------------------------------------- /days031-040/day033/ISS API (requests, APIs) copy/ISS_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day033/ISS API (requests, APIs) copy/ISS_logo.png -------------------------------------------------------------------------------- /days031-040/day033/ISS API (requests, APIs) copy/haversine.py: -------------------------------------------------------------------------------- 1 | from math import cos, asin, sqrt, pi 2 | 3 | 4 | # Haversine distance formula (returns KM) 5 | def haversine_distance(lat1, lon1, lat2, lon2): 6 | p = pi / 180 7 | a = 0.5 - cos((lat2 - lat1) * p) / 2 + cos(lat1 * p) * cos(lat2 * p) * (1 - cos((lon2 - lon1) * p)) / 2 8 | return 12742 * asin(sqrt(a)) 9 | 10 | 11 | def to_mi(km): 12 | return km * 0.62137 13 | -------------------------------------------------------------------------------- /days031-040/day033/ISS API (requests, APIs) copy/mail_client.py: -------------------------------------------------------------------------------- 1 | import smtplib 2 | 3 | email = "bot_email" 4 | password = "bot_email_password" 5 | 6 | 7 | def send_mail(to_email): 8 | with smtplib.SMTP("smtp.mail.yahoo.com") as connection: 9 | connection.starttls() 10 | connection.login(user=email, password=password) 11 | connection.sendmail(from_addr=email, to_addrs=to_email, 12 | msg="Subject: ISS ALERT!\n\nThe ISS is visible overhead!") 13 | print(f"Alert email send to {to_email}.") 14 | -------------------------------------------------------------------------------- /days031-040/day034/lectures/lec.py: -------------------------------------------------------------------------------- 1 | age: int 2 | name: str 3 | height: float 4 | is_human: bool 5 | 6 | 7 | def police_check(a_age: int) -> bool: 8 | return a_age >= 18 9 | 10 | 11 | age = 24 12 | name = "Paula" 13 | height = 1.62 14 | is_human = True 15 | print(age, name, height, is_human) 16 | 17 | age = int(input("Your age: ")) 18 | if police_check(age): 19 | print("You may pass") 20 | else: 21 | print("Pay a fine") 22 | 23 | 24 | -------------------------------------------------------------------------------- /days031-040/day034/project/data.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | url = "https://opentdb.com/api.php" 4 | 5 | params = { 6 | 'amount': 10, 7 | 'type': 'boolean', 8 | 'category': 18 9 | } 10 | 11 | response = requests.get(url, params=params) 12 | response.raise_for_status() 13 | question_data = response.json()['results'] 14 | -------------------------------------------------------------------------------- /days031-040/day034/project/images/false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day034/project/images/false.png -------------------------------------------------------------------------------- /days031-040/day034/project/images/true.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day034/project/images/true.png -------------------------------------------------------------------------------- /days031-040/day034/project/question_model.py: -------------------------------------------------------------------------------- 1 | class Question: 2 | 3 | def __init__(self, q_text, q_answer): 4 | self.text = q_text 5 | self.answer = q_answer 6 | -------------------------------------------------------------------------------- /days031-040/day034/project/quiz_brain.py: -------------------------------------------------------------------------------- 1 | from html import unescape 2 | class QuizBrain: 3 | 4 | def __init__(self, q_list): 5 | self.question_number = 0 6 | self.score = 0 7 | self.question_list = q_list 8 | self.current_question = None 9 | 10 | def still_has_questions(self): 11 | return self.question_number < len(self.question_list) 12 | 13 | def next_question(self): 14 | self.current_question = self.question_list[self.question_number] 15 | self.question_number += 1 16 | return f"Q.{self.question_number}: {unescape(self.current_question.text)}: " 17 | 18 | def check_answer(self, user_answer): 19 | correct_answer = self.current_question.answer 20 | if user_answer == correct_answer: 21 | self.score += 1 22 | return True 23 | return False 24 | -------------------------------------------------------------------------------- /days031-040/day034/project/quizzler.py: -------------------------------------------------------------------------------- 1 | from question_model import Question 2 | from quiz_brain import QuizBrain 3 | from data import question_data 4 | from ui import QuizInterface 5 | 6 | question_bank = [] 7 | for question in question_data: 8 | question_text = question["question"] 9 | question_answer = question["correct_answer"] 10 | new_question = Question(question_text, question_answer) 11 | question_bank.append(new_question) 12 | 13 | 14 | quiz = QuizBrain(question_bank) 15 | quiz_ui = QuizInterface(quiz) 16 | -------------------------------------------------------------------------------- /days031-040/day035/challenges/cha.py: -------------------------------------------------------------------------------- 1 | import os 2 | import requests 3 | 4 | 5 | def bring_umbrella(data): 6 | for hour_data in data[:12]: 7 | if hour_data['weather'][0]['id'] < 700: 8 | return True 9 | return False 10 | 11 | 12 | LATITUDE = 23.810651 13 | LONGITUDE = 90.4126466 14 | 15 | api_key = os.getenv('OWM_KEY') 16 | 17 | params = { 18 | 'lat': LATITUDE, 19 | 'lon': LONGITUDE, 20 | 'exclude': 'current,minutely,daily,alerts', 21 | 'appid': api_key 22 | } 23 | 24 | response = requests.get('https://api.openweathermap.org/data/2.5/onecall', params=params) 25 | response.raise_for_status() 26 | weather_data = response.json()['hourly'] 27 | if bring_umbrella(weather_data): 28 | print("Bring an umbrella.") 29 | else: 30 | print("No umbrella needed.") 31 | -------------------------------------------------------------------------------- /days031-040/day035/lectures/lec01.py: -------------------------------------------------------------------------------- 1 | import os 2 | import requests 3 | 4 | LATITUDE = 51.507351 5 | LONGITUDE = -0.127758 6 | 7 | api_key = os.getenv('OWM_KEY') 8 | 9 | params = { 10 | 'lat': LATITUDE, 11 | 'lon': LONGITUDE, 12 | 'exclude': 'current,minutely,daily,alerts', 13 | 'appid': api_key 14 | } 15 | 16 | response = requests.get('https://api.openweathermap.org/data/2.5/onecall', params=params) 17 | print(response.json()['hourly']) 18 | -------------------------------------------------------------------------------- /days031-040/day035/lectures/lec02.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | print(os.environ.get("OWM_KEY")) 4 | print(os.environ.get("TWILIO_SID")) 5 | print(os.environ.get("TWILIO_AUTH_TOKEN")) 6 | -------------------------------------------------------------------------------- /days031-040/day036/Watchlist Report (Alpha Vantage, D7 Networks, SMTP)/image_assets/addtowatchlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day036/Watchlist Report (Alpha Vantage, D7 Networks, SMTP)/image_assets/addtowatchlist.png -------------------------------------------------------------------------------- /days031-040/day036/Watchlist Report (Alpha Vantage, D7 Networks, SMTP)/image_assets/generatereport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day036/Watchlist Report (Alpha Vantage, D7 Networks, SMTP)/image_assets/generatereport.png -------------------------------------------------------------------------------- /days031-040/day036/Watchlist Report (Alpha Vantage, D7 Networks, SMTP)/image_assets/viewwatchlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day036/Watchlist Report (Alpha Vantage, D7 Networks, SMTP)/image_assets/viewwatchlist.png -------------------------------------------------------------------------------- /days031-040/day036/Watchlist Report (Alpha Vantage, D7 Networks, SMTP)/news_client.py: -------------------------------------------------------------------------------- 1 | from newsapi import NewsApiClient 2 | 3 | # Init 4 | news_api = NewsApiClient(api_key="9bb42f40494e4b23b6594e62eea57c28") 5 | 6 | 7 | # /v2/top-headlines 8 | def get_news(company_name, dates: list): 9 | headlines_string = "" 10 | all_articles = news_api.get_everything(q=company_name, 11 | language='en', 12 | sort_by='relevancy', 13 | from_param=dates[0], 14 | to=dates[1]) 15 | 16 | for article in all_articles["articles"][:5]: 17 | headlines_string += f"{article['source']['name']}:\n" 18 | headlines_string += f"{article['title']}\n" 19 | headlines_string += f"{article['url']}\n\n" 20 | 21 | return headlines_string 22 | -------------------------------------------------------------------------------- /days031-040/day036/Watchlist Report (Alpha Vantage, D7 Networks, SMTP)/todo.txt: -------------------------------------------------------------------------------- 1 | 1. Add tkinter interface: 2 | - when "email alerts" is checked, prompt user for email. 3 | - when sms is checked, prompt user for their full phone number. 4 | 5 | tkinter colors: 6 | - BGCOLOR = #FAF1E6 7 | - Nice blue color = #DEEDF0 8 | 9 | 2. Organize the project 10 | 11 | 3. Hide sensitive keys/passwords 12 | 13 | 4. Add a log where all functions report to it after every report is generated. -------------------------------------------------------------------------------- /days031-040/day036/Watchlist Report (Alpha Vantage, D7 Networks, SMTP)/watchlist_data/watchlist.csv: -------------------------------------------------------------------------------- 1 | ticker,name 2 | AMD,Advanced Micro Devices 3 | INTC, Intel 4 | BYND, Beyond Meat 5 | NVDA,Nvidia 6 | F,Ford 7 | -------------------------------------------------------------------------------- /days031-040/day037/challenges/cha.py: -------------------------------------------------------------------------------- 1 | import os 2 | import requests 3 | 4 | USERNAME = 'paulaabrodrigues' 5 | TOKEN = os.getenv('PIXELA_TOKEN') 6 | GRAPH_ID = 'graph1' 7 | 8 | pixela_endpoint = 'https://pixe.la/v1/users' 9 | pixel_endpoint = f'{pixela_endpoint}/{USERNAME}/graphs/{GRAPH_ID}' 10 | 11 | pixel_config = { 12 | 'date': '20210613', 13 | 'quantity': '100' 14 | } 15 | 16 | response = requests.post(url=pixel_endpoint, json=pixel_config, headers={"X-USER-TOKEN": TOKEN}) 17 | print(response.text) 18 | -------------------------------------------------------------------------------- /days031-040/day037/project/pixela_reading_tracker.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from datetime import datetime 4 | 5 | import requests 6 | 7 | USERNAME = 'PIXELA_USERNAME' 8 | TOKEN = os.getenv('PIXELA_TOKEN') 9 | GRAPH_ID = 'graph1' 10 | 11 | pixela_endpoint = 'https://pixe.la/v1/users' 12 | pixel_endpoint = f'{pixela_endpoint}/{USERNAME}/graphs/{GRAPH_ID}' 13 | 14 | today = datetime.now() 15 | pixel_config = { 16 | 'date': today.strftime("%Y%m%d"), 17 | 'quantity': input("How many pages did you read today? ") 18 | } 19 | 20 | response = requests.post(url=pixel_endpoint, json=pixel_config, headers={"X-USER-TOKEN": TOKEN}) 21 | print(response.text) 22 | -------------------------------------------------------------------------------- /days031-040/day038/steps/ste01.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import requests 4 | 5 | APP_ID = os.getenv('NUTRI_ID') 6 | API_KEY = os.getenv('NUTRI_KEY') 7 | 8 | exercise = input("Tell me which exercise you did? ") 9 | 10 | headers = { 11 | "x-app-id": APP_ID, 12 | "x-app-key": API_KEY 13 | } 14 | 15 | body = { 16 | "query": exercise, 17 | "gender": "female", 18 | "weight_kg": 77.1, 19 | "height_cm": 162, 20 | "age": 24 21 | } 22 | 23 | response = requests.post(url='https://trackapi.nutritionix.com/v2/natural/exercise', json=body, headers=headers) 24 | print(response.json()) 25 | -------------------------------------------------------------------------------- /days031-040/day039/Cheapest-Flight-Finder-GUI/data_manager.py: -------------------------------------------------------------------------------- 1 | class DataManager: 2 | #This class is responsible for talking to the Google Sheet. 3 | # This function can be implemented later if needed. 4 | pass -------------------------------------------------------------------------------- /days031-040/day039/Cheapest-Flight-Finder-GUI/image_assets/menu_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days031-040/day039/Cheapest-Flight-Finder-GUI/image_assets/menu_icon.png -------------------------------------------------------------------------------- /days031-040/day039/Cheapest-Flight-Finder-GUI/notification_manager.py: -------------------------------------------------------------------------------- 1 | import smtplib 2 | 3 | 4 | class NotificationManager: 5 | def __init__(self, email, password): 6 | self.email = email 7 | self.password = password 8 | 9 | def send_mail(self, to_email, message, from_city, to_city): 10 | print("Preparing Email Client..") 11 | with smtplib.SMTP("smtp.mail.yahoo.com") as connection: 12 | print("\nEmail connection established...") 13 | connection.starttls() 14 | print("tls on...") 15 | connection.login(user=self.email, password=self.password) 16 | print("login successful...") 17 | connection.sendmail( 18 | from_addr=self.email, 19 | to_addrs=to_email, 20 | msg=f"Subject: Cheapest Flight from {from_city} to {to_city}\n\n{message}" 21 | ) 22 | print(f"Mail Sent Successfully") 23 | -------------------------------------------------------------------------------- /days031-040/day039/Cheapest-Flight-Finder-GUI/setup_readme.md: -------------------------------------------------------------------------------- 1 | ## Necessary Program Setup: 2 | 3 | ### `1:` Go to [this link](https://tequila.kiwi.com/portal/docs/tequila_api/search_api), and get an API key. 4 | ### `2:` Create an email to use as the bot email for email notifications (if you want this feature). 5 | ### `3:` Store the following as environment variables: 6 | ENV VAR NAME | VALUE 7 | ------------- | ------------- 8 | KIWI_API_KEY | your kiwi api key 9 | BOT_EMAIL | your bot email 10 | BOT_EMAIL_PASSWORD | your bot email's password 11 | ### `4:` Run in console: `pip install requests` 12 | ### `5:` Run main.py -------------------------------------------------------------------------------- /days031-040/day040/capstone/flight_search.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | 4 | class FlightSearch: 5 | def __init__(self, url, params, headers): 6 | self.flight_data = self.get(url, params, headers) 7 | 8 | @staticmethod 9 | def get(url, params, headers): 10 | return requests.get(f'{url}locations/query', params=params, headers=headers).json()['locations'][0] 11 | 12 | 13 | if __name__ == '__main__': 14 | import os 15 | 16 | tequila_params = { 17 | 'location_types': 'city', 18 | 'term': 'london' 19 | } 20 | tequila_headers = {'apikey': os.getenv('TEQUILA_KEY')} 21 | 22 | flight_search = FlightSearch('https://tequila-api.kiwi.com/', tequila_params, tequila_headers) 23 | print(flight_search.flight_data) 24 | 25 | -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/angela.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/angela.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/chillies.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/chillies.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/cloud.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/computer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/computer.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/data-research.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/data-research.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/database.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/favicon.ico -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/forecast-analytics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/forecast-analytics.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/headshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/headshot.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/market-analysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/market-analysis.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/mountain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/mountain.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/report.png -------------------------------------------------------------------------------- /days041-050/day041/Harrison Site (Rough)/images/risk-management.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days041-050/day041/Harrison Site (Rough)/images/risk-management.png -------------------------------------------------------------------------------- /days041-050/day041/lectures/lec.html: -------------------------------------------------------------------------------- 1 |
bacon, bacon, bacon, bacon, bacon, bacon
13 |bacon, bacon, bacon, bacon, bacon, bacon
14 |bacon, bacon, bacon, bacon, bacon, bacon
15 |Founder of The App Brewery.
12 |I am an iOS and Web Developer. I ❤️ coffee and motorcycles.
13 |Hello, World!
" 9 | 10 | @app.route("/bye") 11 | def say_bye(): 12 | return "Bye!
" 13 | 14 | @app.route("/Hello {name}!
" 17 | 18 | @app.route("/stonks") 19 | def stonks(): 20 | return f'") 11 | def quote(base: str, quote: str()): 12 | return requests.get(f"https://api.binance.com/api/v3/avgPrice?symbol={base.upper()}{quote.upper()}").json() 13 | 14 | 15 | 16 | if __name__ == "__main__": 17 | app.run(debug=True) -------------------------------------------------------------------------------- /days051-060/day056/project/static/styles.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: white; 3 | } -------------------------------------------------------------------------------- /days051-060/day056/project/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |Harrison 7 | 8 | 9 | 10 | 11 | 12 |I'm Harrison
13 | 14 | -------------------------------------------------------------------------------- /days051-060/day057/FinWeek/README.md: -------------------------------------------------------------------------------- 1 | # Finify - Your lightweight stop for all stock news 2 | 3 | ## Setup: 4 | 5 | 1. Navigate to the Finify directory from the project root: 6 | ```bash 7 | cd days051-060/day057/FinWeek 8 | ``` 9 | 2. Install the python requirements: 10 | ```bash 11 | pip install -r requirements.txt 12 | ``` 13 | 14 | 3. Set your environment variables in bash or a .env file in the Finify/backend/ directory: 15 | ```bash 16 | export FINNHUB_APIKEY=17 | ``` 18 | 19 | 3. Run the flask server: 20 | ```bash 21 | python3 server.py 22 | ``` -------------------------------------------------------------------------------- /days051-060/day057/FinWeek/backend/finnhub_cli.py: -------------------------------------------------------------------------------- 1 | import os 2 | from datetime import datetime, timedelta 3 | from json import dumps 4 | from datetime import datetime 5 | 6 | from dotenv import load_dotenv 7 | import finnhub 8 | 9 | load_dotenv() 10 | 11 | client = finnhub.Client(os.getenv("FINNHUB_APIKEY")) 12 | 13 | 14 | def get_stock_news(symbol: str, days_backtrack: int = 7) -> list[dict]: 15 | _from = datetime.now() - timedelta(days=days_backtrack) 16 | _to = datetime.now() 17 | r = client.company_news(symbol.upper(), _from.strftime("%Y-%m-%d"), _to.strftime("%Y-%m-%d")) 18 | for i, c_r in enumerate(r.copy()): 19 | r[i]['date'] = datetime.fromtimestamp(int(c_r.pop('datetime'))).strftime("%m/%d/%Y %H:%M") 20 | 21 | return r 22 | -------------------------------------------------------------------------------- /days051-060/day057/FinWeek/requirements.txt: -------------------------------------------------------------------------------- 1 | finnhub-python 2 | python-dotenv -------------------------------------------------------------------------------- /days051-060/day057/FinWeek/server.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | import requests 3 | from flask import Flask, render_template 4 | import random 5 | from ratelimit import limits, sleep_and_retry 6 | 7 | from backend.finnhub_cli import get_stock_news 8 | 9 | app = Flask(__name__) 10 | 11 | 12 | @app.route("/") 13 | def home(): 14 | return render_template('index.html') 15 | 16 | 17 | @sleep_and_retry 18 | @limits(59, 60) 19 | @app.route("/ ") 20 | def symbol_news(symbol: str): 21 | articles = get_stock_news(symbol) 22 | return render_template('symbol_news.html', symbol=symbol, articles=articles) 23 | 24 | 25 | if __name__ == "__main__": 26 | app.run(debug=True) -------------------------------------------------------------------------------- /days051-060/day057/FinWeek/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | FinWeek - Home 8 | 9 | 10 |Welcome to FinWeek - your lightweight source for weekly stock news!
11 |12 |14 | 15 | -------------------------------------------------------------------------------- /days051-060/day057/lectures/jinja-intro.py: -------------------------------------------------------------------------------- 1 | # NOTE: Jinja comes bundled with flask, so there is no need to install it. 2 | from datetime import datetime 3 | import requests 4 | from flask import Flask, render_template 5 | import random 6 | 7 | app = Flask(__name__) 8 | 9 | 10 | @app.route("/") 11 | def hello_world(): 12 | random_num = random.randint(1, 10) 13 | return render_template('index.html', num=random_num, year=datetime.datetime.now().year) 14 | 15 | 16 | @app.route("/guess/13 |
") 17 | def guessify(name): 18 | year = datetime.now().year 19 | gender_response = requests.get(f'https://api.genderize.io?name={name}').json() 20 | gender = gender_response["gender"] 21 | prob = gender_response['probability'] 22 | ageify_response = requests.get(f'https://api.agify.io/?name={name}').json() 23 | age = ageify_response['age'] 24 | return render_template('ify.html', name=name, gender=gender, prob=prob, age=age, year=year) 25 | 26 | @app.route("/blog") 27 | def blog(): 28 | blog_url = "NO" 29 | return 30 | 31 | 32 | if __name__ == "__main__": 33 | app.run(debug=True) 34 | -------------------------------------------------------------------------------- /days051-060/day057/lectures/templates/ify.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GENDER GUESS 6 | 7 | 8 |Genderizer Results for {{ name }}:
9 |
10 |11 |
I think your gender is: {{ gender }}
12 |And I am {{ prob * 100 }}% sure.
13 |And I think that you are {{ age }} years old.
14 | 15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /days051-060/day057/lectures/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Hello World 6 | 7 | 8 |Hello World!
9 |{{ 5 * 6 }}
10 |Random number: {{ num }}
11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /days051-060/day058/Bootstrap-installation/prototype.xd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days051-060/day058/Bootstrap-installation/prototype.xd -------------------------------------------------------------------------------- /days051-060/day058/Bootstrap-installation/static/css/styles.css: -------------------------------------------------------------------------------- 1 | .avatar { 2 | height: 45px; 3 | width: 45px; 4 | background-color: #bbb; 5 | border-radius: 50%; 6 | display: inline-block; 7 | object-fit: cover; 8 | } 9 | 10 | .roboto { 11 | font-family: 'Roboto Mono', monospace; 12 | } 13 | 14 | .intro { 15 | font-weight: normal; 16 | font-size: 3rem; 17 | line-height: 1.5; 18 | padding: 7% 20%; 19 | } 20 | 21 | #navbar-custom { 22 | background-color: #5366E3; 23 | padding-left: 15%; 24 | padding-right: 15%; 25 | } 26 | 27 | .category-btn { 28 | background-color: #5366E3; 29 | color: #fff; 30 | border: none; 31 | padding: 10px 20px; 32 | border-radius: 5px; 33 | font-size: 1.2rem; 34 | font-weight: bold; 35 | cursor: pointer; 36 | height: 250px; 37 | width: 250px; 38 | justify-content:center; 39 | border-radius: 25px; 40 | filter: drop-shadow(8px 8px 6px grey); 41 | } 42 | .category-btn:hover { 43 | background:white; 44 | color: #5366E3; 45 | } 46 | 47 | .category-btn-row { 48 | display: flex; 49 | justify-content: space-around; 50 | margin-top: 5%; 51 | } -------------------------------------------------------------------------------- /days051-060/day058/Bootstrap-installation/static/img/avatar_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days051-060/day058/Bootstrap-installation/static/img/avatar_placeholder.png -------------------------------------------------------------------------------- /days051-060/day059/README.md: -------------------------------------------------------------------------------- 1 | # Files Moved to Dedicated Repository: 2 | 3 | **[personal-developer-blog (on GitHub)](https://github.com/hschickdevs/personal-developer-blog)** 4 | 5 | ## Website Demo: 6 | 7 |  -------------------------------------------------------------------------------- /days051-060/day059/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days051-060/day059/demo.gif -------------------------------------------------------------------------------- /days051-060/day060/html-forms/output.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days051-060/day060/html-forms/output.txt -------------------------------------------------------------------------------- /days051-060/day060/html-forms/server.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template, request 2 | 3 | import json 4 | 5 | app = Flask(__name__) 6 | 7 | 8 | @app.route('/') 9 | def home(): 10 | return render_template("index.html") 11 | 12 | @app.route('/login', methods=["POST"]) 13 | def login(): 14 | """To access form data (Data transmitted in a POST or PUT request) ues the request.form attribute""" 15 | print("Data", request.data) 16 | print("Args:", request.args) 17 | print("Values:", request.values) 18 | return f'Name: {request.form["name"]} | Password: {request.form["password"]}
' 19 | 20 | 21 | if __name__ == "__main__": 22 | app.run(debug=True) -------------------------------------------------------------------------------- /days051-060/day060/html-forms/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |HTML Forms 8 | 9 | 10 |HTML FORM
11 | 18 | 19 | -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/README.md: -------------------------------------------------------------------------------- 1 | # Day 61 Topics Covered: 2 | - Flask WTForms 3 | - Flask Template Inheritance 4 | - [Flask-Bootstrap](https://pythonhosted.org/Flask-Bootstrap/basic-usage.html#available-blocks) -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool] 2 | [tool.poetry] 3 | authors = ["Your Name"] 4 | name = "root" 5 | version = "0.0.0" 6 | description="flask template" 7 | [tool.poetry.dependencies] 8 | flask = "==1.0.2" 9 | python = "^3.8" 10 | -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | Flask-WTF 3 | Flask-Bootstrap -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/templates/bootstrap_support/denied_bootstrap.html: -------------------------------------------------------------------------------- 1 | {% extends "bootstrap/base.html" %} 2 | {% block title %}Login Denied{% endblock %} 3 | 4 | {% block styles %} 5 | {{ super() }} 6 | 11 | {% endblock %} 12 | 13 | {% block navbar %} 14 | 17 | {% endblock %} 18 | 19 | {% block content %} 20 |Login Denied
21 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/templates/bootstrap_support/login_bootstrap.html: -------------------------------------------------------------------------------- 1 | {% extends "bootstrap/base.html" %} 2 | {% block title %}Login{% endblock %} 3 | 4 | {% block navbar %} 5 | 8 | {% endblock %} 9 | 10 | {% block content %} 11 |12 |27 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/templates/bootstrap_support/login_bootstrap_quickform.html: -------------------------------------------------------------------------------- 1 | {% extends "bootstrap/base.html" %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block title %}Login{% endblock %} 5 | 6 | {% block navbar %} 7 | 10 | {% endblock %} 11 | 12 | {% block content %} 13 |Login
13 | 26 |14 |20 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/templates/legacy/base_flask_template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Login
15 | 19 |{% block title %}{% endblock %} 8 | 16 | 17 | 18 | {% block content %}{% endblock %} 19 | 20 | -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/templates/legacy/denied.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "base_flask_template.html" %} 3 | 4 | 5 | {% block title %}Login Failed{% endblock %} 6 | 7 | 8 | 15 | 16 | 17 | {% block content %} 18 |19 |23 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/templates/legacy/index.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "legacy/base_flask_template.html" %} 3 | 4 | 5 | {% block title %}Secrets{% endblock %} 6 | 7 | 8 | {% block content %} 9 | 14 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/templates/legacy/login.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "base_flask_template.html" %} 3 | 4 | 5 | {% block title %}Login{% endblock %} 6 | 7 | 8 | {% block content %} 9 |Your account details were denied...
20 | 21 | 22 |10 |25 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day061/flask_secrets/templates/legacy/success.html: -------------------------------------------------------------------------------- 1 | 2 | {% extends "base_flask_template.html" %} 3 | 4 | 5 | {% block title %}Login Success{% endblock %} 6 | 7 | 8 | {% block content %} 9 |Login
11 | 24 |10 |13 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day062/README.md: -------------------------------------------------------------------------------- 1 | # Day 62 Topics Covered - Coffee & Wifi Project: 2 | 3 | Practiced concepts from previous lessons on web development (Flask WTForms, Flask Template Inheritance, [Flask-Bootstrap](https://pythonhosted.org/Flask-Bootstrap/basic-usage.html#available-blocks)) by creating the "Coffee & Wifi" website. 4 | 5 | ## Website Demo: 6 | 7 |  -------------------------------------------------------------------------------- /days061-070/day062/coffee-and-wifi/backend/data.py: -------------------------------------------------------------------------------- 1 | import csv 2 | 3 | 4 | class CafeDatabase: 5 | @staticmethod 6 | def load(): 7 | with open('cafe-data.csv', newline='') as csv_file: 8 | return [row for row in csv.reader(csv_file, delimiter=',')] 9 | 10 | @staticmethod 11 | def update(cafe_data: list[list]): 12 | with open('cafe-data.csv', 'w', newline='') as csv_file: 13 | writer = csv.writer(csv_file) 14 | writer.writerows(cafe_data) -------------------------------------------------------------------------------- /days061-070/day062/coffee-and-wifi/cafe-data.csv: -------------------------------------------------------------------------------- 1 | Cafe Name,Location,Open,Close,Coffee,Wifi,Power Availability 2 | Lighthaus,https://goo.gl/maps/2EvhB4oq4gyUXKXx9,11AM, 3:30PM,☕☕☕☕️,💪💪,🔋🔋🔋 3 | Esters,https://goo.gl/maps/13Tjc36HuPWLELaSA,8AM,3PM,☕☕☕☕,💪💪💪,🔋 4 | Ginger & White,https://goo.gl/maps/DqMx2g5LiAqv3pJQ9,7:30AM,5:30PM,☕☕☕,✘,🔋 5 | Mare Street Market,https://goo.gl/maps/ALR8iBiNN6tVfuAA8,8AM,1PM,☕☕,💪💪💪,🔋🔋🔋 6 | Starbucks,"https://www.google.com/maps/dir/32.9806622,-97.0606007/starbucks+lakeside+flower+mound/@32.989358,-97.0725431,15z/data=!3m1!4b1!4m9!4m8!1m1!4e1!1m5!1m1!1s0x864c2cec695c2fad:0x113d5687e85be057!2m2!1d-97.065005!2d32.995405",8AM,9PM,☕,💪💪💪,🔋🔋🔋🔋 7 | -------------------------------------------------------------------------------- /days061-070/day062/coffee-and-wifi/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | dominate==2.5.2 3 | Flask==1.1.2 4 | Flask-Bootstrap==3.3.7.1 5 | Flask-WTF==0.14.3 6 | itsdangerous==1.1.0 7 | Jinja2==2.11.2 8 | MarkupSafe==1.1.1 9 | visitor==0.1.3 10 | Werkzeug==1.0.1 11 | WTForms==2.3.3 12 | -------------------------------------------------------------------------------- /days061-070/day062/coffee-and-wifi/static/css/styles.css: -------------------------------------------------------------------------------- 1 | /* This CSS file will need to be added to the styling of 2 | your web pages for the styles to be rendered. */ 3 | 4 | body { 5 | background-color: #333; 6 | color: white; 7 | } 8 | 9 | a { 10 | color: #ffc107; 11 | } 12 | 13 | .jumbotron { 14 | display: flex; 15 | align-items: center; 16 | margin: 0; 17 | height: 100vh; 18 | color: white; 19 | background-color: #333; 20 | } 21 | 22 | .space-above { 23 | margin-top: 20px; 24 | padding-top: 20px; 25 | } 26 | -------------------------------------------------------------------------------- /days061-070/day062/coffee-and-wifi/templates/add.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block styles %} 5 | {{ super() }} 6 | 7 | {% endblock %} 8 | 9 | {% block title %}Add A New Cafe{% endblock %} 10 | 11 | {% block content %} 12 |Welcome, {{ form.username.data }}!
11 | 12 |13 |25 | 26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /days061-070/day062/coffee-and-wifi/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | 3 | {% block styles %} 4 | {{ super() }} 5 | 6 | {% endblock %} 7 | 8 | {% block title %}Coffee and Wifi{% endblock %} 9 | 10 | {% block content %} 11 |14 |24 |15 | 16 |23 |Add a new cafe into the database
17 | 18 | {{ wtf.quick_form(form) }} 19 | 20 | 21 | 22 |12 |20 | 21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /days061-070/day062/img/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day062/img/demo.gif -------------------------------------------------------------------------------- /days061-070/day063/README.MD: -------------------------------------------------------------------------------- 1 | # Day 63 - Bookshelf Website Project: 2 | 3 | - Simple single-user CRUD app. 4 | - Built a website to track your virtual bookshelf. 5 | - Developed a custom SQLite database to store the data. 6 | 7 | ## Demo: 8 | 9 |  -------------------------------------------------------------------------------- /days061-070/day063/bookshelf/backend/books-library.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day063/bookshelf/backend/books-library.sqlite -------------------------------------------------------------------------------- /days061-070/day063/bookshelf/backend/forms.py: -------------------------------------------------------------------------------- 1 | from flask_wtf import FlaskForm 2 | from wtforms import StringField, SubmitField, SelectField, IntegerField 3 | from wtforms.validators import DataRequired, URL 4 | 5 | class AddBookForm(FlaskForm): 6 | name = StringField('Book Name', validators=[DataRequired()]) 7 | 8 | author = StringField("Author", validators=[DataRequired()]) 9 | 10 | rating = IntegerField("Rating (1 - 10)", validators=[DataRequired()]) 11 | 12 | icon = StringField("Book Icon URL") 13 | 14 | submit = SubmitField('Submit') 15 | 16 | class EditBookForm(FlaskForm): 17 | title = StringField('Book Name', validators=[DataRequired()]) 18 | 19 | author = StringField("Author", validators=[DataRequired()]) 20 | 21 | rating = IntegerField("Rating (1 - 10)", validators=[DataRequired()]) 22 | 23 | icon = StringField("Book Icon URL") 24 | 25 | submit = SubmitField('Submit') 26 | 27 | -------------------------------------------------------------------------------- /days061-070/day063/bookshelf/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool] 2 | [tool.poetry] 3 | authors = ["Your Name13 |19 |☕️ Coffee & Wifi 💻
14 |Want to work in a cafe but need power and wifi?
15 |
16 |You've found the right place! Checkout my collection of cafes with data on power socket availability, wifi speed and coffee quality.
17 | Show Me! 18 |"] 4 | name = "root" 5 | version = "0.0.0" 6 | description="flask template" 7 | [tool.poetry.dependencies] 8 | flask = "==1.0.2" 9 | python = "^3.8" 10 | -------------------------------------------------------------------------------- /days061-070/day063/bookshelf/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==1.0.2 2 | flask 3 | flask_sqlalchemy -------------------------------------------------------------------------------- /days061-070/day063/bookshelf/templates/add.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block title %}Add Book{% endblock %} 5 | 6 | {% block content %} 7 | 8 |21 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day063/bookshelf/templates/edit.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block title %}Edit Book{% endblock %} 5 | 6 | {% block content %} 7 |9 |20 |10 | 11 |19 |Add a New Book to Your Library:
12 | 13 | {{ wtf.quick_form(form) }} 14 | 15 |
16 | 17 | 18 |8 |21 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day063/bookshelf/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |9 |20 |10 | 11 |19 |Editing Existing Book:
12 | 13 | {{ wtf.quick_form(form) }} 14 | 15 |
16 | 17 | 18 |Library 6 | 7 | 8 |My Library
9 | {% if books|length > 0 %} 10 |11 | {% for book in books %} 12 |
15 | {% else %} 16 |- Edit - {{ book['title'] }} - {{ book['author'] }} - {{ book['rating'] }}/10 - Delete Book
13 | {% endfor %} 14 |Libary is empty.
17 | {% endif %} 18 | 19 | Add New Book 20 | 21 | -------------------------------------------------------------------------------- /days061-070/day063/img/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day063/img/demo.gif -------------------------------------------------------------------------------- /days061-070/day064/README.md: -------------------------------------------------------------------------------- 1 | # Day 64 Project - My Top 10 Movies Website 2 | 3 | ## Notable Features: 4 | 5 | - Full CRUD 6 | - Search for movies using [The Movie Database](https://www.themoviedb.org/documentation/api?language=en-US) API integration 7 | - Pagination (WIP) 8 | - Sqlite database accessed using SQLAlchemy 9 | 10 | ## Demo: 11 | 12 | ### Home Page & Delete Movie from Database 13 |  14 | 15 | ### Edit Movie 16 |  17 | 18 | ### Add Movie 19 |  20 | 21 | ## Local Setup: 22 | 23 | 1. cd into the /movie-project directory 24 | 25 | 2. Install the package requirements with `pip install -r requirements.txt` 26 | 27 | 3. Run the Flask app with `python3 server.py` -------------------------------------------------------------------------------- /days061-070/day064/img/edit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day064/img/edit.gif -------------------------------------------------------------------------------- /days061-070/day064/img/index.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day064/img/index.gif -------------------------------------------------------------------------------- /days061-070/day064/img/new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day064/img/new.gif -------------------------------------------------------------------------------- /days061-070/day064/movie-project/backend/forms.py: -------------------------------------------------------------------------------- 1 | from tokenize import String 2 | from flask_wtf import FlaskForm 3 | from wtforms import StringField, SubmitField, SelectField, FloatField 4 | from wtforms.validators import DataRequired 5 | 6 | 7 | class EditMovieRatingForm(FlaskForm): 8 | rating = FloatField('Your Rating (0 - 10, e.g. 7.5)', validators=[DataRequired()]) 9 | 10 | review = StringField('Your Review', validators=[DataRequired()]) 11 | 12 | submit = SubmitField('Submit') 13 | 14 | class AddMovieForm(FlaskForm): 15 | pass 16 | 17 | class SearchMovieForm(FlaskForm): 18 | title = StringField('Movie Title:', validators=[DataRequired()]) 19 | 20 | submit = SubmitField('Search') -------------------------------------------------------------------------------- /days061-070/day064/movie-project/backend/movies.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day064/movie-project/backend/movies.sqlite -------------------------------------------------------------------------------- /days061-070/day064/movie-project/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask 2 | Flask-WTF 3 | Flask-SQLAlchemy 4 | Flask-Bootstrap 5 | python-dotenv 6 | requests -------------------------------------------------------------------------------- /days061-070/day064/movie-project/templates/add.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block styles %} 5 | {{ super() }} 6 | 7 | 8 | 9 | {% endblock %} 10 | 11 | {% block title %}Add Movie{% endblock %} 12 | 13 | {% block content %} 14 |15 |18 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day064/movie-project/templates/edit.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block styles %} 5 | {{ super() }} 6 | 7 | 8 | 9 | {% endblock %} 10 | 11 | {% block title %}Edit Movies{% endblock %} 12 | 13 | {% block content %} 14 |Search for a Movie
16 | {{ wtf.quick_form(form) }} 17 |15 |19 |Movie Title
16 |Edit Movie Rating
17 | {{ wtf.quick_form(form) }} 18 |
20 | 21 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day064/movie-project/templates/select.html: -------------------------------------------------------------------------------- 1 | {% extends 'bootstrap/base.html' %} 2 | {% import "bootstrap/wtf.html" as wtf %} 3 | 4 | {% block styles %} 5 | {{ super() }} 6 | 7 | 8 | 9 | {% endblock %} 10 | 11 | {% block title %}Select Movie{% endblock %} 12 | 13 | {% block content %} 14 |15 |24 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day066/RESTful-API-cafe/cafes.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day066/RESTful-API-cafe/cafes.sqlite -------------------------------------------------------------------------------- /days061-070/day066/RESTful-API-cafe/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Select Movie
16 | 17 | {% for movie in movies %} 18 | 21 | {% endfor %} 22 | 23 |Cafe&Wifi API 6 | 7 | 8 |Welcome to the Cafe & Wifi API
9 | 10 | -------------------------------------------------------------------------------- /days061-070/day067/README.md: -------------------------------------------------------------------------------- 1 | # Upgrades added to progress on blog site from [previous day059](../../days051-060/day059/Harrisons-Blog) -------------------------------------------------------------------------------- /days061-070/day068/README.md: -------------------------------------------------------------------------------- 1 | ## Day 68 Overview: 2 | 3 | - Created a full authentication workflow using Flask and Flask_Login 4 | - Learned about password hashing and salting using the Werkzeug package 5 | - Created notification banners for failed login attempts 6 | 7 | ## Run Locally: 8 | 9 | ```bash 10 | cd/days061-070/day068/flask-auth 11 | 12 | pip install -r requirements.txt 13 | 14 | python3 main.py 15 | ``` 16 | 17 | Then goto http://127.0.0.1:5000/ -------------------------------------------------------------------------------- /days061-070/day068/flask-auth/requirements.txt: -------------------------------------------------------------------------------- 1 | click==7.1.2 2 | dominate==2.5.2 3 | Flask==1.1.2 4 | Flask-Bootstrap==3.3.7.1 5 | Flask-Login==0.5.0 6 | Flask-SQLAlchemy==2.4.4 7 | Flask-WTF==0.14.3 8 | itsdangerous==1.1.0 9 | Jinja2==2.11.2 10 | MarkupSafe==1.1.1 11 | SQLAlchemy==1.3.20 12 | visitor==0.1.3 13 | Werkzeug==1.0.1 14 | WTForms==2.3.3 15 | -------------------------------------------------------------------------------- /days061-070/day068/flask-auth/static/files/cheat_sheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day068/flask-auth/static/files/cheat_sheet.pdf -------------------------------------------------------------------------------- /days061-070/day068/flask-auth/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 4 | 5 |15 | 16 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day068/flask-auth/templates/login.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 4 |Flask Authentication
6 | 7 | {% if current_user.is_authenticated %} 8 |Your are currently logged in as {{ current_user.name }} 9 | {% else %} 10 | Login 11 | Register 12 | {% endif %} 13 | 14 |
5 |13 | 14 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day068/flask-auth/templates/register.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 4 |Login
6 | 7 | 12 |5 |13 | 14 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day068/flask-auth/templates/secrets.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | {% block content %} 3 | 4 |Register
6 | 12 |5 |8 | {% endblock %} -------------------------------------------------------------------------------- /days061-070/day068/flask-auth/users.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days061-070/day068/flask-auth/users.sqlite -------------------------------------------------------------------------------- /days061-070/day069/README.md: -------------------------------------------------------------------------------- 1 | # Changes were made directly to the blog project on day 59. 2 | 3 | ## [SEE HERE](../../days051-060/day059/) -------------------------------------------------------------------------------- /days061-070/day070/README.md: -------------------------------------------------------------------------------- 1 | ## [SEE HERE](https://github.com/hschickdevs/personal-developer-blog) -------------------------------------------------------------------------------- /days071-080/day076/image/yummy_macarons.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days071-080/day076/image/yummy_macarons.jpg -------------------------------------------------------------------------------- /days071-080/day079/data/annual_deaths_by_clinic.csv: -------------------------------------------------------------------------------- 1 | year,births,deaths,clinic 2 | 1841,3036,237,clinic 1 3 | 1842,3287,518,clinic 1 4 | 1843,3060,274,clinic 1 5 | 1844,3157,260,clinic 1 6 | 1845,3492,241,clinic 1 7 | 1846,4010,459,clinic 1 8 | 1841,2442,86,clinic 2 9 | 1842,2659,202,clinic 2 10 | 1843,2739,164,clinic 2 11 | 1844,2956,68,clinic 2 12 | 1845,3241,66,clinic 2 13 | 1846,3754,105,clinic 2 14 | -------------------------------------------------------------------------------- /days081-090/day081/README.md: -------------------------------------------------------------------------------- 1 | ## Day 81 Course Assignment: Text to Morse Code Coverter 2 | 3 | ### See the [Project](./text-to-morse-project/) in ./text-to-morse-project/ -------------------------------------------------------------------------------- /days081-090/day081/text-to-morse-project/main.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | 4 | db_location = os.path.join(os.getcwd(), 'morse_db.json') 5 | 6 | def text_to_morse(user_message, database_location) -> str: 7 | with open(database_location) as infile: 8 | morse_db = json.load(infile) 9 | 10 | morsed_message = "" 11 | for char in user_message.lower(): 12 | try: 13 | morsed_message += morse_db[char] 14 | except KeyError: 15 | morsed_message += char 16 | 17 | return morsed_message 18 | 19 | 20 | if __name__ == "__main__": 21 | user_message = input('Enter message to be converted to morse code:\n') 22 | print(text_to_morse(user_message=user_message, database_location=db_location)) 23 | -------------------------------------------------------------------------------- /days081-090/day081/text-to-morse-project/morse_db.json: -------------------------------------------------------------------------------- 1 | { 2 | "0": "----- ", 3 | "1": ".---- ", 4 | "2": "..--- ", 5 | "3": "...-- ", 6 | "4": "....- ", 7 | "5": "..... ", 8 | "6": "-.... ", 9 | "7": "--... ", 10 | "8": "---.. ", 11 | "9": "----. ", 12 | "a": ".- ", 13 | "b": "-... ", 14 | "c": "-.-. ", 15 | "d": "-.. ", 16 | "e": ". ", 17 | "f": "..-. ", 18 | "g": "--. ", 19 | "h": ".... ", 20 | "i": ".. ", 21 | "j": ".--- ", 22 | "k": "-.- ", 23 | "l": ".-.. ", 24 | "m": "-- ", 25 | "n": "-. ", 26 | "o": "--- ", 27 | "p": ".--. ", 28 | "q": "--.- ", 29 | "r": ".-. ", 30 | "s": "... ", 31 | "t": "- ", 32 | "u": "..- ", 33 | "v": "...- ", 34 | "w": ".-- ", 35 | "x": "-..- ", 36 | "y": "-.-- ", 37 | "z": "--.. ", 38 | ".": ".-.-.- ", 39 | ",": "--..-- ", 40 | "?": "..--.. ", 41 | "!": "-.-.-- ", 42 | "-": "-....- ", 43 | "/": "-..-. ", 44 | "@": ".--.-. ", 45 | "(": "-.--. ", 46 | ")": "-.--.- ", 47 | " ": "/ " 48 | } -------------------------------------------------------------------------------- /days081-090/day082/README.md.md: -------------------------------------------------------------------------------- 1 | ## Day 82 Course Assignment: Portfolio Website 2 | 3 | _A website to show off my skills and the projects that I've built._ 4 | 5 | ___ 6 | 7 | ### See my portfolio on [GitHub](https://github.com/hschickdevs) 8 | 9 | ### Also see my minimalistic personal websitee [here](https://github.com/hschickdevs/personal-site) -------------------------------------------------------------------------------- /days081-090/day083/README.md: -------------------------------------------------------------------------------- 1 | ## Day 83 Course Assignment: Tic Tac Toe 2 | 3 | _Build a CLI version of the Tic Tac Toe game_ -------------------------------------------------------------------------------- /days081-090/day084/Markit/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days081-090/day084/Markit/app_icon.png -------------------------------------------------------------------------------- /days081-090/day084/Markit/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days081-090/day084/Markit/demo.png -------------------------------------------------------------------------------- /days081-090/day084/Markit/log_client.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | class Logger: 5 | """Custom logger class instead of using the logging module (no benefit or loss just preference)""" 6 | def __init__(self, output_dir=None): 7 | self.log = "" 8 | self.output_dir = output_dir 9 | 10 | def update_log(self, event): 11 | self.log += f"\n> {event}\n" 12 | self.save_log() 13 | print(event) 14 | 15 | def save_log(self): 16 | with open(os.path.join(self.output_dir, 'program_log.txt'), 'w') as log: 17 | log.write(self.log) 18 | -------------------------------------------------------------------------------- /days081-090/day084/Markit/markit_project_overview.txt: -------------------------------------------------------------------------------- 1 | WE Project Outline: 2 | 3 | 1. In the GUI, the user is prompted for either a single image or a directory of images to append the watermark. 4 | 5 | 2. The GUI prompts the user to upload the watermark image to be appended to the images. 6 | 7 | 3. The user selects the desired location of the watermark on the image. And (maybe) can use a sliding bar to select transparency. 8 | 9 | 4. The user selected the desired output location for the modified images. 10 | 11 | 5. The user can click 'preview' to see a preview of the image with the watermark once all inputs are satisfied. 12 | 13 | 6. Once the user clicks 'run', the program iterates through each image and adds the watermark using Pillow, or if an error occurs it reports the error to the logger. 14 | (Error conditions: if the image is smaller than the watermark on the x or the y, if the image is not a supported filetype.) 15 | 16 | 7. Once the program is finished, the user can find the successful images in the selected output folder. 17 | -------------------------------------------------------------------------------- /days081-090/day084/Markit/requirements.txt: -------------------------------------------------------------------------------- 1 | Pillow==8.3.2 2 | PySimpleGUI==4.49.0 3 | -------------------------------------------------------------------------------- /days081-090/day084/Markit/valid_filetypes.txt: -------------------------------------------------------------------------------- 1 | BMP 2 | DDS 3 | DIB 4 | EPS 5 | GIF 6 | ICNS 7 | ICO 8 | IM 9 | JPEG 10 | MSP 11 | PCX 12 | PNG 13 | APNG 14 | PPM 15 | SGI 16 | SPIDER 17 | TGA 18 | TIFF 19 | XBM 20 | BLP 21 | CUR 22 | DCX 23 | FLI 24 | FLC 25 | FPX 26 | FTEX 27 | GBR 28 | GD 29 | IMT 30 | IPTC 31 | NAA 32 | MCIDAS 33 | MIC 34 | MPO 35 | PCD 36 | PIXAR 37 | PSD 38 | WAL 39 | WMF 40 | XPM 41 | PALM 42 | PDF 43 | BUFR 44 | FITS 45 | GRIB 46 | HDF5 47 | MPEG -------------------------------------------------------------------------------- /days081-090/day084/README.md: -------------------------------------------------------------------------------- 1 |  2 | # Markit - Image Watermarking 3 | 4 | ### Hi there! Thanks for checking out my `Markit` project. 5 | ### `Markit` is a Python program that makes watermarking images easy. 6 | ### This project was a completely self-written and guided course assignment in the 100 Days of Code course on Udemy. 7 | ### In this simple program, I mainly aim to showcase my understanding of class structure, error handling, GUIs using PySimpleGUI, and the PIL/Pillow library. 8 | ### If you'd like to try this program for yourself, download the 'Markit' folder and install the pipreqs from 'requirements.txt'. 9 | 10 | ## Software Screenshot: 11 | 12 |  -------------------------------------------------------------------------------- /days081-090/day085/README.md: -------------------------------------------------------------------------------- 1 | # Tactype - CLI Typing Test 2 | 3 | Using Tactype, you can test your typing speed and accuracy. 4 | 5 | It is a simple CLI tool that can be used to test your typing speed and accuracy. It is written in Python and uses the `curses` module to display the text to be typed. 6 | 7 | ## Local Setup Instructions: 8 | 9 | 1. Navigate to the /Tactype directory 10 | 11 | 2. Run the following command to install the required dependencies: 12 | 13 | ```bash 14 | pip install -r requirements.txt 15 | ``` 16 | 17 | > **Note:** If you are using a UNIX-based system, you can uninstall the `windows-curses` package by running the following command: `pip uninstall windows-curses` 18 | 19 | 3. Run the following command to start the program: 20 | 21 | ```bash 22 | python main.py 23 | ``` 24 | 25 | ## Software Demo: 26 | 27 |  -------------------------------------------------------------------------------- /days081-090/day085/Tactype/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days081-090/day085/Tactype/demo.gif -------------------------------------------------------------------------------- /days081-090/day085/Tactype/requirements.txt: -------------------------------------------------------------------------------- 1 | windows-curses 2 | random-word -------------------------------------------------------------------------------- /days081-090/day085/Tactype/tactype_overview.txt: -------------------------------------------------------------------------------- 1 | Resources: 2 | Random english word library: https://pypi.org/project/Random-Word/ -------------------------------------------------------------------------------- /days081-090/day086/Breakout/ball.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | 4 | class Ball(Turtle): 5 | 6 | def __init__(self): 7 | super().__init__() 8 | self.shape("square") 9 | self.color("blue") 10 | self.penup() 11 | self.goto(x=0, y=-280) 12 | self.x_move = 10 13 | self.y_move = 10 14 | self.move_speed = 0.1 15 | 16 | def move(self): 17 | new_x = self.xcor() + self.x_move 18 | new_y = self.ycor() + self.y_move 19 | self.goto(new_x, new_y) 20 | 21 | def bounce_y(self): 22 | self.y_move *= -1 23 | self.move_speed *= 0.9 24 | 25 | def bounce_x(self): 26 | self.x_move *= -1 27 | 28 | def reset_position(self): 29 | self.goto(0, -280) 30 | self.move_speed = 0.1 31 | self.bounce_y() 32 | -------------------------------------------------------------------------------- /days081-090/day086/Breakout/bricks.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | COLORS = ["green", "yellow", "orange"] 4 | 5 | 6 | class Bricks(Turtle): 7 | 8 | def __init__(self): 9 | super().__init__() 10 | self.all_bricks = [] 11 | self.hideturtle() 12 | 13 | def create_bricks(self): 14 | 15 | y = 100 16 | for color in COLORS: 17 | for row in range(2): 18 | x = -265 19 | y += 25 20 | while x < 300: 21 | 22 | new_brick = Turtle("square") 23 | new_brick.penup() 24 | new_brick.shapesize(stretch_wid=1, stretch_len=3) 25 | new_brick.color(color) 26 | new_brick.goto(x, y) 27 | self.all_bricks.append(new_brick) 28 | x += 65 29 | -------------------------------------------------------------------------------- /days081-090/day086/Breakout/paddle.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | 4 | class Paddle(Turtle): 5 | 6 | def __init__(self, position): 7 | super().__init__() 8 | self.create_paddle(position) 9 | 10 | def create_paddle(self, position): 11 | self.shape("square") 12 | self.penup() 13 | self.shapesize(stretch_wid=1, stretch_len=5) 14 | self.color("white") 15 | self.setpos(position) 16 | 17 | def left(self): 18 | new_x = self.xcor() - 20 19 | self.goto(new_x, self.ycor()) 20 | 21 | def right(self): 22 | new_x = self.xcor() + 20 23 | self.goto(new_x, self.ycor()) -------------------------------------------------------------------------------- /days081-090/day086/Breakout/scoreboard.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | 4 | class Scoreboard(Turtle): 5 | 6 | def __init__(self): 7 | super().__init__() 8 | self.color("white") 9 | self.penup() 10 | self.hideturtle() 11 | self.score = 0 12 | self.lives = 3 13 | self.update_scoreboard() 14 | 15 | def update_scoreboard(self): 16 | self.clear() 17 | self.goto(-200, 350) 18 | self.write(f"SCORE:{self.score}", align="center", font=("Courier", 30, "bold")) 19 | self.goto(180, 350) 20 | self.write(f"LIVES:{self.lives}", align="center", font=("Courier", 30, "bold")) 21 | 22 | def update_lives(self): 23 | self.lives -= 1 24 | self.update_scoreboard() 25 | 26 | def point(self): 27 | self.score += 1 28 | self.update_scoreboard() 29 | 30 | def game_over(self): 31 | self.goto(0, 0) 32 | self.write("GAME OVER", align="center", font=("Courier", 30, "bold")) -------------------------------------------------------------------------------- /days081-090/day086/README.md: -------------------------------------------------------------------------------- 1 | # Day 86 - Breakout Python: The Famous Arcade Game 2 | 3 | ## Concepts Practised 4 | - Create a Paddle that responds to Key Presses 5 | - Write the Ball Class and Make the Ball Move 6 | - Add the Ball Bouncing Logic 7 | - How to Detect Collisions with the Paddle 8 | - How to Detect when the Ball goes Out of Bounds 9 | - Score Keeping and Changing the Ball Speed 10 | 11 | ## Run Locally: 12 | 13 | 1. CD into the ./Breakout directory 14 | 15 | 2. Run the following command in the terminal to play the game: 16 | 17 | ```bash 18 | python main.py 19 | ``` 20 | 21 | ## Breakout Demo 22 |  23 | -------------------------------------------------------------------------------- /days081-090/day087/README.md: -------------------------------------------------------------------------------- 1 | # Day 87 Course Assignment: Cafe & Wifi Website: 2 | 3 | ## See [Day 62](../../days061-070/day062) 4 | -------------------------------------------------------------------------------- /days081-090/day088/README.md: -------------------------------------------------------------------------------- 1 | # Day 88 - To Do Agenda App 2 | 3 | ## Concepts Practised 4 | - Create a Web Server with Flask 5 | - Use the Command Line on Windows and Mac 6 | - `__name__` and `__main__` : Special Attributes built into Python 7 | - Python Decorator Functions and the `@` Syntax 8 | - Flask URL Paths and the Flask Debugger 9 | - Rendering HTML Elements with Flask 10 | - Use Python Decorators to Style HTML Tags 11 | - Decorators with `*args` and `**kwargs` 12 | Create a Python Decorator 13 | 14 | ## Run Locally: 15 | 16 | 1. CD into the project folder: `./todo-app` 17 | 18 | 2. Run `pip install -r requirements.txt` to install the dependencies 19 | 20 | 3. Run the flask app with `python main.py` 21 | 22 | ## To Do App Demo 23 |Welcome, {{ name }}!
6 | Download Your File 7 |24 | -------------------------------------------------------------------------------- /days081-090/day088/todo-app/db.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days081-090/day088/todo-app/db.sqlite -------------------------------------------------------------------------------- /days081-090/day088/todo-app/requirements.txt: -------------------------------------------------------------------------------- 1 | flask 2 | flask-sqlalchemy -------------------------------------------------------------------------------- /days081-090/day089/README.md: -------------------------------------------------------------------------------- 1 | ## Day 89 Course Assignment: Disappearing Text Writing App 2 | 3 | _Build an online writing app where if you stop typing, work work will disappear_ 4 | 5 | # Disappearing Text Webapp: 6 | 7 | ## Overview: 8 | 9 | 10 | Once the user starts typing, the JavaScript event listeners are initiated. 11 | 12 | If the user stops typing for 5 seconds, a warning message will appear, and if the user continues to not type for another 5 seconds, their written text will disappear. 13 | 14 | This app is served using Flask, and the front-end was created using HTML, CSS, Bootstrap and JavaScript. 15 | 16 | ## Local Setup: 17 | 18 | 1. CD into the `./webapp` directory 19 | 20 | 2. Install the package requirements using `pip install -r requirements.txt` 21 | 22 | 3. Run the app using `python app.py` 23 | 24 | ## App Demo: 25 | 26 |  -------------------------------------------------------------------------------- /days081-090/day089/webapp/app.py: -------------------------------------------------------------------------------- 1 | from flask import Flask, render_template 2 | 3 | app = Flask(__name__) 4 | 5 | 6 | @app.route('/') 7 | def home(): 8 | return render_template("index.html") 9 | 10 | 11 | if __name__ == "__main__": 12 | app.run(debug=True) 13 | -------------------------------------------------------------------------------- /days081-090/day089/webapp/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days081-090/day089/webapp/demo.gif -------------------------------------------------------------------------------- /days081-090/day090/README.md: -------------------------------------------------------------------------------- 1 | ## Day 90 Course Assignment: Convert PDF to Audiobook 2 | 3 | _Write a Python script that takes a PDF file and converts it to speech_ 4 | 5 | ## Concepts Practised 6 | 7 | - Creating Windows and Labels with Tkinter 8 | - Use grid() to complete the User Interface 9 | - Use tkinter filedialog to select a PDF file 10 | - Use gTTS to convert text to speech 11 | 12 | ## Text to Speech 13 | 14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /days081-090/day090/requirements.txt: -------------------------------------------------------------------------------- 1 | gTTS 2 | tika -------------------------------------------------------------------------------- /days091-100/day091/README.md: -------------------------------------------------------------------------------- 1 | ## Day 91 Course Assignment: Image to Color List 2 | 3 | _An application that finds the most common colours in an uploaded image_ 4 | 5 | ## Concepts Practised 6 | - Creating Windows and Labels with Tkinter 7 | - Use grid() to complete the User Interface 8 | - Use tkinter filedialog to select PDF a file 9 | - Convert RGB Code to Color Name 10 | 11 | ## Project Description 12 | 13 | This project is a simple GUI application that converts an image to a list of colors. 14 | 15 | The user can select an image file and the application will display the colors in the image in a list. 16 | 17 | The application GUI is built with Tkinter, and the image color extraction is done with the Pillow library and numpy. 18 | 19 | ## Image to Color List 20 |  21 | -------------------------------------------------------------------------------- /days091-100/day092/webscraper/requirements.txt: -------------------------------------------------------------------------------- 1 | selenium 2 | webdriver-manager 3 | bs4 4 | aiohttp -------------------------------------------------------------------------------- /days091-100/day093/README.md: -------------------------------------------------------------------------------- 1 | ## Day 93 Course Assignment: Automate the Google Dinosaur Game 2 | 3 | _Write Python code to automate playing the Google Dinosaur Game_ 4 | 5 | # Google Dinosaur Game Bot 6 | 7 | ## Concepts Practised 8 | 9 | - Finding and Selecting Particular Pixcels and RGB with PyAutoGUI 10 | - Use PyWin32 for Fast Keyboard Press Response 11 | - Modify Logic to Adjust with Faster Speed 12 | 13 | ## Google Dinosaur Game Bot 14 | 15 |  16 | -------------------------------------------------------------------------------- /days091-100/day094/README.md: -------------------------------------------------------------------------------- 1 | ## Day 94 Course Assignment: Space Invaders 2 | 3 | _Build the classic arcade game where you shoot down alien ships._ 4 | 5 | # Space Invaders 6 | 7 | ## Concepts Practised 8 | - Make a 2D Game With PyGame 9 | - Draw (blit) items on the screen 10 | - Organized Use of Classes 11 | - Handling User Input (Player's Actions) 12 | - Implementing Event Loops 13 | 14 | ## Play the Game Locally: 15 | 16 | 1. CD into the `./Space-Invaders` directory 17 | 18 | 2. Install the required packages using `pip install -r requirements.txt` 19 | 20 | 3. Run the game using `python main.py` 21 | 22 | ## Space Invaders 23 |  24 | -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/assets/background-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day094/Space-Invaders/assets/background-black.png -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/assets/pixel_laser_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day094/Space-Invaders/assets/pixel_laser_blue.png -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/assets/pixel_laser_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day094/Space-Invaders/assets/pixel_laser_green.png -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/assets/pixel_laser_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day094/Space-Invaders/assets/pixel_laser_red.png -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/assets/pixel_laser_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day094/Space-Invaders/assets/pixel_laser_yellow.png -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/assets/pixel_ship_blue_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day094/Space-Invaders/assets/pixel_ship_blue_small.png -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/assets/pixel_ship_green_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day094/Space-Invaders/assets/pixel_ship_green_small.png -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/assets/pixel_ship_red_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day094/Space-Invaders/assets/pixel_ship_red_small.png -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/assets/pixel_ship_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day094/Space-Invaders/assets/pixel_ship_yellow.png -------------------------------------------------------------------------------- /days091-100/day094/Space-Invaders/requirements.txt: -------------------------------------------------------------------------------- 1 | pygame -------------------------------------------------------------------------------- /days091-100/day095/README.md: -------------------------------------------------------------------------------- 1 | ## Day 95 Assignment: Custom API Based Website 2 | 3 | _Build a custom website using an API that you find interesting_ 4 | 5 | # Portfolio Analytics Dashboard 6 | 7 | View the official repository here: *https://github.com/hschickdevs/Rebsamen-Portfolio-Analytics* 8 | 9 | ## Overview 10 | 11 | Using the skills that I've learned in the course, I was able to build a dashboard that tracks the holdings and performance of the student managed investment portfolio at my college. 12 | 13 | ## Technologies Used 14 | 15 | This _web application_ was built completely with Python (no coding in HTML, JS, or CSS). In order to accomplish this, I used the following Python packages: 16 | - [`Streamlit`](https://streamlit.io/) framework to simplify the process of building a web data dashboard. 17 | - `Pandas` to view and manipulate the data. 18 | 19 | In order to pull stock data, I connected to the [Finnhub API](https://finnhub.io/). 20 | 21 | ## Software Demo 22 | 23 |  -------------------------------------------------------------------------------- /days091-100/day095/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day095/demo.gif -------------------------------------------------------------------------------- /days091-100/day096/Online-Shop/public/cancel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
Checkout canceled 5 | 6 | 7 | 8 |9 | 12 | 13 | -------------------------------------------------------------------------------- /days091-100/day096/Online-Shop/public/checkout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Forgot to add something to your cart? Shop around then come back to pay!
10 | 11 |Basic Product Page 5 | 6 | 7 | 8 | 9 | 10 |11 | 22 | 23 | -------------------------------------------------------------------------------- /days091-100/day096/Online-Shop/public/success.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |12 |18 | 21 |13 |
14 |17 |Basic Product Page
15 |$49.99
16 |Thanks for your order! 5 | 6 | 7 | 8 |9 | 13 | 14 | -------------------------------------------------------------------------------- /days091-100/day096/Online-Shop/requirements.txt: -------------------------------------------------------------------------------- 1 | certifi==2021.5.30 2 | chardet==4.0.0 3 | Click==8.0.1 4 | Flask==2.0.1 5 | idna==3.2 6 | itsdangerous==2.0.1 7 | Jinja2==3.0.1 8 | MarkupSafe==2.0.1 9 | requests==2.26.0 10 | stripe==3.0.0 11 | toml==0.10.2 12 | Werkzeug==2.0.1 13 | Werkzeug==2.0.1 -------------------------------------------------------------------------------- /days091-100/day096/README.md: -------------------------------------------------------------------------------- 1 | ## Day 96 Course Assignment: An Online Shop 2 | 3 | _An eCommerce website with payment processing_ 4 | 5 | # A Basic Online Shop 6 | 7 | ## Concepts Practised 8 | - Create a Web Server with Flask 9 | - URL Building with Flask 10 | - Flask URL Paths and the Flask Debugger 11 | - Python Decorator Functions and the `@` Syntax 12 | - Stripe API 13 | 14 | ## An Online Shop 15 |  16 | -------------------------------------------------------------------------------- /days091-100/day097/data/portfolios_input.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day097/data/portfolios_input.xlsx -------------------------------------------------------------------------------- /days091-100/day097/img/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day097/img/demo.png -------------------------------------------------------------------------------- /days091-100/day097/portfolio_report/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day097/portfolio_report/__init__.py -------------------------------------------------------------------------------- /days091-100/day097/portfolio_report/_config.py: -------------------------------------------------------------------------------- 1 | # Finnhub Setup 2 | RATE_LIMIT = (60, 60) # (calls per period (seconds), period (seconds)) 3 | 4 | # Emails Client Setup: 5 | SMTP_SERVER_ADDRESS = "smtp.mail.yahoo.com" 6 | SMTP_SERVER_PORT = 465 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | # STATIC SETTINGS - IGNORE: 20 | REQUIRED_ENVARS = ["FINNHUB_APIKEY", "FROM_EMAIL", "FROM_EMAIL_PASSWORD"] 21 | MANDATORY_SHEET_COLUMNS = ["Symbol", "Entry Price", "Shares"] -------------------------------------------------------------------------------- /days091-100/day097/portfolio_report/assets/email_template.html: -------------------------------------------------------------------------------- 1 |10 | We appreciate your business! Your payment has gone through successfully! 11 |
12 |2 |5 | -------------------------------------------------------------------------------- /days091-100/day097/portfolio_report/data.py: -------------------------------------------------------------------------------- 1 | from os.path import splitext 2 | 3 | from ._config import MANDATORY_SHEET_COLUMNS 4 | 5 | import pandas as pd 6 | 7 | 8 | def load_portfolio(path: str) -> list[list[str, pd.DataFrame]]: 9 | """ 10 | Attempts to load the portfolio input and checks that all required parameters are satisfied. 11 | 12 | :param path: The path to the portfolio data spreadsheet 13 | :return: List containing tuple pairs of sheetname (portfolio name), and portfolio dataframe 14 | """ 15 | output = [] 16 | if splitext(path)[-1] == ".csv": 17 | output.append(("Portfolio", pd.read_csv(path))) 18 | else: 19 | xls = pd.ExcelFile(path) 20 | for sheet in xls.sheet_names: 21 | output.append([sheet, pd.read_excel(path, sheet_name=sheet)]) 22 | 23 | # Assert mandatory columns are set 24 | for sheet in output: 25 | assert all(col in sheet[1].columns for col in MANDATORY_SHEET_COLUMNS), \ 26 | f"Sheet '{sheet[0]}' missing mandatory column. ({MANDATORY_SHEET_COLUMNS})" 27 | return output 28 | 29 | -------------------------------------------------------------------------------- /days091-100/day097/requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | finnhub-python 3 | pandas 4 | openpyxl 5 | ratelimit 6 | pandas_market_calendars 7 | apscheduler -------------------------------------------------------------------------------- /days091-100/day098/README.md: -------------------------------------------------------------------------------- 1 | ## Day 98 Course Assignment: Analyse and Visualise the Space Race 2 | 3 | _Use space mission data from 1957 onwards to analyse and visualise trends over time_ 4 | 5 | # Analyzing and Visualizing the Space Race since 1957 6 | 7 | ## Concepts Practiced 8 | - Multi-Line Charts with Matplotib 9 | - Removing NaN Values and Duplicates 10 | - Create Pie and Donut Charts 11 | - Grouped Bar Charts and Box Plots with Plotly 12 | 13 | ## Space Race Data 14 |Day of {date} Portfolio Report
3 |
4 |15 |
16 |
17 | -------------------------------------------------------------------------------- /days091-100/day099/README.md: -------------------------------------------------------------------------------- 1 | ## Day 99 Course Assignment: Analyse Deaths involving Police in the United States 2 | 3 | _Extract insights from combining US census data and the Washington Post's database on deaths by police in the United States_ 4 | 5 | # Day 99 - Analyzing Deaths Involving Police in the United States 6 | 7 | ## Concepts Practised 8 | - Removing NaN Values and Duplicates 9 | - Create Pie and Donut Charts 10 | - Grouped Bar Charts and Box Plots with Plotly 11 | - Data Cleaning: Working with Time Stamps 12 | 13 | ## Deaths Involving Police in the United States 14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /days091-100/day099/data/Deaths_by_Police_US.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day099/data/Deaths_by_Police_US.csv -------------------------------------------------------------------------------- /days091-100/day099/data/Median_Household_Income_2015.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day099/data/Median_Household_Income_2015.csv -------------------------------------------------------------------------------- /days091-100/day099/data/Pct_Over_25_Completed_High_School.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day099/data/Pct_Over_25_Completed_High_School.csv -------------------------------------------------------------------------------- /days091-100/day099/data/Pct_People_Below_Poverty_Level.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/days091-100/day099/data/Pct_People_Below_Poverty_Level.csv -------------------------------------------------------------------------------- /days091-100/day100/README.md: -------------------------------------------------------------------------------- 1 | ## Day 100 Course Assignment: Predict Earnings using Multivariable Regression 2 | 3 | _Use the famous National Longitudinal Survey of Youth 1997-2011 to run a Multivariable Regression to predict salaries. How are earnings determined and what does this imply from government policy?_ 4 | 5 | # Predicting Earnings using Multivariable Regression 6 | 7 | ## Concepts Practised 8 | - Filter on Multiple Conditions 9 | - Seaborn Data Visualisation: Bubble Charts 10 | - Plotting Linear Regressions with Seaborn 11 | - scikit-learn to Run Regression 12 | 13 | ## Predictied Earnings using Multivariable Regression 14 |
15 |
16 |
17 | -------------------------------------------------------------------------------- /gen.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | if __name__ == "__main__": 5 | print("Generating directory structure ...") 6 | for i in range(1, 100, 10): 7 | dir = f'days{i:03d}-{i + 9:03d}' 8 | print(i, dir) 9 | os.mkdir(dir) 10 | 11 | # Generate subfolders 12 | for j in range(i, i + 10): 13 | subdir = f'{dir}/day{j:03d}' 14 | print(j, subdir) 15 | os.mkdir(subdir) 16 | 17 | print("Done!") -------------------------------------------------------------------------------- /syllabus.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hschickdevs/100-Days-of-Code-Python/836e9848de18093c6c837ac2dae4bde7265c247a/syllabus.pdf --------------------------------------------------------------------------------