Hello Le Wagon ๐
Hello Le Wagon ๐
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pygame | |
| import random | |
| #colours | |
| white = [255, 255, 255] | |
| black = [0, 0, 0] | |
| red = [255, 0, 0] | |
| blue = [0, 0, 255] | |
| green = [0, 255, 0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| while True: | |
| chosen_number = 0 | |
| while chosen_number < 1: | |
| try: | |
| chosen_number = int(input("Please enter a number greater than 1: ")) | |
| except ValueError: | |
| print('The number must be an integer!') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| already_guessed = '' | |
| word_list = ['heineken', 'mouse', 'popcorn'] | |
| play_game = True | |
| def guess_letter(): | |
| # verifies that user input is a letter and that it hasnt been input before |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| def ask_for_int(): | |
| while True: | |
| try: | |
| guess = int(input('Guess the number: ')) | |
| except ValueError: | |
| print('The input needs to be an integer') | |
| else: | |
| return guess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| while True: | |
| roll_dice = input("would you like to roll the dice? (y/n): ").lower() | |
| while roll_dice != 'y' and roll_dice != 'n': | |
| roll_dice = input("please enter y or n: ") | |
| if roll_dice == 'y': |