I'm a beginner trying to improve my Python skills. I've found a very similar question to mine but since the source code was different, it did no benefit. Here is the link for the question: ValueError: invalid literal for int() with base 10: '' Anyways, here is my code:
correct_answer= 41
guess = int(input("Guess the number"))
if int(input()) == correct_answer:
print ("You found my number!")
if int (input()) >= correct_answer:
print ("My number is lower.")
if int (input()) <= correct_answer:
print ("My number is higher.")
else:
print ("You didn't write any numbers!")
Here, I wanted to write a simple guessing game. The number computer has in mind is 41, and the user has to guess the number after "Guess the number". If the input of a user is greater than 41, the program says "My number is lower" and if the input is smaller than 41, the program says "My number is greater." When I run this code, I get the "ValueError: invalid literal for int() with base 10: ''
Thank you in advance for helping me solve this problem :)