Skip to main content
3 of 3
title and tags
rolfl
  • 97.5k
  • 17
  • 218
  • 418

Random number guessing

Is there anything specifically bad here, or anything that I could improve? Wasted lines of code, things done in a more memory intensive way than it could be, etc.

from random import*
b = 10
a = randint(1,b)
point = 1
x = 1
while x < 2:
    print("Guess a number between 1 and ", b)
    svar = int (input())
    if svar == a:
            b+=5
            point= point+point
            a = randint (1,b)
            print("You have ", point, "points!")
    elif svar < a:
            print("Higher")
    else:
            print("Lower")