# This is a guess the number game.
import random
secretNumber = random.randint(1, 20)
print('I am thinking of a number between 1 and 20.')

# Ask the player to guess 6 times.
for guessesTaken in range(1, 7):
    print('Take a guess.')
    guess = int(input())

    if guess < secretNumber:
        print('Your guess is too low.')
    elif guess > secretNumber:
        print('Your guess is too high.')
    else:
        break  # This condition is the correct guess!

if guess == secretNumber:
    print('Good job! You guessed my number in ' + str(guessesTaken) + ' guesses!')
else:
    print('Nope. The number I was thinking of was ' + str(secretNumber))


@@ -1,14 +1,33 @@
-# 
+%22%22%22Guess the number%0A%0A
 This is a gu
@@ -47,16 +47,76 @@
 r game.%0A
+%0ANote:%0A    Numbers between 1 and 20.%0A%0A%22%22%22%0A%0A%0Adef main():%0A    
 import r
@@ -121,16 +121,20 @@
  random%0A
+    
 secretNu
@@ -162,16 +162,20 @@
 (1, 20)%0A
+    
 print('I
@@ -220,16 +220,20 @@
  20.')%0A%0A
+    
 # Ask th
@@ -259,16 +259,20 @@
  times.%0A
+    
 for gues
@@ -296,24 +296,28 @@
 (1, 7):%0A    
+ 
+   
 print('Take 
@@ -331,16 +331,20 @@
 .')%0A    
+   
+ 
 guess = 
@@ -357,16 +357,20 @@
 put())%0A%0A
+    
     if g
@@ -390,32 +390,36 @@
 Number:%0A        
+ 
+   
 print('Your gues
@@ -438,16 +438,20 @@
 .')%0A    
+  
+  
 elif gue
@@ -461,32 +461,36 @@
 %3E secretNumber:%0A
+    
         print('Y
@@ -510,24 +510,28 @@
 too high.')%0A
+    
     else:%0A  
@@ -536,16 +536,20 @@
         
+  
+  
 break  #
@@ -587,16 +587,20 @@
 guess!%0A%0A
+    
 if guess
@@ -613,24 +613,28 @@
 cretNumber:%0A
+    
     print('G
@@ -704,22 +704,30 @@
 sses!')%0A
+    
 else:%0A
+    
     prin
@@ -788,12 +788,51 @@
 etNumber))%0A%0A
+%0Aif __name__ == '__main__':%0A    main()%0A

Update P11_guessTheNumber.py added docstring and wrapped in main() function