From 0e43fc6762e4867eeaa5c24a6a0835ce27965dc4 Mon Sep 17 00:00:00 2001 From: AviBansal-31 <60013850+AviBansal-31@users.noreply.github.com> Date: Thu, 15 Oct 2020 23:40:50 +0530 Subject: [PATCH] Update week3-notes.py --- notes/week3-notes.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/notes/week3-notes.py b/notes/week3-notes.py index e7bb54d..4a1a3f5 100644 --- a/notes/week3-notes.py +++ b/notes/week3-notes.py @@ -1,28 +1,14 @@ -n = 5 -while n<= 5 - print("counting down:{}".format(n)) -# n-- - n -= 1 -else: - print("we got to zero") - -import random -number = random.randint(0,101) -print(number) -print("let the game begin") - -guess = int(input('\nPlease input a number')) -while True: - if number == guess: +if number == guess: break elif number < guess: print('bigger') + print('You guessed a bigger number') else: print('smaller') + print('You guessed a smaller number') guess = int(input("please guess again")) print("correct") - import random n = random.randint(1,4) counter = 0 @@ -37,4 +23,4 @@ print('loop2:{0}'.format(counter2)) else: break - print('loop1:{0}'.format(counter1)) + print('loop1:{0}'.format(counter1)