Assignment 1 Py
Assignment 1 Py
1. Simple Calculator
Write a Python program that takes two numbers and an operator as input from the
user and performs the corresponding arithmetic operation (+, -, *, /).
Use conditional statements (if, elif, else) to check which operation to perform.
3. Multiplication Table
Write a program that asks the user for a number and then prints the multiplication
table for that number up to 10.
Use a for loop to generate the table.
4. FizzBuzz Problem
5. Factorial Calculation
Write a program to calculate the factorial of a given number using a while or for
loop.
6. Palindrome Checker
Write a program to check if a given string or number is a palindrome (reads the same
forward and backward).
Use conditions and loops to reverse the input and compare it with the original.
Write a program that generates the Fibonacci sequence up to a given number of terms.
Use a loop to compute each term by adding the two previous terms in the sequence.
8. Grade Calculator
Ask the user for the number of rows and print a right-aligned triangle pattern using
asterisks (*).
Example for 5 rows:
*
**
***
****
*****