# number guessing game
import random
# random numbers from 1 to 100
secret_number = random.randint(1, 100)
# your guess
guess = 0
# number of guess
tries = 0
max_tries = 7
print("Welcome to the number guessing game.")
print("I am thinking of a number between 1 and 100.")
print("I will give " + str(max_tries) + " tries to get it. Good luck!")
while (guess != secret_number) and (tries < max_tries):
guess = int(input("What is your guess? "))
if guess > secret_number:
print("That is too HIGH.")
elif guess < secret_number:
print("That is too LOW.")
tries = tries + 1
if guess == secret_number:
print("You guessed my number!")
print("##############################")
print(" Congratulations! ")
print("##############################")
else:
print("Better luck next time")
print("The secret number was", secret_number)
Reference:
https://youtu.be/7CTONNO6YMc
The Financial Journal is a blog for all financial industry professionals. This blog has been, and always will be, interactive, intellectually stimulating, and open platform for all readers.
AdSense
Subscribe to:
Post Comments (Atom)
Deep Learning (Regression, Multiple Features/Explanatory Variables, Supervised Learning): Impelementation and Showing Biases and Weights
Deep Learning (Regression, Multiple Features/Explanatory Variables, Supervised Learning): Impelementation and Showing Biases and Weights ...
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg64CojFNo8-Rwia310ifg_Gzcz6k0DamzEAiNPD13F_a1COG04Mg2wh9xYXCDhQEajUhkl7wLLvKQVfp_eatctodfZnIl1yvINxxPVxaaDqM4qb0ukUEtJG66XKrDFdM4XfuZ6yfcRdNCb/s320/Fig_1_Loss.png)
-
This is a great paper to understand having and applying principles to day-to-day business and personal lives. If you do not have your own ...
-
0_MacOS_Python_setup_for_Quandl.txt # Go to: https://www.quandl.com/ # Sign up / in with your email address and password # Run Termina...
-
MSCI INTEGRATED FACTOR CROWDING MODEL Assessing Crowding Risks in Equity Factor Strategies https://www.msci.com/documents /10199/acf506d5-4...
No comments:
Post a Comment