Professional Documents
Culture Documents
13 D X
File Edit Format Run Options Window Help File Shell Debug Options Window Help
Edit
t e xe r c i se 1 • Python 3 . 9.13 (tag s / v3. 9 . 13:6de2ca5, May 17 2022, 1 6 : 36 : 42 ) [MSC v . 1929 64 bit (A •
a=int (inpu t ( "enter the number " )) MD64) ] on win32
if (a=l) : Type "help" , "copyrigh t", "credit s " o r " l i ce nse () " f or mo re info rma t i on.
print (" January" ) »>
e lif (a=2 ) : - - - - - - RE START : C: \Use r s\babua\OneDr i ve\Desktop \tes t . py - - - - - -
print (" February" ) enter the number : 5
elif (a==3) : May
print ("March" ) >>> I
elif (a=:4) :
print (" April" )
e lif (a:::=5) :
print ("May " )
elif (a==6 ) :
print (" June" )
elif (a :::7):
print (" July" )
elif (a==S):
print (" August" )
•lif <•==9):
print <" September" )
elif (a==lO):
print ("Octo ber" )
elif (a ==ll):
print ("No vember" )
e lif (a =:ai:12):
print (" Dec efl\ber" )
t!lse :
print (" invalid number" )
....~ ur c
- Bew0lkt II Q Search
l) test.py - C:\Users\ba bua\OneDrive\Desktop\testpy (3.9.13) D X ~ IDU Shell 3.9.13 D X
File Edit Format Run Options Window Help File Edit Shell Debug Options Windo w Help
n=int (input ( "ent er t.he a ge : " ) ) Python 3. 9 . 13 (cag s / v 3 . 9 . 13 : 6de2ca 5 , May 17 2022, 1 6 : 36 : 42) (MSC v . 1929 64 bi t ( •
if (n<=16 ) : AMD6 4 ) ] on -...in32
print ("yo u r tic ket cost i s 3" ) Type "hel p", "copyr i ghc", " c r edi ts " o r "license () " f o r more information .
elif (n>=60 ) : »>
print (" your cicke t c ost is 2" ) - - - - - - RESTART: C: \Use r s\babua \OneDr ive\Oesktop\tes t . py - - - - - -
e lse : encer che age : 65
print ("yo u r cic ke t cost is 6" ) your c icket cost is : 2
»>
AMD64) I on
Edit
win32
Shell Window Help
Debug Options
---
Python 3.9.13 (tags/v3 . 9 .13: 6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit ( .
print (i) Type "help", "copyright ", "credits" o r "license()" f or more information.
»>
9
RESTART: C : \Users\babua \OneDrive\Desktop\ test . py ----===
8
7
6
5
4
3
2
1
0
»>
ln:2 Col:23
. .
Ln: 15 Col:4
,--., 1o·c
- BewOlkt
II Q Search
•=O
1.. o o ID ra rzSJ r®l
l) test.py - C:\Users\babua\OneDrive\Desktop\testpy (3.9.13) D X l} IDLE Shell 3.9.13 D X
File Edit Format Run Options Window Help File Edit Shell Debug Options Window Help
#exercise 5 Python 3.9 . 13 (tags/v3 . 9 .13 : 6de2ca 5 , May 17 2022, 1 6: 36 :42 ) [MSC v.1929 6 4 bit (
n=int{ input {"e nte r the numbe r o f r OTJ " )) AMD64) ] on win32
for i in range (0 , n) : Type "help", "copyrigh t", "credits" o r "license() " for more i nforma t i on .
for j in range (O,i+l) : »>
print (" * " , end= "" ) - - - - - - RESTART : C : \ Us e r s\ba bua \OneDrive\Desktop\test .py - - - - - -
print ( ' \r ' ) enter the number o f row 6
»> I
ENG
r ...... 9 "(
- Bew61kt Q Search 0 0 Ill 11 r2SI IN