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

Asnmt 2

About its assignment

Uploaded by

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

Asnmt 2

About its assignment

Uploaded by

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

25-07-2024 assignment questions

1.Write a Python program that checks whether a given number is positive, negative, or zero.

2.Write a Python program that takes an integer input from the user and checks whether the number is
even or odd.

3.Write a Python program to determine if a given year is a leap year. A leap year is divisible by 4 but not
by 100, except if it is also divisible by 400.

4.Write a Python program that takes a student's score as input and prints the corresponding grade
based on the following criteria:

- A: 90-100

- B: 80-89

- C: 70-79

- D: 60-69

- F: below 60

5.Write a Python program that takes three numbers as input and prints the largest of the three.

6.Write a Python program that takes a single character from the user and checks whether it is a vowel
(a, e, i, o, u) or a consonant.

7.Write a Python program that takes the user's age as input and determines which age group they
belong to:

- Child: 0-12 years

- Teenager: 13-19 years

- Adult: 20-64 years

- Senior: 65 years and above

8.Write a Python program that checks if a given number is divisible by both 5 and 11.

9. Write a Python program that takes an integer (1-7) as input and prints the corresponding day of the
week (1 for Monday, 2 for Tuesday, ..., 7 for Sunday).

10.Write a Python program that takes a username and password as input and checks if they match pre-
defined credentials. If they match, print "Access Granted"; otherwise, print "Access Denied".

You might also like