Problem Solving using Computers
Lab Practice Assignment 2
07.12.2021
Q1. Write a program in Python to check whether a number is odd or even.
Q2. Write a program in Python to enter marks of five subjects and calculate total, average and
percentage.
Q3. Write a program in Python that asks the user to input lengths of three sides of a triangle and
i) prints whether it is a valid triangle or not
ii) If the triangle is valid, prints whether the triangle is equilateral, scalene or isosceles
Q4. Write a program in Python that accepts a character and does the following:
i) prints whether the character is a letter or a numeric digit or a special character
ii) if the character is a letter, prints whether the letter is upper case or lower case
iii) if the character is a numeric digit, prints its name in text (e.g., if input is 9, output is NINE)
Q5. Write a program in Python to find roots of a quadratic equation.
Q6. Write a program in Python that accepts an integer and returns a Boolean value. The function should
return true if the integer is greater than or equal to zero, and false otherwise.
Q7. Write a program in Python that accepts a character. If the character is an uppercase letter, the
function returns the next consecutive letter of the alphabet. If the character is a lowercase letter,
the function returns the previous consecutive letter of the alphabet. If the character is not a letter,
the function returns the question mark ('?') character and a message "Character not
found in the alphabet", is printed as output.