0% found this document useful (0 votes)
4 views

Assignment 1. Python

Uploaded by

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

Assignment 1. Python

Uploaded by

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

Assignment 1

A:
1. Sum of Two Numbers. Write a program that asks the user to input two numbers and
prints their sum.
2. Simple Calculator (Addition, Subtraction, Multiplication, Division). Write a program
that takes two numbers and performs all four operations on them.
3. Find the Maximum of Two Numbers. Ask the user for two numbers and print the
larger one.
4. Check for Positive or Negative Numbers. Write a program that takes a number and
checks if it's positive, negative, or zero.
B:
1. Grade Calculator. Write a program that accepts a percentage from the user and prints
the corresponding grade (A, B, C, D, F).
2. Simple Password Checker. Ask the user to enter a password and check if it matches a
predefined password.
3. Check Divisibility. Write a program to check if a number is divisible by both 5 and 3.
4. Check Age Eligibility. Ask the user for their age and determine if they are eligible to
vote (18 and older).

C:

1. Number Guessing Game. Write a number guessing game where the user has to guess
a predefined number. Print whether the guess is too high, too low, or correct.
2. Leap Year Checker. Ask the user for a year and check if it is a leap year.

You might also like