Prerana Educational and Social Trust®
PES Institute of Technology & Management
NH-206,Sagar Road,Shivamogga-577204
Department of Computer Science and Engineering
ASSIGNMENT 1
2022-23
Academic Year Semester II (CSE stream)
Introduction to Python Programming
Course
BPLCK105B
University Course Code
[Link] S
Course Instructor
ASSIGNMENT -2 PYTHON FLOW CONTROL STATEMENTS
Develop programs in Python to
1) Check whether a given number is even or odd.
2) Check whether a given number is divisible by 9 or not
3) Find the biggest of three numbers .
4) Ask the user to enter a number that is under20. If they enter a number that is 20 ormore,
display the message “Too high”, otherwise display “Thank you”.
5) Ask the user to enter their favorite colour. If they enter “red”, “RED” or “Red” display the
message “I like red too”, otherwise display the message “I don’t like [colour], I prefer
red”.
6) Ask the user to enter 1, 2 or 3. If they enter a 1, display the message “Thank you”, if they
enter a 2, display “Well done”, if they enter a 3, display “Correct”. If they enter anything
else, display “Error message”.
7) Ask the user to enter their name and then display their name three times using for loop .
8) Find the sum of n natural odd numbers
9) Find the factorial of a number using while loop
10) Ask how many people the user wants to invite to a party. If they enter a number
below10, ask for the names and after each name display “[name] has been invited”. If
they enter a number which is 10 or higher, display the message “Too many people”.
11) Print n natural even numbers
12) Print the multiplication table of a given number .
13) Find the roots of a quadratic equation
Prerana Educational and Social Trust®
PES Institute of Technology & Management
NH-206,Sagar Road,Shivamogga-577204
Department of Computer Science and Engineering
Finnd the roots of a quadratic equation
Course Instructor HOD