You are on page 1of 1

National Institute of Electronics & Information Technology (NIELIT) Kolkata

Jadavpur University Campus


Kolkata – 700 032

A3-R5/M3-R5: Programming and Problem Solving through Python


Assignment on Python#2

1. Write a Python program to check whether a user given integer number is odd or
even.
2. Write a Python program that aaccepts two integer values from the user and display their product. If
the product is greater than 1000, then display their sum.
3. Write a Python program that will accept name of a fruit from user and display an or a followed by
fruit name according to English grammar.
4. Write a Python program which will accept a year (in 4 digits) and check whether is it leap year or npt.
5. Write a Python program to calculate roots of the quadratic equation ax2+bx+c=0. Your program
should accept values for a, b and c from user and display all real roots. If roots are imaginary the the
program should display proper message.
6. Write a Python program which will accept marks for 4 subjects (out of 100) from user and calculate
corresponding grade on the basis of percentage of marks on aggregate using following logic:
% of Marks Grade
>=85 S
>=75 to <85 A
>=65 to <75 B
>=55 to <65 C
>=50 to <55 D
Below 50 F
7. Write a Python program which will accept a character from user and check whether is it vowel or
consonant or digit or special character.
8. Write a Python program will accept a string from user and check whether is it palindrome string or
not.
9. Write a Python program will accept number of seconds from user display it in hours, minutes and
seconds (suppress the part which is zero).
Hint: if user has enter 3663 seconds then output will be 1 Hour 1 Minute 3 Seconds. But if the input is
72 seconds then output will be 1 Minute 12 Seconds.
10. Modify the program given in Q.3 so that it can display imaginary roots as complex numbers.

Page 1 of 1

You might also like