Here you got every thing related with technology and coding in which python is best
import random
def guess_the_number():
print("Welcome to Guess the Number!")
secret_number = random.randint(1, 20)
for attempts in range(1, 6):
guess = int(input("Take a guess (between 1 and 20): "))
if guess < secret_number:
print("Too low! Try again.")
elif guess > secret_number:
print("Too high! Try again.")
else:
print(f"Congratulations! You guessed the number in {attempts} attempts.")
break
else:
print(f"Sorry, the number was {secret_number}. Better luck next time!")
if __name__ == "__main__":
guess_the_number()