Python Control Structures Activities
1. Write a Python program that takes a number as input and determines
whether it is positive, negative, or zero. Use if, else, and elif statements
for decision-making.
2. Write a Python program that takes a user's age as input and prints whether
they are eligible to vote or not (considering the legal voting age is 18).
3. Implement a program that classifies a given angle (input in degrees)
into categories such as acute, right, obtuse, or invalid.
4. Write a program that takes coefficients of a quadratic equation as input
and solves for the roots. Handle both real and complex roots.
5. Write a program that checks if a given year is a leap year or not.
Implement the logic for leap years (divisible by 4 but not by 100 unless
also divisible by 400).
6. Implement a program that prints the multiplication table for a given
number. Allow the user to input the number.
7. Write a Python program that calculates the factorial of a given number
using a loop. Take the number as input.|
8. Develop a program that prints the Fibonacci sequence up to a certain
number of terms. Allow the user to input the number of terms.
9. Write a program to calculate the sum of all prime numbers within a
given range (input by the user).
10. Develop a program that takes numbers as input and calculates the
sum until it encounters a negative number, using the break statement.