0% found this document useful (0 votes)
1 views2 pages

Python Assignment 1

This document outlines an assignment for Python programming at Prashanti Institute of Technology & Science, Ujjain. It includes ten tasks such as checking if a number is even or odd, determining if a number is positive, negative, or zero, printing numbers from 1 to 50, and creating a simple calculator. The assignment aims to enhance programming skills through practical exercises.

Uploaded by

clawrachit123
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)
1 views2 pages

Python Assignment 1

This document outlines an assignment for Python programming at Prashanti Institute of Technology & Science, Ujjain. It includes ten tasks such as checking if a number is even or odd, determining if a number is positive, negative, or zero, printing numbers from 1 to 50, and creating a simple calculator. The assignment aims to enhance programming skills through practical exercises.

Uploaded by

clawrachit123
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

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

You might also like