0% found this document useful (0 votes)
2 views1 page

Python Assignment 2

The document outlines a series of programming assignments that include checking if a number is positive, negative, or zero, determining voting eligibility, finding the largest of two or three numbers, checking for leap years, and more. It also includes tasks for grade assignment based on marks, character type identification, creating a simple calculator, and classifying triangles by their side lengths. Each assignment focuses on fundamental programming concepts and logic.

Uploaded by

samipshirsat
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Assignment 2

The document outlines a series of programming assignments that include checking if a number is positive, negative, or zero, determining voting eligibility, finding the largest of two or three numbers, checking for leap years, and more. It also includes tasks for grade assignment based on marks, character type identification, creating a simple calculator, and classifying triangles by their side lengths. Each assignment focuses on fundamental programming concepts and logic.

Uploaded by

samipshirsat
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Assignment 2

1. Write a program to check whether a number is positive, negative, or zero.

2. Write a program to check whether a person is eligible to vote (age ≥ 18).

3. Write a program to find the largest of two numbers.

4. Write a program to find the largest of three numbers.

5. Write a program to check whether a year is a leap year or not.

6. Write a program to check whether a number is divisible by both 5 and 11.

7. Write a program to assign grades based on marks:

Marks ≥ 90 → Grade A
Marks ≥ 75 → Grade B
Marks ≥ 50 → Grade C
Marks < 50 → Fail

8. Write a program to check whether a character is:


Alphabet
Digit
Special character

9. Write a program to create a simple calculator:


Take two numbers and an operator (+, -, *, /)
Perform the corresponding operation

10. Write a program to determine the type of triangle based on side lengths:
Equilateral
Isosceles
Scalene

You might also like