Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

python(assignment-1)

Uploaded by

Gaming World
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

python(assignment-1)

Uploaded by

Gaming World
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

COER UNIVERSITY ROORKEE

SESSION: 2024-25

Course Title: Python Programming


Course Code: USC-003

Submitted By: Submitted To:


Piyush Dubey Mr. Shivam Kumar
B. Tech (Mechanical Engg.) Sir
IInd Year (IIIrd Sem.)
CU ID. CU23960002

1
1. Write a Python program to perform addition, subtraction,
multiplication, and division of two numbers entered by the user.
Input: Written code

Output:

2. Using conditional operators, write a Python script to check if a number is


even or odd.
Input: Written code

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:

4. Write a Python program using if-else to find the largest of three


numbers.
Input: Written code

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:

6. Using nested if statements, write a Python program to check if a number


is both divisible by 5 and even.
Input: Written code

Output:

4
7. Write a Python script using a for loop to print the first 10 natural
prime numbers.

Input: Written code

Output:

8. Using a while loop, write a program that prints the Fibonacci series up to
a given number.

Input: Written code

Output:

9. Write a Python program that breaks out of a loop when a user


enters a negative number.

5
Input: Written code

Output:

You might also like