PRASHANTIINSTITUTEOFTECHNOLOGY&SCIENCE,UJJAIN
ApprovedbyAICTE,NewDelhi&AffiliatedtoRGPV,Bhopal(RunbyPrashantiEducational&WelfareSociety,Ujjain)
Assignment-1
Python Programming
1. Even or Od
Write a program that takes a number from the user and checks whether it is even or odd using if-else.
2. Positive, Negative or Zero
Take a number input and print whether it is:
Positive
Negative
Zero
3. Print 1 to 50
Use a loop to print numbers from 1 to 50.
4. Sum of First N Numbers
Take input N from user and print the sum of numbers from 1 to N using a loop.
5. Multiplication Table
Take a number from user and print its multiplication table (1 to 10).
6. Find Largest in a List
Given a list like:
[12, 45, 2, 67, 34]
Find and print the largest number of list.
PRASHANTIINSTITUTEOFTECHNOLOGY&SCIENCE,UJJAIN
ApprovedbyAICTE,NewDelhi&AffiliatedtoRGPV,Bhopal(RunbyPrashantiEducational&WelfareSociety,Ujjain)
7. Count Even Numbers in List
Given a list, count how many numbers are even.
Example:
[2, 5, 8, 11, 14]
8. Simple Login Check
Create a program with:
username = "admin"
password = "1234"
Ask user to input username and password and use if-else to check if login is correct or not.
9. Sum of List Elements
Given list:
A=[10,20,30,40,50]
10. Simple Simple Calculator
Perform (+, -, *, /, //, **) using if-else and elif in python