File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ import random
2
+
3
+ secret_number = random .randint (1 , 20 )
4
+
5
+ print ("I'm thinking a number between 1 to 20" )
6
+
7
+ for guesses_taken in range (1 , 7 ):
8
+ print ('Guess the number: ' )
9
+ guess = int (input ())
10
+
11
+ if guess > secret_number :
12
+ print ('Your guess is too high' )
13
+
14
+ elif guess < secret_number :
15
+ print ('Your guess is too low' )
16
+
17
+ else :
18
+ break
19
+
20
+ if guess == secret_number :
21
+ print (f'You Won! You guess my number in { guesses_taken } guesses.' )
22
+
23
+ else :
24
+ print (f'Nope. The number I was thinking of was { secret_number } ' )
Original file line number Diff line number Diff line change
1
+ from instapy_cli import client
2
+ from textwrap import dedent
3
+
4
+ username = 'atulkumar.98'
5
+
6
+ password = 'ABCD@1234'
7
+
8
+ img = 'IMG.jpg'
9
+
10
+ text = dedent ("""This picture uploaded with python code on instagram' +
11
+ '\r \n ' + '#pythoncode #programming
12
+ """ )
13
+
14
+ with client (username , password ) as cli :
15
+ cli .upload (img , text )
You can’t perform that action at this time.
0 commit comments