From 4a95719d58a708ad55b1389631d6339047f786a0 Mon Sep 17 00:00:00 2001 From: standenboy Date: Fri, 15 Dec 2023 10:19:20 +0000 Subject: added existing work --- comp/while/2.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 comp/while/2.py (limited to 'comp/while/2.py') diff --git a/comp/while/2.py b/comp/while/2.py new file mode 100755 index 0000000..7929862 --- /dev/null +++ b/comp/while/2.py @@ -0,0 +1,13 @@ +import random + +guess = -1 +ans = random.randint(1,100) + +while guess != ans: + guess = int(input("guess: ")) + if guess < ans: + print("higher") + elif guess > ans: + print("lower") + + -- cgit v1.2.3