├── README.md ├── 028_Pomodoro ├── tomato.png └── main.py ├── 022_Pong ├── Deep Shadow.ttf ├── paddle.py ├── ball.py ├── scoreboard.py └── main.py ├── 018_HirstPainting ├── image.jpg └── main.py ├── 024_FileHandlingIntro ├── MailMerge │ ├── Input │ │ ├── Names │ │ │ └── invited_names.txt │ │ ├── .DS_Store │ │ └── Letters │ │ │ └── starting_letter.txt │ ├── Output │ │ ├── .DS_Store │ │ └── ReadyToSend │ │ │ ├── letter_for_Aang.txt │ │ │ ├── letter_for_Appa.txt │ │ │ ├── letter_for_Momo.txt │ │ │ ├── letter_for_Sokka.txt │ │ │ ├── letter_for_Toph.txt │ │ │ ├── letter_for_Zuko.txt │ │ │ ├── letter_for_Katara.txt │ │ │ └── letter_for_Uncle Iroh.txt │ └── Mail+Merge+Project+Start │ │ └── __MACOSX │ │ ├── Mail Merge Project Start │ │ ├── ._.DS_Store │ │ ├── Input │ │ │ ├── ._.DS_Store │ │ │ ├── ._Names │ │ │ ├── ._Letters │ │ │ ├── Names │ │ │ │ └── ._invited_names.txt │ │ │ └── Letters │ │ │ │ └── ._starting_letter.txt │ │ ├── Output │ │ │ ├── ._.DS_Store │ │ │ ├── ._ReadyToSend │ │ │ └── ReadyToSend │ │ │ │ └── ._example.txt │ │ ├── ._Input │ │ ├── ._Output │ │ └── ._main.py │ │ └── ._Mail Merge Project Start └── SnakeGameImproved │ ├── food.py │ ├── scoreboard.py │ ├── main.py │ └── snake.py ├── 025_StatesGame ├── blank_states_img.gif ├── states_to_learn.csv ├── 50_states.csv └── main.py ├── 017_QuizGame ├── question_model.py ├── main.py ├── quiz_brain.py └── data.py ├── Beginner_Projects ├── 011_Blackjack │ ├── __pycache__ │ │ └── art.cpython-310.pyc │ ├── art.py │ └── main.py ├── 013_Debugging │ └── debugging.txt ├── 001_Band_Name_Generator │ └── Band_Name_Generator.py ├── 002_Tip_Calculator │ └── Tip_Calculator.py ├── 012_Number_Guessing_Game │ ├── art.py │ └── main.py ├── 014_HigherLower │ ├── art.py │ ├── main.py │ └── game_data.py ├── 008_Caesar_Cipher │ ├── main.py │ ├── art.py │ └── cipher.py ├── 009_Silent_Auction │ ├── art.py │ └── main.py ├── 006_Maze_Solver │ └── Maze_Solver.py ├── 007_HangMan │ ├── main.py │ ├── hangman_art.py │ └── hangman_words.py ├── 005_Password_Generator │ └── Password_Generator.py ├── 010_Calculator │ ├── art.py │ └── main.py ├── 004_Rock-Paper-Scissors │ └── Rock_Paper_Scissors.py └── 003_Treasure_Island │ └── Treasure_Island.py ├── 020_Worm ├── Docu.md ├── main.py └── snake.py ├── 026_NATOalphabet ├── main.py └── nato_phonetic_alphabet.csv ├── 021_Snake ├── food.py ├── scoreboard.py ├── main.py └── snake.py ├── 019_Sketch&Race ├── EtchASketch.py └── Turtlerace.py ├── 023_TurtleCrossing ├── player.py ├── scoreboard.py ├── main.py └── car_manager.py ├── 015_CoffeeMachine ├── database.py └── main.py ├── 027_MilesConverter └── MilesToKilo.py └── 016_CoffeeMachine2 ├── coffee_maker.py ├── menu.py ├── main.py └── money_machine.py /README.md: -------------------------------------------------------------------------------- 1 | # Python-100-days-of-code 2 | Code written for the "100 Days of Code: Python" course 3 | -------------------------------------------------------------------------------- /028_Pomodoro/tomato.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/028_Pomodoro/tomato.png -------------------------------------------------------------------------------- /022_Pong/Deep Shadow.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/022_Pong/Deep Shadow.ttf -------------------------------------------------------------------------------- /018_HirstPainting/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/018_HirstPainting/image.jpg -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Input/Names/invited_names.txt: -------------------------------------------------------------------------------- 1 | Aang 2 | Zuko 3 | Appa 4 | Katara 5 | Sokka 6 | Momo 7 | Uncle Iroh 8 | Toph -------------------------------------------------------------------------------- /025_StatesGame/blank_states_img.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/025_StatesGame/blank_states_img.gif -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Input/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Input/.DS_Store -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Output/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Output/.DS_Store -------------------------------------------------------------------------------- /017_QuizGame/question_model.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class Question: 4 | 5 | def __init__(self, q_text, q_answer): 6 | self.text = q_text 7 | self.answer = q_answer 8 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/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 | Nirvs 8 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/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 | Nirvs 8 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/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 | Nirvs 8 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/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 | Nirvs 8 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/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 | Nirvs 8 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/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 | Nirvs 8 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/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 | Nirvs 8 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/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 | Nirvs 8 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Output/ReadyToSend/letter_for_Uncle Iroh.txt: -------------------------------------------------------------------------------- 1 | Dear Uncle Iroh, 2 | 3 | You are invited to my birthday this Saturday. 4 | 5 | Hope you can make it! 6 | 7 | Nirvs 8 | -------------------------------------------------------------------------------- /Beginner_Projects/011_Blackjack/__pycache__/art.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/Beginner_Projects/011_Blackjack/__pycache__/art.cpython-310.pyc -------------------------------------------------------------------------------- /Beginner_Projects/013_Debugging/debugging.txt: -------------------------------------------------------------------------------- 1 | This one's to log day 13. No project for this day 2 | but I did some basic debugging. 3 | Debuggers-> thonny, python-tutor 4 | stack overflow, rubber duck, etc etc -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx @ATTRxx -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Input/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx @ATTRxx -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Output/._.DS_Store: -------------------------------------------------------------------------------- 1 | Mac OS X  2Fx @ATTRxx -------------------------------------------------------------------------------- /020_Worm/Docu.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | Build-up for the snake game. 3 | 4 | Currently consists of a snake that moves around with the arrow keys. 5 | Checks implemented to prevent it from going back into itself, and turning properly. 6 | -------------------------------------------------------------------------------- /Beginner_Projects/001_Band_Name_Generator/Band_Name_Generator.py: -------------------------------------------------------------------------------- 1 | print("Welcome to Band Name Generator") 2 | city=input("What city did you grow up in?\n") 3 | pet=input("What is the name of your pet?\n") 4 | print("Your band name could be "+city+" "+pet) 5 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/._Mail Merge Project Start: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/._Mail Merge Project Start -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/._Input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/._Input -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/._Output: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/._Output -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/._main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/._main.py -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Input/._Names: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Input/._Names -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Input/._Letters: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Input/._Letters -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Output/._ReadyToSend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Output/._ReadyToSend -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Input/Names/._invited_names.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Input/Names/._invited_names.txt -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Output/ReadyToSend/._example.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Output/ReadyToSend/._example.txt -------------------------------------------------------------------------------- /024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Input/Letters/._starting_letter.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnarchistHoneybun/Python-100-days-of-code/HEAD/024_FileHandlingIntro/MailMerge/Mail+Merge+Project+Start/__MACOSX/Mail Merge Project Start/Input/Letters/._starting_letter.txt -------------------------------------------------------------------------------- /026_NATOalphabet/main.py: -------------------------------------------------------------------------------- 1 | import pandas 2 | 3 | data = pandas.read_csv("nato_phonetic_alphabet.csv") 4 | 5 | phonetic_dict= {row.letter: row.code for (index, row) in data.iterrows()} 6 | 7 | word = input("Enter a word: ").upper() 8 | output_list = [phonetic_dict[letter] for letter in word] 9 | print(output_list) 10 | -------------------------------------------------------------------------------- /Beginner_Projects/002_Tip_Calculator/Tip_Calculator.py: -------------------------------------------------------------------------------- 1 | print("Welcome to the tip calculator.") 2 | bill=float(input("What was the total bill? $")) 3 | tip=int(input("What percentage tip would you like to give? 10, 12, or 15? ")) 4 | people=int(input("How many people would split the bill?")) 5 | pers=(bill/people)*(1+tip/100) 6 | print(f"Each person should pay: {round(pers,2)}") -------------------------------------------------------------------------------- /026_NATOalphabet/nato_phonetic_alphabet.csv: -------------------------------------------------------------------------------- 1 | letter,code 2 | A,Alpha 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 -------------------------------------------------------------------------------- /Beginner_Projects/012_Number_Guessing_Game/art.py: -------------------------------------------------------------------------------- 1 | logo = """ 2 | / _ \_ _ ___ ___ ___ /__ \ |__ ___ /\ \ \_ _ _ __ ___ | |__ ___ _ __ 3 | / /_\/ | | |/ _ \/ __/ __| / /\/ '_ \ / _ \ / \/ / | | | '_ ` _ \| '_ \ / _ \ '__| 4 | / /_\\| |_| | __/\__ \__ \ / / | | | | __/ / /\ /| |_| | | | | | | |_) | __/ | 5 | \____/ \__,_|\___||___/___/ \/ |_| |_|\___| \_\ \/ \__,_|_| |_| |_|_.__/ \___|_| 6 | """ -------------------------------------------------------------------------------- /Beginner_Projects/014_HigherLower/art.py: -------------------------------------------------------------------------------- 1 | logo = """ 2 | __ ___ __ 3 | / / / (_)___ _/ /_ ___ _____ 4 | / /_/ / / __ `/ __ \/ _ \/ ___/ 5 | / __ / / /_/ / / / / __/ / 6 | /_/ ///_/\__, /_/ /_/\___/_/ 7 | / / /____/_ _____ _____ 8 | / / / __ \ | /| / / _ \/ ___/ 9 | / /___/ /_/ / |/ |/ / __/ / 10 | /_____/\____/|__/|__/\___/_/ 11 | """ 12 | 13 | vs = """ 14 | _ __ 15 | | | / /____ 16 | | | / / ___/ 17 | | |/ (__ ) 18 | |___/____(_) 19 | """ -------------------------------------------------------------------------------- /022_Pong/paddle.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | 4 | class Paddle(Turtle): 5 | 6 | def __init__(self, position): 7 | super().__init__() 8 | self.shape("square") 9 | self.color("white") 10 | self.shapesize(stretch_wid=5, stretch_len=1) 11 | self.penup() 12 | self.goto(position) 13 | 14 | def go_up(self): 15 | new_y = self.ycor() + 20 16 | self.goto(self.xcor(), new_y) 17 | 18 | def go_down(self): 19 | new_y = self.ycor() - 20 20 | self.goto(self.xcor(), new_y) 21 | -------------------------------------------------------------------------------- /Beginner_Projects/008_Caesar_Cipher/main.py: -------------------------------------------------------------------------------- 1 | import cipher 2 | import art 3 | print(art.logo) 4 | 5 | application_running=1 6 | 7 | while application_running==1: 8 | direction = input("Type 'encode' to encrypt, type 'decode' to decrypt:\n") 9 | text = input("Type your message:\n") 10 | shift = int(input("Type the shift number:\n")) 11 | cipher.caesar(text,shift,direction) 12 | rerun=input("Type 'yes' if you want to go again. Otherwise type 'no'.\n").lower() 13 | if rerun=='no': 14 | application_running=0 15 | print("Good-Bye") 16 | 17 | 18 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/SnakeGameImproved/food.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | import random 3 | 4 | 5 | class Food(Turtle): 6 | 7 | def __init__(self): 8 | super().__init__() 9 | self.shape("circle") 10 | self.penup() 11 | self.shapesize(stretch_len=0.5, stretch_wid=0.5) 12 | self.color("blue") 13 | self.speed("fastest") 14 | self.refresh() 15 | 16 | def refresh(self): 17 | random_x = random.randint(-280, 280) 18 | random_y = random.randint(-280, 280) 19 | self.goto(random_x, random_y) 20 | -------------------------------------------------------------------------------- /021_Snake/food.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | import random 3 | 4 | 5 | class Food(Turtle): 6 | 7 | def __init__(self): 8 | super().__init__() 9 | self.shape("circle") 10 | self.penup() 11 | self.color("red") 12 | self.shapesize(0.5, 0.5) 13 | self.speed(0) 14 | self.goto((random.randint(-250,250),random.randint(-250,250))) 15 | 16 | def refresh(self): 17 | self.goto((random.randint(-250, 250), random.randint(-250, 250))) 18 | 19 | def stop(self): 20 | self.hideturtle() 21 | self.goto((0,0)) -------------------------------------------------------------------------------- /019_Sketch&Race/EtchASketch.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | 3 | tim = Turtle() 4 | screen = Screen() 5 | tim.speed(0) 6 | 7 | def fwd(): 8 | tim.forward(5) 9 | def bck(): 10 | tim.back(5) 11 | def left(): 12 | tim.left(5) 13 | def right(): 14 | tim.right(5) 15 | def clear(): 16 | tim.reset() 17 | 18 | 19 | 20 | screen.listen() 21 | screen.onkeypress(fun=fwd, key="w") 22 | screen.onkeypress(fun=bck, key="s") 23 | screen.onkeypress(fun=left, key="a") 24 | screen.onkeypress(fun=right, key="d") 25 | screen.onkeypress(fun=clear, key="c") 26 | 27 | screen.exitonclick() 28 | -------------------------------------------------------------------------------- /Beginner_Projects/009_Silent_Auction/art.py: -------------------------------------------------------------------------------- 1 | logo = ''' 2 | ___________ 3 | \ / 4 | )_______( 5 | |"""""""|_.-._,.---------.,_.-._ 6 | | | | | | | ''-. 7 | | |_| |_ _| |_..-' 8 | |_______| '-' `'---------'` '-' 9 | )"""""""( 10 | /_________\\ 11 | .-------------. 12 | /_______________\\ 13 | ''' -------------------------------------------------------------------------------- /017_QuizGame/main.py: -------------------------------------------------------------------------------- 1 | from question_model import Question 2 | from data import question_data 3 | from quiz_brain import QuizBrain 4 | import random 5 | 6 | question_bank = [] 7 | 8 | for question in question_data: 9 | dyn = Question(question["question"], question["correct_answer"]) 10 | question_bank.append(dyn) 11 | 12 | random.shuffle(question_bank) 13 | 14 | quiz_brain = QuizBrain(question_bank) 15 | for i in range (len(quiz_brain.question_list)-2): 16 | quiz_brain.next_question() 17 | 18 | print(f"\n\nYou've completed the quiz\nYour final score was {quiz_brain.score}/{len(quiz_brain.question_list)-2}") -------------------------------------------------------------------------------- /Beginner_Projects/011_Blackjack/art.py: -------------------------------------------------------------------------------- 1 | logo = """ 2 | .------. _ _ _ _ _ 3 | |A_ _ |. | | | | | | (_) | | 4 | |( \/ ).-----. | |__ | | __ _ ___| | ___ __ _ ___| | __ 5 | | \ /|K /\ | | '_ \| |/ _` |/ __| |/ / |/ _` |/ __| |/ / 6 | | \/ | / \ | | |_) | | (_| | (__| <| | (_| | (__| < 7 | `-----| \ / | |_.__/|_|\__,_|\___|_|\_\ |\__,_|\___|_|\_\\ 8 | | \/ K| _/ | 9 | `------' |__/ 10 | """ 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /023_TurtleCrossing/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__() 11 | self.shape("turtle") 12 | self.penup() 13 | self.go_to_start() 14 | self.setheading(90) 15 | 16 | def go_up(self): 17 | self.forward(MOVE_DISTANCE) 18 | 19 | def go_to_start(self): 20 | self.goto(STARTING_POSITION) 21 | 22 | def is_at_finish_line(self): 23 | if self.ycor() > FINISH_LINE_Y: 24 | return True 25 | else: 26 | return False 27 | 28 | -------------------------------------------------------------------------------- /Beginner_Projects/009_Silent_Auction/main.py: -------------------------------------------------------------------------------- 1 | from replit import clear 2 | import art 3 | print(art.logo) 4 | print("Welome to the Secret Auction Program") 5 | log_dict={} 6 | auction_running="yes" 7 | while auction_running=="yes": 8 | name=input("What is your name? ") 9 | bid=input("What is your bid? $") 10 | log_dict[name]=bid 11 | auction_running=input("Are there any other bidders? Type 'yes' or 'no'\n") 12 | clear() 13 | highest_bid=0 14 | highest_bidder="" 15 | for name in log_dict: 16 | if int(log_dict[name])>highest_bid: 17 | highest_bid=int(log_dict[name]) 18 | highest_bidder=name 19 | print(f"The winner is {highest_bidder} with a bid of ${highest_bid}") 20 | 21 | 22 | -------------------------------------------------------------------------------- /020_Worm/main.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | import time 3 | from snake import Snake 4 | 5 | 6 | def close(): 7 | screen.bye() 8 | 9 | 10 | screen = Screen() 11 | screen.setup(width=600,height=600) 12 | screen.bgcolor("black") 13 | screen.tracer(0) 14 | screen.title("My Snake Game") 15 | 16 | snake = Snake() 17 | screen.update() 18 | screen.listen() 19 | screen.onkey(snake.up, "Up") 20 | screen.onkey(snake.down, "Down") 21 | screen.onkey(snake.left, "Left") 22 | screen.onkey(snake.right, "Right") 23 | screen.onkey(close, "c") 24 | 25 | game_on = True 26 | while game_on: 27 | screen.update() 28 | time.sleep(0.1) 29 | snake.move() 30 | 31 | 32 | screen.exitonclick() 33 | -------------------------------------------------------------------------------- /015_CoffeeMachine/database.py: -------------------------------------------------------------------------------- 1 | MENU = { 2 | "espresso": { 3 | "ingredients": { 4 | "water": 50, 5 | "milk": 0, 6 | "coffee": 18, 7 | }, 8 | "cost": 1.5, 9 | }, 10 | "latte": { 11 | "ingredients": { 12 | "water": 200, 13 | "milk": 150, 14 | "coffee": 24, 15 | }, 16 | "cost": 2.5, 17 | }, 18 | "cappuccino": { 19 | "ingredients": { 20 | "water": 250, 21 | "milk": 100, 22 | "coffee": 24, 23 | }, 24 | "cost": 3.0, 25 | } 26 | } 27 | 28 | resources = { 29 | "water": 300, 30 | "milk": 200, 31 | "coffee": 100, 32 | "money": 0 33 | } -------------------------------------------------------------------------------- /023_TurtleCrossing/scoreboard.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | FONT = ("Courier", 24, "normal") 4 | 5 | 6 | class Scoreboard(Turtle): 7 | 8 | def __init__(self): 9 | super().__init__() 10 | self.level = 1 11 | self.hideturtle() 12 | self.penup() 13 | self.goto(-280, 250) 14 | self.update_scoreboard() 15 | 16 | def update_scoreboard(self): 17 | self.clear() 18 | self.write(f"Level: {self.level}", align="left", font=FONT) 19 | 20 | def increase_level(self): 21 | self.level += 1 22 | self.update_scoreboard() 23 | 24 | def game_over(self): 25 | self.goto(0, 0) 26 | self.write("Game Over", align="center", font=FONT ) 27 | -------------------------------------------------------------------------------- /022_Pong/ball.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | 4 | class Ball(Turtle): 5 | 6 | def __init__(self): 7 | super().__init__() 8 | self.color("white") 9 | self.shape("square") 10 | self.penup() 11 | self.x_move = 5 12 | self.y_move = 5 13 | self.move_speed = 0.1 14 | 15 | def move(self): 16 | new_x = self.xcor() + self.x_move 17 | new_y = self.ycor() + self.y_move 18 | self.goto(new_x, new_y) 19 | 20 | def bounce_y(self): 21 | self.y_move *= -1 22 | 23 | def bounce_x(self): 24 | self.x_move *= -1 25 | self.move_speed *= 0.9 26 | 27 | def reset_position(self): 28 | self.goto(0, 0) 29 | self.move_speed = 0.1 30 | self.bounce_x() 31 | -------------------------------------------------------------------------------- /021_Snake/scoreboard.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | FONT = ('Courier', 14, 'bold') 3 | 4 | 5 | class ScoreBoard(Turtle): 6 | 7 | def __init__(self): 8 | super().__init__() 9 | self.score = 0 10 | self.pencolor("white") 11 | self.penup() 12 | self.speed(0) 13 | self.hideturtle() 14 | self.goto((0,278)) 15 | self.write(f"Score: {self.score}", move=False, align='center', font=FONT) 16 | 17 | def pointup(self): 18 | self.clear() 19 | self.score += 1 20 | self.write(f"Score: {self.score}", move=False, align='center', font=FONT) 21 | 22 | def stop(self): 23 | self.goto((0,0)) 24 | self.pencolor("red") 25 | self.write("GAME OVER", move=False, align='center', font=('Courier', 20, 'bold')) -------------------------------------------------------------------------------- /024_FileHandlingIntro/SnakeGameImproved/scoreboard.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | ALIGNMENT = "center" 3 | FONT = ("Courier", 24, "normal") 4 | 5 | 6 | class Scoreboard(Turtle): 7 | 8 | def __init__(self): 9 | super().__init__() 10 | self.score = 0 11 | self.color("white") 12 | self.penup() 13 | self.goto(0, 270) 14 | self.hideturtle() 15 | self.update_scoreboard() 16 | 17 | def update_scoreboard(self): 18 | self.write(f"Score: {self.score}", align=ALIGNMENT, font=FONT) 19 | 20 | def game_over(self): 21 | self.goto(0, 0) 22 | self.write("GAME OVER", align=ALIGNMENT, font=FONT) 23 | 24 | def increase_score(self): 25 | self.score += 1 26 | self.clear() 27 | self.update_scoreboard() 28 | -------------------------------------------------------------------------------- /017_QuizGame/quiz_brain.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | class QuizBrain: 4 | def __init__(self, q_list): 5 | self.question_number = 0 6 | self.score = 0 7 | self.question_list = q_list 8 | 9 | def next_question(self): 10 | ans = input(f"Q.{self.question_number+1} {self.question_list[self.question_number].text} (True/False)?: ").lower() 11 | if ans == self.question_list[self.question_number].answer.lower(): 12 | self.score += 1 13 | print(f"You got it right!\nYour current score is {self.score}/{self.question_number+1}") 14 | else: 15 | print(f"That's wrong.\nThe correct answer was: {self.question_list[self.question_number].answer}") 16 | print(f"Your current score is {self.score}/{self.question_number+1}") 17 | self.question_number += 1 18 | -------------------------------------------------------------------------------- /022_Pong/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.l_score = 0 12 | self.r_score = 0 13 | self.update_scoreboard() 14 | 15 | def update_scoreboard(self): 16 | self.clear() 17 | self.goto(-100, 180) 18 | self.write(self.l_score, align="center", font=("Deep Shadow", 50, "normal")) 19 | self.goto(100, 180) 20 | self.write(self.r_score, align="center", font=("Deep Shadow", 50, "normal")) 21 | 22 | def l_point(self): 23 | self.l_score += 1 24 | self.update_scoreboard() 25 | 26 | def r_point(self): 27 | self.r_score += 1 28 | self.update_scoreboard() -------------------------------------------------------------------------------- /Beginner_Projects/006_Maze_Solver/Maze_Solver.py: -------------------------------------------------------------------------------- 1 | #https://reeborg.ca/reeborg.html?lang=en&mode=python&menu=worlds%2Fmenus%2Freeborg_intro_en.json&name=Maze&url=worlds%2Ftutorial_en%2Fmaze1.json 2 | #following code runs on above reeborg project 3 | #if world resets, choose "maze" in dropdown 4 | 5 | def turn_right(): 6 | turn_left() 7 | turn_left() 8 | turn_left() 9 | 10 | #sys_reset is to overcome cases where robot has no right wall for the first four turns, which traps it in an infinite loop 11 | 12 | def sys_reset(): 13 | while front_is_clear(): 14 | move() 15 | turn_left() 16 | 17 | if right_is_clear(): 18 | sys_reset() 19 | 20 | while not(at_goal()): 21 | if right_is_clear(): 22 | turn_right() 23 | move() 24 | elif front_is_clear(): 25 | move() 26 | else: 27 | turn_left() -------------------------------------------------------------------------------- /018_HirstPainting/main.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | import random 3 | import colorgram 4 | 5 | colors = colorgram.extract('image.jpg', 10) 6 | palette = [] 7 | for color in colors: 8 | r = color.rgb.r 9 | g = color.rgb.g 10 | b = color.rgb.b 11 | new_col = (r, g, b) 12 | palette.append(new_col) 13 | 14 | tim = Turtle() 15 | screen = Screen() 16 | screen.colormode(255) 17 | tim.shape('circle') 18 | screen.screensize(300,300) 19 | tim.penup() 20 | x = -135 21 | y = -135 22 | tim.goto(x,y) 23 | tim.pendown() 24 | for i in range(20): 25 | for j in range (20): 26 | tim.color(random.choice(palette)) 27 | tim.pendown() 28 | tim.dot(10) 29 | x+=15 30 | tim.penup() 31 | tim.goto(x,y) 32 | tim.penup() 33 | x = -135 34 | y += 15 35 | tim.goto(x,y) 36 | 37 | 38 | 39 | screen.exitonclick() -------------------------------------------------------------------------------- /025_StatesGame/states_to_learn.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,Alabama 3 | 1,Alaska 4 | 2,Arizona 5 | 3,Arkansas 6 | 4,California 7 | 5,Colorado 8 | 6,Connecticut 9 | 7,Delaware 10 | 8,Florida 11 | 9,Georgia 12 | 10,Hawaii 13 | 11,Idaho 14 | 12,Illinois 15 | 13,Indiana 16 | 14,Iowa 17 | 15,Kansas 18 | 16,Kentucky 19 | 17,Louisiana 20 | 18,Maine 21 | 19,Maryland 22 | 20,Massachusetts 23 | 21,Michigan 24 | 22,Minnesota 25 | 23,Mississippi 26 | 24,Missouri 27 | 25,Montana 28 | 26,Nebraska 29 | 27,Nevada 30 | 28,New Hampshire 31 | 29,New Jersey 32 | 30,New Mexico 33 | 31,New York 34 | 32,North Carolina 35 | 33,North Dakota 36 | 34,Ohio 37 | 35,Oklahoma 38 | 36,Oregon 39 | 37,Pennsylvania 40 | 38,Rhode Island 41 | 39,South Carolina 42 | 40,South Dakota 43 | 41,Tennessee 44 | 42,Texas 45 | 43,Utah 46 | 44,Vermont 47 | 45,Virginia 48 | 46,Washington 49 | 47,West Virginia 50 | 48,Wisconsin 51 | 49,Wyoming 52 | -------------------------------------------------------------------------------- /027_MilesConverter/MilesToKilo.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | def miles_to_km(): 4 | miles = float(miles_input.get()) 5 | km = round(miles * 1.609, 1) 6 | kilometer_result.config(text=f"{km}") 7 | 8 | 9 | window = Tk() 10 | window.title("Miles to Kilometer converter") 11 | window.config(pady=25, padx=25) 12 | 13 | miles_input = Entry(width=7) 14 | miles_input.grid(column=1, row=0) 15 | 16 | miles_label = Label(text="Miles") 17 | miles_label.grid(column=2, row=0) 18 | 19 | is_equal_label = Label(text="is equal to") 20 | is_equal_label.grid(column=0, row=1) 21 | 22 | kilometer_result = Label(text=0) 23 | kilometer_result.grid(column=1, row=1) 24 | 25 | kilometer_label = Label(text="Km") 26 | kilometer_label.grid(column=2, row=1) 27 | 28 | calculate_button = Button(text="Calculate", command=miles_to_km) 29 | calculate_button.grid(column=1, row=2) 30 | 31 | 32 | window.mainloop() -------------------------------------------------------------------------------- /Beginner_Projects/012_Number_Guessing_Game/main.py: -------------------------------------------------------------------------------- 1 | import art 2 | import random 3 | import time 4 | 5 | random.seed(time.time()) 6 | 7 | def game(answer,diff): 8 | while (diff>0): 9 | print(f"You have {diff} guesses left") 10 | diff-=1 11 | guess=int(input("Make your guess: ")) 12 | if guess==answer: 13 | print("You win!") 14 | return 0; 15 | elif guess>answer: 16 | print("Too high") 17 | continue 18 | elif guess 230: 25 | is_race_on = False 26 | winner = turtle.pencolor() 27 | if winner == user_bet: 28 | print(f"You've won. {winner.title()} is the winner!") 29 | else: 30 | print(f"You've lost. {winner.title()} is the winner!") 31 | rand_distance = random.randint(0,10) 32 | turtle.forward(rand_distance) 33 | 34 | screen.exitonclick() 35 | -------------------------------------------------------------------------------- /Beginner_Projects/007_HangMan/main.py: -------------------------------------------------------------------------------- 1 | import random 2 | import time 3 | import hangman_art 4 | import hangman_words 5 | from replit import clear 6 | random.seed(time.time()) 7 | 8 | print(hangman_art.logo) 9 | 10 | def list_print(display): 11 | for i in range(0,len(display)): 12 | print(display[i], end="") 13 | print("\n") 14 | 15 | 16 | 17 | chosen_word=random.choice(hangman_words.word_stack) 18 | c_length=len(chosen_word) 19 | print(chosen_word) 20 | display=[] 21 | for i in range(0,c_length): 22 | display+="_" 23 | list_print(display) 24 | 25 | i=6 26 | 27 | while i>0: 28 | guess=input("Guess a letter-> ").lower() 29 | clear() 30 | if guess in display: 31 | print(f"You have already guessed {guess}.") 32 | for j in range(0,c_length): 33 | if guess==chosen_word[j]: 34 | display[j]=guess 35 | 36 | if guess not in chosen_word: 37 | print(f"You guessed {guess}, which is not in the word. You lose a life.") 38 | i-=1 39 | list_print(display) 40 | print(hangman_art.stages[i]) 41 | if "_" not in display: 42 | clear() 43 | break 44 | 45 | if i==0: 46 | print("You Lost :(") 47 | elif "_" not in display: 48 | print("YOU WIN") 49 | print(hangman_art.balloon) -------------------------------------------------------------------------------- /016_CoffeeMachine2/coffee_maker.py: -------------------------------------------------------------------------------- 1 | class CoffeeMaker: 2 | """Models the machine that makes the coffee""" 3 | def __init__(self): 4 | self.resources = { 5 | "water": 300, 6 | "milk": 200, 7 | "coffee": 100, 8 | } 9 | 10 | def report(self): 11 | """Prints a report of all resources.""" 12 | print(f"Water: {self.resources['water']}ml") 13 | print(f"Milk: {self.resources['milk']}ml") 14 | print(f"Coffee: {self.resources['coffee']}g") 15 | 16 | def is_resource_sufficient(self, drink): 17 | """Returns True when order can be made, False if ingredients are insufficient.""" 18 | can_make = True 19 | for item in drink.ingredients: 20 | if drink.ingredients[item] > self.resources[item]: 21 | print(f"Sorry there is not enough {item}.") 22 | can_make = False 23 | return can_make 24 | 25 | def make_coffee(self, order): 26 | """Deducts the required ingredients from the resources.""" 27 | for item in order.ingredients: 28 | self.resources[item] -= order.ingredients[item] 29 | print(f"Here is your {order.name} ☕️. Enjoy!") 30 | -------------------------------------------------------------------------------- /Beginner_Projects/005_Password_Generator/Password_Generator.py: -------------------------------------------------------------------------------- 1 | import random 2 | import time 3 | 4 | random.seed(time.time()) 5 | letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] 6 | numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] 7 | symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+'] 8 | 9 | print("Welcome to the PyPassword Generator!") 10 | nr_letters= int(input("How many letters would you like in your password?\n")) 11 | nr_symbols = int(input(f"How many symbols would you like?\n")) 12 | nr_numbers = int(input(f"How many numbers would you like?\n")) 13 | 14 | 15 | password=[] 16 | for n in range(1,nr_letters+1): 17 | password.append(random.choice(letters)) 18 | for n in range(1,nr_symbols+1): 19 | password.append(random.choice(symbols)) 20 | for n in range(1,nr_numbers+1): 21 | password.append(random.choice(numbers)) 22 | random.shuffle(password) 23 | pass_fin="" 24 | for n in range(0,len(password)): 25 | pass_fin+=str(password[n]) 26 | print(f"Your password is {pass_fin}") -------------------------------------------------------------------------------- /Beginner_Projects/014_HigherLower/main.py: -------------------------------------------------------------------------------- 1 | from game_data import data 2 | from art import logo,vs 3 | from replit import clear 4 | import random 5 | import time 6 | 7 | random.seed(time.time()) 8 | score=0 9 | A='' 10 | B='' 11 | def guess_check(A,B,guess): 12 | if A['follower_count']>=B['follower_count']: 13 | higher='A' 14 | else: 15 | higher='B' 16 | if guess==higher: 17 | return True 18 | else: 19 | return False 20 | 21 | 22 | 23 | def game(): 24 | print(logo) 25 | global score 26 | global A 27 | global B 28 | if score>0: 29 | print(f"You're right! Current score is {score}") 30 | if B == '' : 31 | A=random.choice(data) 32 | else: 33 | A=B 34 | print(f"Compare A: {A['name']}, a {A['description']}, from {A['country']}") 35 | print(vs) 36 | B=random.choice(data) 37 | print(f"Against B: {B['name']}, a {B['description']}, from {B['country']}") 38 | guess=input("Who has more followers? Type 'A' or 'B':").upper() 39 | if guess_check(A,B,guess): 40 | score+=1 41 | if A['follower_count']>=B['follower_count']: 42 | B=A 43 | clear() 44 | game() 45 | else: 46 | clear() 47 | print(logo) 48 | print(f"Sorry, that's wrong. Final score: {score}") 49 | 50 | game() -------------------------------------------------------------------------------- /025_StatesGame/main.py: -------------------------------------------------------------------------------- 1 | import turtle 2 | import pandas 3 | 4 | TOTAL_STATE = 50 5 | screen = turtle.Screen() 6 | screen.title("US States Game") 7 | image = "blank_states_img.gif" 8 | screen.addshape(image) 9 | turtle.shape(image) 10 | 11 | data = pandas.read_csv("50_states.csv") 12 | all_states = data.state.to_list() 13 | guessed_states = [] 14 | 15 | while len(guessed_states) < TOTAL_STATE: 16 | 17 | answer_state = screen.textinput(title=f"{len(guessed_states)}/50 Guess the State", prompt="Hazard a guess").title() 18 | 19 | if answer_state == "Exit": 20 | missing_states = [] 21 | 22 | for state in all_states: 23 | if state not in guessed_states: 24 | missing_states.append(state) 25 | final_data = pandas.DataFrame(missing_states) 26 | final_data.to_csv("states_to_learn.csv") 27 | break 28 | if answer_state in all_states: 29 | if answer_state in guessed_states: 30 | continue 31 | guessed_states.append(answer_state) 32 | t = turtle.Turtle() 33 | t.hideturtle() 34 | t.penup() 35 | state_data = data[data.state == answer_state] 36 | t.goto(int(state_data.x), int(state_data.y)) 37 | t.write(state_data.state.item()) 38 | -------------------------------------------------------------------------------- /Beginner_Projects/008_Caesar_Cipher/cipher.py: -------------------------------------------------------------------------------- 1 | def caesar(text,shift,direction): 2 | if direction=="encode": 3 | code_text="" 4 | n=0 5 | for n in range (0,len(text)): 6 | if text[n].isupper(): 7 | x=ord(text[n]) 8 | x+=shift 9 | while x>90: 10 | if x>90: 11 | x=64+(x-90) 12 | code_text+=chr(x) 13 | elif text[n].islower(): 14 | x=ord(text[n]) 15 | x+=shift 16 | while x>122: 17 | if x>122: 18 | x=96+(x-122) 19 | code_text+=chr(x) 20 | else: 21 | code_text+=text[n] 22 | 23 | print(f"The code is {code_text}.") 24 | elif direction=="decode": 25 | decode_text="" 26 | n=0 27 | for n in range (0,len(text)): 28 | if text[n].isupper(): 29 | x=ord(text[n]) 30 | x-=shift 31 | while x<65: 32 | if x<65: 33 | x=91-(65-x) 34 | decode_text+=chr(x) 35 | elif text[n].islower(): 36 | x=ord(text[n]) 37 | x-=shift 38 | while x>122: 39 | if x>122: 40 | x=122-(97-x) 41 | decode_text+=chr(x) 42 | else: 43 | decode_text+=text[n] 44 | 45 | print(f"The decoded text is {decode_text}.") 46 | -------------------------------------------------------------------------------- /016_CoffeeMachine2/menu.py: -------------------------------------------------------------------------------- 1 | class MenuItem: 2 | """Models each Menu Item.""" 3 | def __init__(self, name, water, milk, coffee, cost): 4 | self.name = name 5 | self.cost = cost 6 | self.ingredients = { 7 | "water": water, 8 | "milk": milk, 9 | "coffee": coffee 10 | } 11 | 12 | 13 | class Menu: 14 | """Models the Menu with drinks.""" 15 | def __init__(self): 16 | self.menu = [ 17 | MenuItem(name="latte", water=200, milk=150, coffee=24, cost=2.5), 18 | MenuItem(name="espresso", water=50, milk=0, coffee=18, cost=1.5), 19 | MenuItem(name="cappuccino", water=250, milk=50, coffee=24, cost=3), 20 | ] 21 | 22 | def get_items(self): 23 | """Returns all the names of the available menu items""" 24 | options = "" 25 | for item in self.menu: 26 | options += f"{item.name}/" 27 | return options 28 | 29 | def find_drink(self, order_name): 30 | """Searches the menu for a particular drink by name. Returns that item if it exists, otherwise returns None""" 31 | for item in self.menu: 32 | if item.name == order_name: 33 | return item 34 | print("Sorry that item is not available.") 35 | -------------------------------------------------------------------------------- /Beginner_Projects/010_Calculator/art.py: -------------------------------------------------------------------------------- 1 | logo = """ 2 | _____________________ 3 | | _________________ | 4 | | | Pythonista 0. | | .----------------. .----------------. .----------------. .----------------. 5 | | |_________________| | | .--------------. || .--------------. || .--------------. || .--------------. | 6 | | ___ ___ ___ ___ | | | ______ | || | __ | || | _____ | || | ______ | | 7 | | | 7 | 8 | 9 | | + | | | | .' ___ | | || | / \ | || | |_ _| | || | .' ___ | | | 8 | | |___|___|___| |___| | | | / .' \_| | || | / /\ \ | || | | | | || | / .' \_| | | 9 | | | 4 | 5 | 6 | | - | | | | | | | || | / ____ \ | || | | | _ | || | | | | | 10 | | |___|___|___| |___| | | | \ `.___.'\ | || | _/ / \ \_ | || | _| |__/ | | || | \ `.___.'\ | | 11 | | | 1 | 2 | 3 | | x | | | | `._____.' | || ||____| |____|| || | |________| | || | `._____.' | | 12 | | |___|___|___| |___| | | | | || | | || | | || | | | 13 | | | . | 0 | = | | / | | | '--------------' || '--------------' || '--------------' || '--------------' | 14 | | |___|___|___| |___| | '----------------' '----------------' '----------------' '----------------' 15 | |_____________________| 16 | """ 17 | -------------------------------------------------------------------------------- /016_CoffeeMachine2/main.py: -------------------------------------------------------------------------------- 1 | from menu import Menu, MenuItem 2 | from coffee_maker import CoffeeMaker 3 | from money_machine import MoneyMachine 4 | import os 5 | from time import sleep 6 | 7 | menu = Menu() 8 | menu_latte = menu.find_drink("latte") 9 | menu_espresso = menu.find_drink("espresso") 10 | menu_cappuccino = menu.find_drink("cappuccino") 11 | cof_m = CoffeeMaker() 12 | mon_m = MoneyMachine() 13 | 14 | machine_on = True 15 | 16 | while machine_on: 17 | drink = input(f"What would you like? {menu.get_items()}:") 18 | if drink == "report": 19 | cof_m.report() 20 | sleep(4) 21 | os.system('cls') 22 | continue 23 | elif drink == "off": 24 | os.system('cls') 25 | print("Good-Bye") 26 | machine_on = False 27 | continue 28 | elif drink == "profit": 29 | mon_m.report() 30 | sleep(4) 31 | os.system('cls') 32 | continue 33 | elif not cof_m.is_resource_sufficient(menu.find_drink(drink)): 34 | sleep(4) 35 | os.system('cls') 36 | continue 37 | if not mon_m.make_payment(menu.find_drink(drink).cost): 38 | sleep(4) 39 | os.system('cls') 40 | continue 41 | else: 42 | cof_m.make_coffee(menu.find_drink(drink)) 43 | sleep(4) 44 | os.system('cls') 45 | continue 46 | 47 | -------------------------------------------------------------------------------- /016_CoffeeMachine2/money_machine.py: -------------------------------------------------------------------------------- 1 | class MoneyMachine: 2 | 3 | CURRENCY = "$" 4 | 5 | COIN_VALUES = { 6 | "quarters": 0.25, 7 | "dimes": 0.10, 8 | "nickles": 0.05, 9 | "pennies": 0.01 10 | } 11 | 12 | def __init__(self): 13 | self.profit = 0 14 | self.money_received = 0 15 | 16 | def report(self): 17 | """Prints the current profit""" 18 | print(f"Money: {self.CURRENCY}{self.profit}") 19 | 20 | def process_coins(self): 21 | """Returns the total calculated from coins inserted.""" 22 | print("Please insert coins.") 23 | for coin in self.COIN_VALUES: 24 | self.money_received += int(input(f"How many {coin}?: ")) * self.COIN_VALUES[coin] 25 | return self.money_received 26 | 27 | def make_payment(self, cost): 28 | """Returns True when payment is accepted, or False if insufficient.""" 29 | self.process_coins() 30 | if self.money_received >= cost: 31 | change = round(self.money_received - cost, 2) 32 | print(f"Here is {self.CURRENCY}{change} in change.") 33 | self.profit += cost 34 | self.money_received = 0 35 | return True 36 | else: 37 | print("Sorry that's not enough money. Money refunded.") 38 | self.money_received = 0 39 | return False 40 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/SnakeGameImproved/main.py: -------------------------------------------------------------------------------- 1 | from turtle import Screen 2 | from snake import Snake 3 | from food import Food 4 | from scoreboard import Scoreboard 5 | import time 6 | 7 | screen = Screen() 8 | screen.setup(width=600, height=600) 9 | screen.bgcolor("black") 10 | screen.title("My Snake Game") 11 | screen.tracer(0) 12 | 13 | snake = Snake() 14 | food = Food() 15 | scoreboard = Scoreboard() 16 | 17 | screen.listen() 18 | screen.onkey(snake.up, "Up") 19 | screen.onkey(snake.down, "Down") 20 | screen.onkey(snake.left, "Left") 21 | screen.onkey(snake.right, "Right") 22 | 23 | game_is_on = True 24 | while game_is_on: 25 | screen.update() 26 | time.sleep(0.1) 27 | snake.move() 28 | 29 | #Detect collision with food. 30 | if snake.head.distance(food) < 15: 31 | food.refresh() 32 | snake.extend() 33 | scoreboard.increase_score() 34 | 35 | #Detect collision with wall. 36 | if snake.head.xcor() > 280 or snake.head.xcor() < -280 or snake.head.ycor() > 280 or snake.head.ycor() < -280: 37 | game_is_on = False 38 | scoreboard.game_over() 39 | 40 | #Detect collision with tail. 41 | for segment in snake.segments: 42 | if segment == snake.head: 43 | pass 44 | elif snake.head.distance(segment) < 10: 45 | game_is_on = False 46 | scoreboard.game_over() 47 | 48 | 49 | 50 | 51 | 52 | screen.exitonclick() 53 | -------------------------------------------------------------------------------- /022_Pong/main.py: -------------------------------------------------------------------------------- 1 | from turtle import Screen, Turtle 2 | from paddle import Paddle 3 | from ball import Ball 4 | from scoreboard import Scoreboard 5 | import time 6 | 7 | 8 | screen = Screen() 9 | screen.setup(width=800, height=600) 10 | screen.bgcolor("black") 11 | screen.tracer(0) 12 | screen.title("Pong") 13 | 14 | 15 | def shutdown(): 16 | screen.bye() 17 | 18 | 19 | l_paddle = Paddle((-350, 0)) 20 | r_paddle = Paddle((350, 0)) 21 | ball = Ball() 22 | scoreboard = Scoreboard() 23 | 24 | game_is_on = True 25 | screen.listen() 26 | screen.onkeypress(l_paddle.go_up, "w") 27 | screen.onkeypress(l_paddle.go_down, "s") 28 | screen.onkeypress(r_paddle.go_up, "Up") 29 | screen.onkeypress(r_paddle.go_down, "Down") 30 | screen.onkey(shutdown, "c") 31 | 32 | while game_is_on: 33 | time.sleep(ball.move_speed) 34 | screen.update() 35 | ball.move() 36 | 37 | # Detect wall collision 38 | if ball.ycor()>280 or ball.ycor()<-280: 39 | ball.bounce_y() 40 | 41 | # Detect collision with right paddle 42 | if ball.distance(r_paddle) < 50 and ball.xcor() < 320 or ball.distance(l_paddle) < 50 and ball.xcor() < -320: 43 | ball.bounce_x() 44 | 45 | # Detect when r_paddle misses 46 | if ball.xcor() > 380: 47 | ball.reset_position() 48 | scoreboard.l_point() 49 | 50 | # Detect when l_paddle missed 51 | if ball.xcor() < -380: 52 | ball.reset_position() 53 | scoreboard.r_point() 54 | screen.exitonclick() 55 | -------------------------------------------------------------------------------- /Beginner_Projects/010_Calculator/main.py: -------------------------------------------------------------------------------- 1 | import art 2 | from replit import clear 3 | def add(n1,n2): 4 | return n1+n2 5 | def sub(n1,n2): 6 | return n1-n2 7 | def multiply(n1,n2): 8 | return n1*n2 9 | def div(n1,n2): 10 | return n1/n2 11 | op_dict={ 12 | "+":add, 13 | "-":sub, 14 | "*":multiply, 15 | "/":div, 16 | } 17 | 18 | def calculator(): 19 | print(art.logo) 20 | n1=float(input("Enter first number: ")) 21 | print("What operation would you like to do") 22 | for key in op_dict: 23 | print(key) 24 | op=input("Pick an operation from the line above: ") 25 | n2=float(input("Enter second number: ")) 26 | answer=float(f"{op_dict[op](n1,n2):.2f}") 27 | print(f"{n1} {op} {n2} = {answer}") 28 | 29 | calc_running = True 30 | while(calc_running): 31 | switch=input(f"type 'y' to continue calculating with {answer}, type 'n' to exit, type 'r' to begin a new calculation: ") 32 | if(switch== 'y'): 33 | answer_prev=answer 34 | op=input("Pick an operation: ") 35 | nx=float(input("Enter next number: ")) 36 | answer=float(f"{op_dict[op](answer,nx):.2f}") 37 | print(f"{answer_prev} {op} {nx} = {answer}") 38 | elif(switch=='n'): 39 | print("Thank you") 40 | calc_running = False 41 | elif(switch== 'r'): 42 | calc_running = False 43 | clear() 44 | calculator() 45 | else: 46 | print("Invalid input. Exiting") 47 | calc_running= False 48 | calculator() 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /021_Snake/main.py: -------------------------------------------------------------------------------- 1 | from turtle import Screen 2 | import time 3 | from snake import Snake 4 | from food import Food 5 | from scoreboard import ScoreBoard 6 | 7 | 8 | def close(): 9 | screen.bye() 10 | 11 | 12 | screen = Screen() 13 | screen.setup(width=600, height=600) 14 | screen.bgcolor("black") 15 | screen.colormode(255) 16 | screen.tracer(0) 17 | screen.title("My Snake Game") 18 | 19 | food = Food() 20 | snake = Snake() 21 | scoreboard = ScoreBoard() 22 | 23 | screen.update() 24 | screen.listen() 25 | screen.onkey(snake.up, "Up") 26 | screen.onkey(snake.down, "Down") 27 | screen.onkey(snake.left, "Left") 28 | screen.onkey(snake.right, "Right") 29 | screen.onkey(close, "c") 30 | 31 | game_on = True 32 | while game_on: 33 | screen.update() 34 | time.sleep(0.1) 35 | snake.move() 36 | # food collision detection 37 | if snake.head.distance(food) < 15: 38 | food.refresh() 39 | snake.elongate() 40 | scoreboard.pointup() 41 | 42 | # detect wall collision 43 | 44 | if snake.head.xcor() >= 280 or snake.head.xcor() <= -285 or snake.head.ycor() >= 300 or snake.head.ycor() <= -280: 45 | snake.stop() 46 | scoreboard.stop() 47 | food.stop() 48 | screen.update() 49 | game_on = False 50 | 51 | # detect self collision 52 | 53 | for i in range(4, snake.length): 54 | if snake.head.distance(snake.segments[i]) < 20: 55 | snake.stop() 56 | scoreboard.stop() 57 | food.stop() 58 | screen.update() 59 | game_on = False 60 | screen.exitonclick() 61 | -------------------------------------------------------------------------------- /024_FileHandlingIntro/SnakeGameImproved/snake.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | STARTING_POSITIONS = [(0, 0), (-20, 0), (-40, 0)] 3 | MOVE_DISTANCE = 20 4 | UP = 90 5 | DOWN = 270 6 | LEFT = 180 7 | RIGHT = 0 8 | 9 | 10 | class Snake: 11 | 12 | def __init__(self): 13 | self.segments = [] 14 | self.create_snake() 15 | self.head = self.segments[0] 16 | 17 | def create_snake(self): 18 | for position in STARTING_POSITIONS: 19 | self.add_segment(position) 20 | 21 | def add_segment(self, position): 22 | new_segment = Turtle("square") 23 | new_segment.color("white") 24 | new_segment.penup() 25 | new_segment.goto(position) 26 | self.segments.append(new_segment) 27 | 28 | def extend(self): 29 | self.add_segment(self.segments[-1].position()) 30 | 31 | def move(self): 32 | for seg_num in range(len(self.segments) - 1, 0, -1): 33 | new_x = self.segments[seg_num - 1].xcor() 34 | new_y = self.segments[seg_num - 1].ycor() 35 | self.segments[seg_num].goto(new_x, new_y) 36 | self.head.forward(MOVE_DISTANCE) 37 | 38 | def up(self): 39 | if self.head.heading() != DOWN: 40 | self.head.setheading(UP) 41 | 42 | def down(self): 43 | if self.head.heading() != UP: 44 | self.head.setheading(DOWN) 45 | 46 | def left(self): 47 | if self.head.heading() != RIGHT: 48 | self.head.setheading(LEFT) 49 | 50 | def right(self): 51 | if self.head.heading() != LEFT: 52 | self.head.setheading(RIGHT) 53 | -------------------------------------------------------------------------------- /Beginner_Projects/004_Rock-Paper-Scissors/Rock_Paper_Scissors.py: -------------------------------------------------------------------------------- 1 | import random 2 | import time 3 | import sys 4 | 5 | random.seed(time.time()) 6 | 7 | rock = ''' 8 | _______ 9 | ---' ____) 10 | (_____) 11 | (_____) 12 | (____) 13 | ---.__(___) 14 | ''' 15 | 16 | paper = ''' 17 | _______ 18 | ---' ____)____ 19 | ______) 20 | _______) 21 | _______) 22 | ---.__________) 23 | ''' 24 | 25 | scissors = ''' 26 | _______ 27 | ---' ____)____ 28 | ______) 29 | __________) 30 | (____) 31 | ---.__(___) 32 | ''' 33 | 34 | 35 | print("Welcome to RPS against cpu!") 36 | player=int(input("What do you choose? Type 0 for Rock, 1 for Paper or 2 for scissors:\n")) 37 | if player==0: 38 | print(rock) 39 | elif player==1: 40 | print(paper) 41 | elif player==2: 42 | print(scissors) 43 | else: 44 | sys.exit("You chose an invalid move ヽ(ಠ_ಠ)ノ") 45 | 46 | print("cpu chose->") 47 | cpu=random.randint(0,2) 48 | 49 | if cpu==0: 50 | print(rock) 51 | elif cpu==1: 52 | print(paper) 53 | elif cpu==2: 54 | print(scissors) 55 | 56 | 57 | if player==0 and cpu==0: 58 | print("IT'S A DRAW") 59 | elif player==0 and cpu==1: 60 | print("you lose:(") 61 | elif player==0 and cpu==2: 62 | print("!!YOU WIN!!") 63 | elif player==1 and cpu==0: 64 | print("!!YOU WIN!!") 65 | elif player==1 and cpu==1: 66 | print("IT'S A DRAW") 67 | elif player==1 and cpu==2: 68 | print("you lose:(") 69 | elif player==2 and cpu==0: 70 | print("you lose:(") 71 | elif player==2 and cpu==1: 72 | print("!!YOU WIN!!") 73 | elif player==2 and cpu==2: 74 | print("IT'S A DRAW") 75 | -------------------------------------------------------------------------------- /020_Worm/snake.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle, Screen 2 | import time 3 | 4 | MOVE_Distance = 20 5 | 6 | 7 | class Snake(): 8 | def __init__(self): 9 | self.length = 3 10 | self.segments = [] 11 | self.create_snake() 12 | self.head = self.segments[0] 13 | 14 | def create_snake(self): 15 | for i in range(0, self.length): 16 | new_segment = Turtle(shape="square") 17 | new_segment.color("white") 18 | new_segment.penup() 19 | new_segment.goto((i * -20, 0)) 20 | self.segments.append(new_segment) 21 | 22 | def move(self): 23 | for seg in range(len(self.segments) - 1, -1, -1): 24 | if seg == 0: 25 | self.head.forward(MOVE_Distance) 26 | continue 27 | self.segments[seg].goto(self.segments[seg - 1].pos()) 28 | 29 | def up(self): 30 | if self.head.heading() == 0: 31 | self.head.left(90) 32 | if self.head.heading() == 180: 33 | self.head.right(90) 34 | 35 | def down(self): 36 | if self.head.heading() == 0: 37 | self.head.right(90) 38 | if self.head.heading() == 180: 39 | self.head.left(90) 40 | 41 | def left(self): 42 | if self.head.heading() == 90: 43 | self.head.left(90) 44 | if self.head.heading() == 270: 45 | self.head.right(90) 46 | 47 | def right(self): 48 | if self.head.heading() == 90: 49 | self.head.right(90) 50 | if self.head.heading() == 270: 51 | self.head.left(90) 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /015_CoffeeMachine/main.py: -------------------------------------------------------------------------------- 1 | from database import MENU, resources 2 | import os 3 | import time 4 | 5 | 6 | def resource_check(drink): 7 | if MENU[drink]["ingredients"]["water"]<=resources["water"] and MENU[drink]["ingredients"]["milk"]<=resources["milk"] and MENU[drink]["ingredients"]["coffee"]<=resources["coffee"]: 8 | return True 9 | else: 10 | return False 11 | 12 | 13 | def drink_prep(drink, amount_paid): 14 | resources["water"] -= MENU[drink]["ingredients"]["water"] 15 | resources["milk"] -= MENU[drink]["ingredients"]["milk"] 16 | resources["coffee"] -= MENU[drink]["ingredients"]["coffee"] 17 | resources["money"] += MENU[drink]["cost"] 18 | change = amount_paid - MENU[drink]["cost"] 19 | print(f"Change: {change}") 20 | print(f"Here is your {drink}. Enjoy☕!") 21 | 22 | 23 | machine_on = True 24 | while machine_on: 25 | drink = input(" What would you like? (espresso/latte/cappuccino):") 26 | if drink == "report" : 27 | for item in resources: 28 | print(f"{item}: {resources[item]}") 29 | time.sleep(3) 30 | os.system('cls') 31 | continue 32 | elif drink == 'shutdown': 33 | os.system('cls') 34 | print("XXX POWER OFF XXX") 35 | machine_on = False 36 | continue 37 | elif not resource_check(drink): 38 | print("Not enough ingredients. Sorry") 39 | time.sleep(3) 40 | os.system('cls') 41 | continue 42 | 43 | print("Please enter coins.") 44 | q = int(input("How many quarters?:")) 45 | d = int(input("How many dimes?:")) 46 | n = int(input("How many nickels?:")) 47 | p = int(input("How many pennies?:")) 48 | amount_paid = q * 0.25 + d * 0.10 + n * 0.05 + p * 0.01 49 | 50 | if amount_paid < MENU[drink]["cost"]: 51 | print("Sorry that's not enough money. Money refunded.") 52 | time.sleep(3) 53 | os.system('cls') 54 | continue 55 | else: 56 | drink_prep(drink, amount_paid) 57 | continue 58 | 59 | 60 | -------------------------------------------------------------------------------- /021_Snake/snake.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | import random 3 | import time 4 | 5 | random.seed(time.time()) 6 | 7 | MOVE_Distance = 20 8 | 9 | 10 | class Snake: 11 | def __init__(self): 12 | self.length = 3 13 | self.segments = [] 14 | self.create_snake() 15 | self.head = self.segments[0] 16 | 17 | def create_snake(self): 18 | for i in range(0, self.length): 19 | new_segment = Turtle(shape="square") 20 | new_segment.color((random.randint(1,255), random.randint(1,255), random.randint(1,255))) 21 | new_segment.penup() 22 | new_segment.goto((i * -20, 0)) 23 | self.segments.append(new_segment) 24 | 25 | def move(self): 26 | for seg in range(len(self.segments) - 1, -1, -1): 27 | if seg == 0: 28 | self.head.forward(MOVE_Distance) 29 | continue 30 | self.segments[seg].goto(self.segments[seg - 1].pos()) 31 | 32 | def up(self): 33 | if self.head.heading() == 0: 34 | self.head.left(90) 35 | if self.head.heading() == 180: 36 | self.head.right(90) 37 | 38 | def down(self): 39 | if self.head.heading() == 0: 40 | self.head.right(90) 41 | if self.head.heading() == 180: 42 | self.head.left(90) 43 | 44 | def left(self): 45 | if self.head.heading() == 90: 46 | self.head.left(90) 47 | if self.head.heading() == 270: 48 | self.head.right(90) 49 | 50 | def right(self): 51 | if self.head.heading() == 90: 52 | self.head.right(90) 53 | if self.head.heading() == 270: 54 | self.head.left(90) 55 | 56 | def stop(self): 57 | for seg in self.segments: 58 | seg.color("white") 59 | 60 | def elongate(self): 61 | new_segment = Turtle(shape="square") 62 | self.length += 1 63 | new_segment.color((random.randint(1,255), random.randint(1,255), random.randint(1,255))) 64 | new_segment.penup() 65 | new_segment.goto((self.segments[len(self.segments)-1].xcor(), self.segments[len(self.segments)-1].ycor())) 66 | self.segments.append(new_segment) 67 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Beginner_Projects/007_HangMan/hangman_art.py: -------------------------------------------------------------------------------- 1 | stages = [''' 2 | +---+ 3 | | | 4 | O | 5 | /|\ | 6 | / \ | 7 | | 8 | ========= 9 | ''', ''' 10 | +---+ 11 | | | 12 | O | 13 | /|\ | 14 | / | 15 | | 16 | ========= 17 | ''', ''' 18 | +---+ 19 | | | 20 | O | 21 | /|\ | 22 | | 23 | | 24 | ========= 25 | ''', ''' 26 | +---+ 27 | | | 28 | O | 29 | /| | 30 | | 31 | | 32 | =========''', ''' 33 | +---+ 34 | | | 35 | O | 36 | | | 37 | | 38 | | 39 | ========= 40 | ''', ''' 41 | +---+ 42 | | | 43 | O | 44 | | 45 | | 46 | | 47 | ========= 48 | ''', ''' 49 | +---+ 50 | | | 51 | | 52 | | 53 | | 54 | | 55 | ========= 56 | '''] 57 | 58 | logo = ''' 59 | _ 60 | | | 61 | | |__ __ _ _ __ __ _ _ __ ___ __ _ _ __ 62 | | '_ \ / _` | '_ \ / _` | '_ ` _ \ / _` | '_ \ 63 | | | | | (_| | | | | (_| | | | | | | (_| | | | | 64 | |_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_| 65 | __/ | 66 | |___/ ''' 67 | 68 | 69 | balloon = ''' 70 | ,,,,,,,,,,,,, 71 | .;;;;;;;;;;;;;;;;;;;,. 72 | .;;;;;;;;;;;;;;;;;;;;;;;;, 73 | .;;;;;;;;;;;;;;;;;;;;;;;;;;;;. 74 | ;;;;;@;;;;;;;;;;;;;;;;;;;;;;;;' ............. 75 | ;;;;@@;;;;;;;;;;;;;;;;;;;;;;;;'................. 76 | ;;;;@@;;;;;;;;;;;;;;;;;;;;;;;;'................... 77 | `;;;;@;;;;;;;;;;;;;;;@;;;;;;;'..................... 78 | `;;;;;;;;;;;;;;;;;;;@@;;;;;'..................;.... 79 | `;;;;;;;;;;;;;;;;@@;;;;'....................;;... 80 | `;;;;;;;;;;;;;@;;;;'...;.................;;.... 81 | `;;;;;;;;;;;;' ...;;...............;..... 82 | `;;;;;;' ...;;.................. 83 | ;; ..;............... 84 | ` ............ 85 | ` ...... 86 | ` .. 87 | ` ' 88 | ` ' 89 | ` ' 90 | ` ` 91 | ` `, 92 | ` 93 | ` 94 | `.''' -------------------------------------------------------------------------------- /017_QuizGame/data.py: -------------------------------------------------------------------------------- 1 | question_data = [ 2 | {"category": "Science: Computers", 3 | "type": "boolean", 4 | "difficulty": "medium", 5 | "question": "The HTML5 standard was published in 2014.", 6 | "correct_answer": "True", 7 | "incorrect_answers": ["False"]}, 8 | {"category": "Science: Computers", "type": "boolean", "difficulty": "medium", 9 | "question": "The common software-programming acronym 'I18N' comes from the term 'Interlocalization'.", 10 | "correct_answer": "False", "incorrect_answers": ["True"]}, 11 | {"category": "Science: Computers", "type": "boolean", "difficulty": "medium", 12 | "question": "The first computer bug was formed by faulty wires.", "correct_answer": "False", 13 | "incorrect_answers": ["True"]}, 14 | {"category": "Science: Computers", "type": "boolean", "difficulty": "medium", 15 | "question": "FLAC stands for 'Free Lossless Audio Condenser'", 16 | "correct_answer": "False", "incorrect_answers": ["True"]}, 17 | {"category": "Science: Computers", "type": "boolean", "difficulty": "medium", 18 | "question": "The very first recorded computer 'bug' was a moth found inside a Harvard Mark II computer.", 19 | "correct_answer": "True", "incorrect_answers": ["False"]}, 20 | {"category": "Science: Computers", "type": "boolean", "difficulty": "medium", 21 | "question": "'Windows NT' is a monolithic kernel.", "correct_answer": "False", 22 | "incorrect_answers": ["True"]}, 23 | {"category": "Science: Computers", "type": "boolean", "difficulty": "medium", 24 | "question": "The open source program Redis is a relational database server.", 25 | "correct_answer": "False", "incorrect_answers": ["True"]}, 26 | {"category": "Science: Computers", "type": "boolean", "difficulty": "medium", 27 | "question": "Early RAM was directly seated onto the motherboard and could not be easily removed.", 28 | "correct_answer": "True", "incorrect_answers": ["False"]}, 29 | {"category": "Science: Computers", "type": "boolean", "difficulty": "medium", 30 | "question": "It's not possible to format a write-protected DVD-R Hard Disk.", "correct_answer": "True", 31 | "incorrect_answers": ["False"]}, 32 | {"category": "Science: Computers", "type": "boolean", "difficulty": "medium", 33 | "question": "Linus Sebastian is the creator of the Linux kernel, which went on to be used in Linux, Android, and Chrome OS.", 34 | "correct_answer": "False", "incorrect_answers": ["True"]}, 35 | ] 36 | -------------------------------------------------------------------------------- /Beginner_Projects/003_Treasure_Island/Treasure_Island.py: -------------------------------------------------------------------------------- 1 | print(''' 2 | ******************************************************************************* 3 | | | | | 4 | _________|________________.=""_;=.______________|_____________________|_______ 5 | | | ,-"_,="" `"=.| | 6 | |___________________|__"=._o`"-._ `"=.______________|___________________ 7 | | `"=._o`"=._ _`"=._ | 8 | _________|_____________________:=._o "=._."_.-="'"=.__________________|_______ 9 | | | __.--" , ; `"=._o." ,-"""-._ ". | 10 | |___________________|_._" ,. .` ` `` , `"-._"-._ ". '__|___________________ 11 | | |o`"=._` , "` `; .". , "-._"-._; ; | 12 | _________|___________| ;`-.o`"=._; ." ` '`."\` . "-._ /_______________|_______ 13 | | | |o; `"-.o`"=._`` '` " ,__.--o; | 14 | |___________________|_| ; (#) `-.o `"=.`_.--"_o.-; ;___|___________________ 15 | ____/______/______/___|o;._ " `".o|o_.--" ;o;____/______/______/____ 16 | /______/______/______/_"=._o--._ ; | ; ; ;/______/______/______/_ 17 | ____/______/______/______/__"=._o--._ ;o|o; _._;o;____/______/______/____ 18 | /______/______/______/______/____"=._o._; | ;_.--"o.--"_/______/______/______/_ 19 | ____/______/______/______/______/_____"=.o|o_.--""___/______/______/______/____ 20 | /______/______/______/______/______/______/______/______/______/______/_____ / 21 | ******************************************************************************* 22 | ''') 23 | print("!!!Welcome to Treasure Island!!!") 24 | print("Your mission is to find the treasure.") 25 | 26 | 27 | choice1 = input("You\'re at a cross road. Where do you want to go? Type \"left\" or \"right\" \n").lower() 28 | if choice1 == "left": 29 | choice2 = input("You\'ve come to a lake. There is an island in the middle of the lake. Type \"wait\" to wait for a boat. Type \"swim\" to swim across. \n").lower() 30 | if choice2 == "wait": 31 | choice3 = input("You arrive at the island unharmed. There is a house with 3 doors. One red, one yellow and one blue. Which colour do you choose? \n").lower() 32 | if choice3 == "red": 33 | print("It's a room full of fire. Game Over.") 34 | elif choice3 == "yellow": 35 | print("You found the treasure! You Win!") 36 | elif choice3 == "blue": 37 | print("You enter a room of beasts. Game Over.") 38 | else: 39 | print("You chose a door that doesn't exist. Game Over.") 40 | else: 41 | print("You get attacked by an angry trout. Game Over.") 42 | else: 43 | print("You fell into a hole. Game Over.") 44 | 45 | -------------------------------------------------------------------------------- /Beginner_Projects/011_Blackjack/main.py: -------------------------------------------------------------------------------- 1 | from art import logo 2 | from replit import clear 3 | import random 4 | import time 5 | 6 | random.seed(time.time()) 7 | 8 | cards = [11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10] 9 | player_cards=[] 10 | computer_cards=[] 11 | 12 | def card_deal(): 13 | return random.choice(cards) 14 | 15 | def calculate(stack): 16 | if sum(stack)==21 and len(stack)==2: 17 | return 0; 18 | 19 | if 11 in stack and sum(stack)>21: 20 | stack.remove(11) 21 | stack.append(1) 22 | return sum(stack) 23 | 24 | def compare(player_score, computer_score): 25 | 26 | if player_score > 21 and computer_score > 21: 27 | return "You went over. You lose 😤" 28 | if player_score == computer_score: 29 | return "Draw 🙃" 30 | elif computer_score == 0: 31 | return "Lose, opponent has Blackjack 😱" 32 | elif player_score == 0: 33 | return "Win with a Blackjack 😎" 34 | elif player_score > 21: 35 | return "You went over. You lose 😭" 36 | elif computer_score > 21: 37 | return "Opponent went over. You win 😁" 38 | elif player_score > computer_score: 39 | return "You win 😃" 40 | else: 41 | return "You lose 😤" 42 | 43 | def gameplay(): 44 | clear() 45 | print(logo) 46 | player_cards.clear() 47 | computer_cards.clear() 48 | for i in range(0,2): 49 | player_cards.append(card_deal()) 50 | computer_cards.append(card_deal()) 51 | game_run = True 52 | while game_run: 53 | player_score=calculate(player_cards) 54 | computer_score=calculate(computer_cards) 55 | print(f" Your cards : {player_cards}") 56 | print(f" Computer's first card: {computer_cards[0]}") 57 | if player_score==0 or computer_score==0 or player_score>21: 58 | game_run=False 59 | elif player_score<21: 60 | pl_draw=input("Do you want to draw another card? Type 'y' or 'n':") 61 | if pl_draw=='y': 62 | player_cards.append(card_deal()) 63 | game_run=False 64 | else: 65 | game_run==False 66 | player_score=calculate(player_cards) 67 | while computer_score!=0 and computer_score<17: 68 | computer_cards.append(card_deal()) 69 | computer_score=calculate(computer_cards) 70 | print(f"Your final hand: {player_cards}. Your final score: {player_score}") 71 | print(f"Computer's final hand: {computer_cards}.") 72 | print(compare(player_score,computer_score)) 73 | replay=input("Do you wish to play again? Type 'y' or 'n':") 74 | if replay=='n': 75 | clear() 76 | print("Thank you.") 77 | elif replay=='y': 78 | clear() 79 | gameplay() 80 | 81 | start=input("Do you want to play a game of Blackjack? Type 'y' or 'n': ") 82 | if start=='n': 83 | clear() 84 | print("Good-Bye") 85 | elif(start=='y'): 86 | gameplay() 87 | -------------------------------------------------------------------------------- /028_Pomodoro/main.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | 3 | # ---------------------------- CONSTANTS ------------------------------- # 4 | PINK = "#e2979c" 5 | RED = "#e7305b" 6 | GREEN = "#9bdeac" 7 | YELLOW = "#f7f5dd" 8 | FONT_NAME = "Courier" 9 | WORK_MIN = 1 10 | SHORT_BREAK_MIN = 5 11 | LONG_BREAK_MIN = 20 12 | reps = 0 13 | timer = None 14 | 15 | 16 | # ---------------------------- TIMER RESET ------------------------------- # 17 | 18 | def reset_timer(): 19 | global reps 20 | window.after_cancel(timer) 21 | canvas.itemconfig(timer_text, text="00:00") 22 | title_label.config(text="Timer") 23 | check_marks.config(text="") 24 | reps = 0 25 | 26 | 27 | # ---------------------------- TIMER MECHANISM ------------------------------- # 28 | def start_timer(): 29 | global reps 30 | reps += 1 31 | work_sec = WORK_MIN * 60 32 | short_break_sec = SHORT_BREAK_MIN * 60 33 | long_break_sec = LONG_BREAK_MIN * 60 34 | 35 | if reps % 8 == 0: 36 | count_down(long_break_sec) 37 | title_label.config(text="Break", fg=RED) 38 | elif reps % 2 == 0: 39 | count_down(short_break_sec) 40 | title_label.config(text="Break", fg=PINK) 41 | else: 42 | count_down(work_sec) 43 | title_label.config(text="Work", fg=GREEN) 44 | 45 | 46 | # ---------------------------- COUNTDOWN MECHANISM ------------------------------- # 47 | def count_down(count): 48 | count_min = count // 60 49 | count_sec = count % 60 50 | if count_sec < 10: 51 | count_sec = f"0{count_sec}" 52 | 53 | canvas.itemconfig(timer_text, text=f"{count_min}:{count_sec}") 54 | if count > 0: 55 | global timer 56 | timer = window.after(1000, count_down, count - 1) 57 | else: 58 | start_timer() 59 | marks = "" 60 | for _ in range(reps // 2): 61 | marks += "✔" 62 | check_marks.config(text=marks) 63 | 64 | 65 | # ---------------------------- UI SETUP ------------------------------- # 66 | window = Tk() 67 | window.title("Pomodoro") 68 | window.config(padx=100, pady=50, bg=YELLOW) 69 | 70 | title_label = Label(text="Timer", fg=GREEN, bg=YELLOW, font=(FONT_NAME, 50)) 71 | title_label.grid(column=1, row=0) 72 | 73 | canvas = Canvas(width=200, height=224, bg=YELLOW, highlightthickness=0) 74 | tomato_img = PhotoImage(file="tomato.png") 75 | canvas.create_image(100, 112, image=tomato_img) 76 | timer_text = canvas.create_text(100, 130, text="00:00", fill="white", font=(FONT_NAME, 35, "bold")) 77 | canvas.grid(column=1, row=1) 78 | 79 | start_button = Button(text="Start", highlightthickness=0, command=start_timer) 80 | start_button.grid(column=0, row=2) 81 | 82 | reset_button = Button(text="Reset", highlightthickness=0, command=reset_timer) 83 | reset_button.grid(column=2, row=2) 84 | 85 | check_marks = Label(fg=GREEN, bg=YELLOW) 86 | check_marks.grid(column=1, row=3) 87 | 88 | window.mainloop() 89 | -------------------------------------------------------------------------------- /Beginner_Projects/007_HangMan/hangman_words.py: -------------------------------------------------------------------------------- 1 | word_stack = [ 2 | 'abruptly', 3 | 'absurd', 4 | 'abyss', 5 | 'affix', 6 | 'askew', 7 | 'avenue', 8 | 'awkward', 9 | 'axiom', 10 | 'azure', 11 | 'bagpipes', 12 | 'bandwagon', 13 | 'banjo', 14 | 'bayou', 15 | 'beekeeper', 16 | 'bikini', 17 | 'blitz', 18 | 'blizzard', 19 | 'boggle', 20 | 'bookworm', 21 | 'boxcar', 22 | 'boxful', 23 | 'buckaroo', 24 | 'buffalo', 25 | 'buffoon', 26 | 'buxom', 27 | 'buzzard', 28 | 'buzzing', 29 | 'buzzwords', 30 | 'caliph', 31 | 'cobweb', 32 | 'cockiness', 33 | 'croquet', 34 | 'crypt', 35 | 'curacao', 36 | 'cycle', 37 | 'daiquiri', 38 | 'dirndl', 39 | 'disavow', 40 | 'dizzying', 41 | 'duplex', 42 | 'dwarves', 43 | 'embezzle', 44 | 'equip', 45 | 'espionage', 46 | 'euouae', 47 | 'exodus', 48 | 'faking', 49 | 'fishhook', 50 | 'fixable', 51 | 'fjord', 52 | 'flapjack', 53 | 'flopping', 54 | 'fluffiness', 55 | 'flyby', 56 | 'foxglove', 57 | 'frazzled', 58 | 'frizzled', 59 | 'fuchsia', 60 | 'funny', 61 | 'gabby', 62 | 'galaxy', 63 | 'galvanize', 64 | 'gazebo', 65 | 'giaour', 66 | 'gizmo', 67 | 'glowworm', 68 | 'glyph', 69 | 'gnarly', 70 | 'gnostic', 71 | 'gossip', 72 | 'grogginess', 73 | 'haiku', 74 | 'haphazard', 75 | 'hyphen', 76 | 'iatrogenic', 77 | 'icebox', 78 | 'injury', 79 | 'ivory', 80 | 'ivy', 81 | 'jackpot', 82 | 'jaundice', 83 | 'jawbreaker', 84 | 'jaywalk', 85 | 'jazziest', 86 | 'jazzy', 87 | 'jelly', 88 | 'jigsaw', 89 | 'jinx', 90 | 'jiujitsu', 91 | 'jockey', 92 | 'jogging', 93 | 'joking', 94 | 'jovial', 95 | 'joyful', 96 | 'juicy', 97 | 'jukebox', 98 | 'jumbo', 99 | 'kayak', 100 | 'kazoo', 101 | 'keyhole', 102 | 'khaki', 103 | 'kilobyte', 104 | 'kiosk', 105 | 'kitsch', 106 | 'kiwifruit', 107 | 'klutz', 108 | 'knapsack', 109 | 'larynx', 110 | 'lengths', 111 | 'lucky', 112 | 'luxury', 113 | 'lymph', 114 | 'marquis', 115 | 'matrix', 116 | 'megahertz', 117 | 'microwave', 118 | 'mnemonic', 119 | 'mystify', 120 | 'naphtha', 121 | 'nightclub', 122 | 'nowadays', 123 | 'numbskull', 124 | 'nymph', 125 | 'onyx', 126 | 'ovary', 127 | 'oxidize', 128 | 'oxygen', 129 | 'pajama', 130 | 'peekaboo', 131 | 'phlegm', 132 | 'pixel', 133 | 'pizazz', 134 | 'pneumonia', 135 | 'polka', 136 | 'pshaw', 137 | 'psyche', 138 | 'puppy', 139 | 'puzzling', 140 | 'quartz', 141 | 'queue', 142 | 'quips', 143 | 'quixotic', 144 | 'quiz', 145 | 'quizzes', 146 | 'quorum', 147 | 'razzmatazz', 148 | 'rhubarb', 149 | 'rhythm', 150 | 'rickshaw', 151 | 'schnapps', 152 | 'scratch', 153 | 'shiv', 154 | 'snazzy', 155 | 'sphinx', 156 | 'spritz', 157 | 'squawk', 158 | 'staff', 159 | 'strength', 160 | 'strengths', 161 | 'stretch', 162 | 'stronghold', 163 | 'stymied', 164 | 'subway', 165 | 'swivel', 166 | 'syndrome', 167 | 'thriftless', 168 | 'thumbscrew', 169 | 'topaz', 170 | 'transcript', 171 | 'transgress', 172 | 'transplant', 173 | 'triphthong', 174 | 'twelfth', 175 | 'twelfths', 176 | 'unknown', 177 | 'unworthy', 178 | 'unzip', 179 | 'uptown', 180 | 'vaporize', 181 | 'vixen', 182 | 'vodka', 183 | 'voodoo', 184 | 'vortex', 185 | 'voyeurism', 186 | 'walkway', 187 | 'waltz', 188 | 'wave', 189 | 'wavy', 190 | 'waxy', 191 | 'wellspring', 192 | 'wheezy', 193 | 'whiskey', 194 | 'whizzing', 195 | 'whomever', 196 | 'wimpy', 197 | 'witchcraft', 198 | 'wizard', 199 | 'woozy', 200 | 'wristwatch', 201 | 'wyvern', 202 | 'xylophone', 203 | 'yachtsman', 204 | 'yippee', 205 | 'yoked', 206 | 'youthful', 207 | 'yummy', 208 | 'zephyr', 209 | 'zigzag', 210 | 'zigzagging', 211 | 'zilch', 212 | 'zipper', 213 | 'zodiac', 214 | 'zombie', 215 | ] -------------------------------------------------------------------------------- /Beginner_Projects/014_HigherLower/game_data.py: -------------------------------------------------------------------------------- 1 | data = [ 2 | { 3 | 'name': 'Instagram', 4 | 'follower_count': 346, 5 | 'description': 'Social media platform', 6 | 'country': 'United States' 7 | }, 8 | { 9 | 'name': 'Cristiano Ronaldo', 10 | 'follower_count': 215, 11 | 'description': 'Footballer', 12 | 'country': 'Portugal' 13 | }, 14 | { 15 | 'name': 'Ariana Grande', 16 | 'follower_count': 183, 17 | 'description': 'Musician and actress', 18 | 'country': 'United States' 19 | }, 20 | { 21 | 'name': 'Dwayne Johnson', 22 | 'follower_count': 181, 23 | 'description': 'Actor and professional wrestler', 24 | 'country': 'United States' 25 | }, 26 | { 27 | 'name': 'Selena Gomez', 28 | 'follower_count': 174, 29 | 'description': 'Musician and actress', 30 | 'country': 'United States' 31 | }, 32 | { 33 | 'name': 'Kylie Jenner', 34 | 'follower_count': 172, 35 | 'description': 'Reality TV personality and businesswoman and Self-Made Billionaire', 36 | 'country': 'United States' 37 | }, 38 | { 39 | 'name': 'Kim Kardashian', 40 | 'follower_count': 167, 41 | 'description': 'Reality TV personality and businesswoman', 42 | 'country': 'United States' 43 | }, 44 | { 45 | 'name': 'Lionel Messi', 46 | 'follower_count': 149, 47 | 'description': 'Footballer', 48 | 'country': 'Argentina' 49 | }, 50 | { 51 | 'name': 'Beyoncé', 52 | 'follower_count': 145, 53 | 'description': 'Musician', 54 | 'country': 'United States' 55 | }, 56 | { 57 | 'name': 'Neymar', 58 | 'follower_count': 138, 59 | 'description': 'Footballer', 60 | 'country': 'Brasil' 61 | }, 62 | { 63 | 'name': 'National Geographic', 64 | 'follower_count': 135, 65 | 'description': 'Magazine', 66 | 'country': 'United States' 67 | }, 68 | { 69 | 'name': 'Justin Bieber', 70 | 'follower_count': 133, 71 | 'description': 'Musician', 72 | 'country': 'Canada' 73 | }, 74 | { 75 | 'name': 'Taylor Swift', 76 | 'follower_count': 131, 77 | 'description': 'Musician', 78 | 'country': 'United States' 79 | }, 80 | { 81 | 'name': 'Kendall Jenner', 82 | 'follower_count': 127, 83 | 'description': 'Reality TV personality and Model', 84 | 'country': 'United States' 85 | }, 86 | { 87 | 'name': 'Jennifer Lopez', 88 | 'follower_count': 119, 89 | 'description': 'Musician and actress', 90 | 'country': 'United States' 91 | }, 92 | { 93 | 'name': 'Nicki Minaj', 94 | 'follower_count': 113, 95 | 'description': 'Musician', 96 | 'country': 'Trinidad and Tobago' 97 | }, 98 | { 99 | 'name': 'Nike', 100 | 'follower_count': 109, 101 | 'description': 'Sportswear multinational', 102 | 'country': 'United States' 103 | }, 104 | { 105 | 'name': 'Khloé Kardashian', 106 | 'follower_count': 108, 107 | 'description': 'Reality TV personality and businesswoman', 108 | 'country': 'United States' 109 | }, 110 | { 111 | 'name': 'Miley Cyrus', 112 | 'follower_count': 107, 113 | 'description': 'Musician and actress', 114 | 'country': 'United States' 115 | }, 116 | { 117 | 'name': 'Katy Perry', 118 | 'follower_count': 94, 119 | 'description': 'Musician', 120 | 'country': 'United States' 121 | }, 122 | { 123 | 'name': 'Kourtney Kardashian', 124 | 'follower_count': 90, 125 | 'description': 'Reality TV personality', 126 | 'country': 'United States' 127 | }, 128 | { 129 | 'name': 'Kevin Hart', 130 | 'follower_count': 89, 131 | 'description': 'Comedian and actor', 132 | 'country': 'United States' 133 | }, 134 | { 135 | 'name': 'Ellen DeGeneres', 136 | 'follower_count': 87, 137 | 'description': 'Comedian', 138 | 'country': 'United States' 139 | }, 140 | { 141 | 'name': 'Real Madrid CF', 142 | 'follower_count': 86, 143 | 'description': 'Football club', 144 | 'country': 'Spain' 145 | }, 146 | { 147 | 'name': 'FC Barcelona', 148 | 'follower_count': 85, 149 | 'description': 'Football club', 150 | 'country': 'Spain' 151 | }, 152 | { 153 | 'name': 'Rihanna', 154 | 'follower_count': 81, 155 | 'description': 'Musician and businesswoman', 156 | 'country': 'Barbados' 157 | }, 158 | { 159 | 'name': 'Demi Lovato', 160 | 'follower_count': 80, 161 | 'description': 'Musician and actress', 162 | 'country': 'United States' 163 | }, 164 | { 165 | 'name': "Victoria's Secret", 166 | 'follower_count': 69, 167 | 'description': 'Lingerie brand', 168 | 'country': 'United States' 169 | }, 170 | { 171 | 'name': 'Zendaya', 172 | 'follower_count': 68, 173 | 'description': 'Actress and musician', 174 | 'country': 'United States' 175 | }, 176 | { 177 | 'name': 'Shakira', 178 | 'follower_count': 66, 179 | 'description': 'Musician', 180 | 'country': 'Colombia' 181 | }, 182 | { 183 | 'name': 'Drake', 184 | 'follower_count': 65, 185 | 'description': 'Musician', 186 | 'country': 'Canada' 187 | }, 188 | { 189 | 'name': 'Chris Brown', 190 | 'follower_count': 64, 191 | 'description': 'Musician', 192 | 'country': 'United States' 193 | }, 194 | { 195 | 'name': 'LeBron James', 196 | 'follower_count': 63, 197 | 'description': 'Basketball player', 198 | 'country': 'United States' 199 | }, 200 | { 201 | 'name': 'Vin Diesel', 202 | 'follower_count': 62, 203 | 'description': 'Actor', 204 | 'country': 'United States' 205 | }, 206 | { 207 | 'name': 'Cardi B', 208 | 'follower_count': 67, 209 | 'description': 'Musician', 210 | 'country': 'United States' 211 | }, 212 | { 213 | 'name': 'David Beckham', 214 | 'follower_count': 82, 215 | 'description': 'Footballer', 216 | 'country': 'United Kingdom' 217 | }, 218 | { 219 | 'name': 'Billie Eilish', 220 | 'follower_count': 61, 221 | 'description': 'Musician', 222 | 'country': 'United States' 223 | }, 224 | { 225 | 'name': 'Justin Timberlake', 226 | 'follower_count': 59, 227 | 'description': 'Musician and actor', 228 | 'country': 'United States' 229 | }, 230 | { 231 | 'name': 'UEFA Champions League', 232 | 'follower_count': 58, 233 | 'description': 'Club football competition', 234 | 'country': 'Europe' 235 | }, 236 | { 237 | 'name': 'NASA', 238 | 'follower_count': 56, 239 | 'description': 'Space agency', 240 | 'country': 'United States' 241 | }, 242 | { 243 | 'name': 'Emma Watson', 244 | 'follower_count': 56, 245 | 'description': 'Actress', 246 | 'country': 'United Kingdom' 247 | }, 248 | { 249 | 'name': 'Shawn Mendes', 250 | 'follower_count': 57, 251 | 'description': 'Musician', 252 | 'country': 'Canada' 253 | }, 254 | { 255 | 'name': 'Virat Kohli', 256 | 'follower_count': 55, 257 | 'description': 'Cricketer', 258 | 'country': 'India' 259 | }, 260 | { 261 | 'name': 'Gigi Hadid', 262 | 'follower_count': 54, 263 | 'description': 'Model', 264 | 'country': 'United States' 265 | }, 266 | { 267 | 'name': 'Priyanka Chopra Jonas', 268 | 'follower_count': 53, 269 | 'description': 'Actress and musician', 270 | 'country': 'India' 271 | }, 272 | { 273 | 'name': '9GAG', 274 | 'follower_count': 52, 275 | 'description': 'Social media platform', 276 | 'country': 'China' 277 | }, 278 | { 279 | 'name': 'Ronaldinho', 280 | 'follower_count': 51, 281 | 'description': 'Footballer', 282 | 'country': 'Brasil' 283 | }, 284 | { 285 | 'name': 'Maluma', 286 | 'follower_count': 50, 287 | 'description': 'Musician', 288 | 'country': 'Colombia' 289 | }, 290 | { 291 | 'name': 'Camila Cabello', 292 | 'follower_count': 49, 293 | 'description': 'Musician', 294 | 'country': 'Cuba' 295 | }, 296 | { 297 | 'name': 'NBA', 298 | 'follower_count': 47, 299 | 'description': 'Club Basketball Competition', 300 | 'country': 'United States' 301 | } 302 | ] 303 | --------------------------------------------------------------------------------