Have fun and give it your best shot!
These puzzles may be hard, and that's okay. Keep on giving it your best work, and you'll get it. Remember, Google and Stack Overflow are your friends.
CONTENTS
Clone this repo either to your local machine or to Repl.it (https://repl.it/languages/python3). If you would like to save your work on Repl.it, make sure to sign in before visiting the link. Remember to use the command $ git clone https://github.com/peternielsen112/puzzles.git
in Git Bash. REMEMBER TO BE IN THE PROPER DIRECTORY.
a) Prompts the user to write a list of words (for example, ['apple', 'mango', 'cashew']).
b) Once the list has been entered, the program will ask for a word to search for.
c) The program will then say the number of times the word was found in the list, or display a message that the word wasn't found. For example: "___ was found 3 times" or "___ wasn't found."
The code for this program should be placed in the file list-check.py. You may want to check the hints on this one, because there's some complicated input logic.
a) Prompts the user to give a number, an INTEGER only.
b) Prints every number up to the given number.
c) Gives the time it took to print every number up to the user's number.
The code for this program should be placed in the file number-counter.py.
a) Chooses a random number between 1 and 100
b) While the player or user has not guessed the number (use
input
) print if their latest guess is higher or lower
c) Counts the number of guesses the player takes
d) And finally, tells the user they were right (when they guess the right number), tells them the number, and the number of tries they needed.
The code for this program should be placed in the file guessing-game.py.
In these puzzles, you learned basic logic of if
, else
, and while
. You also learned about modules, and more specifically, the time
and random
modules and how to use them, if at least minimally. You learned about f
strings and you built three programs that created specific functions. After break, we'll do more in Python and work through how to create more complex programs.