python(assignment-1)
python(assignment-1)
SESSION: 2024-25
1
1. Write a Python program to perform addition, subtraction,
multiplication, and division of two numbers entered by the user.
Input: Written code
Output:
Output:
2
3. Write a Python program using logical operators to check if a number
lies between two other numbers. Take all three numbers in the input and
check the above for the third input.
Input: Written code
Output:
Output:
3
5. Write a Python program to categorize a given integer as positive,
negative, or zero using an if-elif-else ladder.
Input: Written code
Output:
Output:
4
7. Write a Python script using a for loop to print the first 10 natural
prime numbers.
Output:
8. Using a while loop, write a program that prints the Fibonacci series up to
a given number.
Output:
5
Input: Written code
Output: