Hello everyone, i started learning python not so long ago and it's the first language im learning and also the only experience i have with programming/coding, as you will be able to tell by looking at the first code i ever wrote on my own (without any help), i liked doing everything on my own but now i want some opinions and feedback + recommendations on how this code could be better, i know it could potentially be alot shorter and cleaner atleast.
import random
"""Numpad MineSweeper"""
number = random.randint(1, 9)
points = 0
guess = 0
guesses = [1, 2, 3, 4, 5, 6, 7, 8, 9]
while guess != number:
guess = int(input("Press a number! (1 to 9) "))
if guess <= 0 or guess > 9:
print("Invalid")
elif guess in guesses:
guesses.remove(guess)
points += 1
else:
print(f"You already clicked {guess} ")
print(guesses)
print(f"Points: {points}")
if points >= 8:
print("You win!! ")
break
else:
print(f"BOOM!!! {number} was the bomb. Points: {points}")