From ae9db8cf861cc0975cec3ef41008d79e929e56c8 Mon Sep 17 00:00:00 2001 From: anyin233 Date: Tue, 9 Jun 2020 22:18:43 +0800 Subject: [PATCH] first commit --- source.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 source.py diff --git a/source.py b/source.py new file mode 100644 index 0000000..4cc9936 --- /dev/null +++ b/source.py @@ -0,0 +1,18 @@ +from random import randint + +def guess_num(): + target = randint(0, 65535) + num = int(input()) + while True: + if num < target: + print("too small") + elif num == target: + print("done") + break + elif num > target: + print("too big") + num = int(input()) + +if __name__ == "__main__": + guess_num() +