0% found this document useful (0 votes)
139 views

Python Assignment

The document contains 20 programming problems related to Python. Some of the problems include: writing a program to count even and odd numbers in a list, generating a nested pattern using loops, calculating the Fibonacci series between 0 and 50, and checking if a password meets certain validation criteria like containing a number and special character. Many of the problems involve basic Python concepts like loops, lists, strings, functions, conditionals etc.

Uploaded by

Bineesh23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
139 views

Python Assignment

The document contains 20 programming problems related to Python. Some of the problems include: writing a program to count even and odd numbers in a list, generating a nested pattern using loops, calculating the Fibonacci series between 0 and 50, and checking if a password meets certain validation criteria like containing a number and special character. Many of the problems involve basic Python concepts like loops, lists, strings, functions, conditionals etc.

Uploaded by

Bineesh23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python

1.WriteaPythonprogramtocountthenumberofevenandoddnumbersfromaseriesofnumbers.

amplenumbers:numbers=(1,2,3,4,5,6,7,8,9)

2.WriteaPythonprogramtoconstructthefollowingpattern,usinganestedforloop.

*
**
***
****
*****
****
***
**
*

3. WriteaPythonprogramtogettheFibonacciseriesbetween0to50.

Note:TheFibonacciSequenceistheseriesofnumbers:
0,1,1,2,3,5,8,13,21,....
Everynextnumberisfoundbyaddingupthetwonumbersbeforeit.

4. WriteaPythonprogramwhichiteratestheintegersfrom1to50.Formultiplesofthreeprint"Fizz"insteadofthenumberand
forthemultiplesoffiveprint"Buzz".Fornumberswhicharemultiplesofboththreeandfiveprint"FizzBuzz".

5.WriteaPythonprogramwhichtakestwodigitsm(row)andn(column)asinputandgeneratesatwodimensionalarray.The
elementvalueintheithrowandjthcolumnofthearrayshouldbei*j.
Note:
i=0,1..,m1
j=0,1,n1.

TestData:Rows=3,Columns=4

6.WriteaPythonprogramwhichacceptsasequenceofcommaseparated4digitbinarynumbersasitsinputandprintthe
numbersthataredivisibleby5inacommaseparatedsequence.GototheeditorSampleData:0100,0011,1010,1001,1100,1001

7.WriteaPythonprogramthatacceptsastringandcalculatethenumberofdigitsandletters.GototheeditorSampleData:
Python3.2

8.WriteaPythonprogramtoprintalphabetpattern'A'.

9. WriteaPythonprogramtocheckatriangleisequilateral,isoscelesorscalene.
Note:
Anequilateraltriangleisatriangleinwhichallthreesidesareequal.
Ascalenetriangleisatrianglethathasthreeunequalsides.
Anisoscelestriangleisatrianglewith(atleast)twoequalsides.

10.WriteaPythonprogramthatreadstwointegersrepresentingamonthanddayandprintstheseasonforthatmonthandday.

11.WriteaPythonprogramtodisplayastrologicalsignforgivendateofbirth.

12. WriteaPythonprogramtodisplaythesignoftheChineseZodiacforgivenyearinwhichyouwereborn

13.WriteaPythonprogramtocreatethemultiplicationtable(from1to10)ofanumber.

14.WriteaPythonprogramtocheckwhetheranalphabetisavowelorconsonant.

15. WriteaPythonprogramtocalculateadog'sageindog'syears.
Note:Forthefirsttwoyears,adogyearisequalto10.5humanyears.Afterthat,eachdogyearequals4humanyears..
16.WriteaPythonprogramtocheckthevalidityofpasswordinputbyusers
Validation:

Atleast1letterbetween[az]and1letterbetween[AZ].

Atleast1numberbetween[09].

Atleast1characterfrom[$#@].

Minimumlength6characters.

Maximumlength16characters.

17. WriteaPythonprogramthatprintseachitemanditscorrespondingtypefromthefollowinglist.
SampleList:datalist=[1452,11.23,1+2j,True,'w3resource',(0,1),[5,12],{"class":'V',"section":'A'}]

18.WriteaPythonprogramthatprintsallthenumbersfrom0to6except3and6.
Note:Use'continue'statement.

19.WriteaPythonprogramtoconverttemperaturestoandfromcelsius,fahrenheit.Gototheeditor[Formula:c/5=f32/9
[wherec=temperatureincelsiusandf=temperatureinfahrenheit]

20. WriteaPythonprogramtofindthosenumberswhicharedivisibleby7andmultipleof5,between1500and2700(both
included).

You might also like