Days_18 Guess the Number
Ari Wira Saputra
Posted on April 1, 2023
We are going to build a "Guess the Number" guessing game.
You are going to use a while loop and some of the concepts from the past few days.
- Start by picking a number between 0 and 1,000,000. This will be your first variable.
- Create a while loop to keep asking the user to guess your number.
- If they are too low, tell them "too low." If they guess too high tell, them "too high."
- If the user guesses correctly, tell them they are a winner (maybe add a fun emoji too!) 5.Count the number of attempts it took for the user to guess number. Make sure you only show that after they get the answer correct.
# Let's Cheat Continue
#
#29 MARCH 2023
class challenge18():
def __init__(self, number, testing):
self.number = number
self.testing = testing
def methode(self):
self.number = 50
while self.testing in range(0, 100):
if self.testing > self.number:
print("angka sangat besar")
elif self.testing < self.number:
print("angka sangat kecil")
def call():
testing = challenge18(input("masukan angka"))
testing.methode()
call()
💖 💪 🙅 🚩
Ari Wira Saputra
Posted on April 1, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
githubcopilot AI Innovations at Microsoft Ignite 2024 What You Need to Know (Part 2)
November 29, 2024