0% found this document useful (0 votes)
3 views35 pages

Python Programming Basics: 35 Examples

The document provides a series of Python programs, each designed to perform specific tasks such as basic arithmetic operations, geometric calculations, and list manipulations. Each program is numbered and includes an output section, indicating the expected result of the code. The programs cover a wide range of topics suitable for beginners learning Python programming.
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)
3 views35 pages

Python Programming Basics: 35 Examples

The document provides a series of Python programs, each designed to perform specific tasks such as basic arithmetic operations, geometric calculations, and list manipulations. Each program is numbered and includes an output section, indicating the expected result of the code. The programs cover a wide range of topics suitable for beginners learning Python programming.
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

HELLO WORLD PROGRAM IN PYTHON - First Python Program

PROGRAM 1

OUTPUT
Write a Python Program to Add Two Numbers
PROGRAM 2

OUTPUT
Python Program to Add Two Numbers by TAKING input
from user
PROGRAM 3

OUTPUT
Program in Python Find & Calculate Square Root
of any number
PROGRAM 4

OUTPUT
Python program to Calculate Area of Triangle
PROGRAM 5

OUTPUT
Python Program to calculate area of rectangle

PROGRAM 6

OUTPUT
Python Program to calculate perimeter of rectangle

PROGRAM 7

OUTPUT
Python Program to swap values of two variables using third variable

PROGRAM 8 OUTPUT
Python Program swap values of two variables without third
variable
PROGRAM 9 OUTPUT
Python Program to find the square of any number

PROGRAM 10

OUTPUT
Python Program to check whether a person can vote or not

PROGRAM 11

OUTPUT
Python Program to check grade of student and print result accordingly

PROGRAM 12 OUTPUT
Python Program to check whether the number is positive, negative or zero

PROGRAM 13

OUTPUT
Python Program to take input of choice of number from user and print name
of day
PROGRAM 14

OUTPUT
Python Program to take input of choice of character from user and print
color name of rainbow
PROGRAM 15

OUTPUT
Python Program to take input of choice of operator from user and print
result
PROGRAM 16

OUTPUT
Python Program to print first 10 natural numbers using while
loop

PROGRAM 17 OUTPUT
Python Program to print first 10 even numbers

PROGRAM 18 OUTPUT

Using for loop


Python Program to print odd numbers up to n number

PROGRAM 19 OUTPUT
Python Program to convert kilometers into meters

PROGRAM 20

OUTPUT
Python Program to print table of any number

PROGRAM 21 OUTPUT
Python Program to calculate Simple Interest

PROGRAM 22

OUTPUT
Python Program to add all elements and print their sum

PROGRAM 23

OUTPUT
Python Program to create list
PROGRAM 24

OUTPUT
Python Program to join 2 lists
PROGRAM 25

OUTPUT
Python Program to append new element in list
PROGRAM 26

OUTPUT
Python Program to print index position of any element
PROGRAM 27

OUTPUT
Python Program to insert new element at any index position
PROGRAM 28

OUTPUT
Python Program to extend any list with another

PROGRAM 29 OUTPUT
Python Program to count occurrence of any number in list

PROGRAM 30 OUTPUT
Python Program to print any list in ascending and descending order
PROGRAM 31

OUTPUT
Python Program to print elements of list in reverse order
PROGRAM 32

OUTPUT
Python Program to pop and remove element from list
PROGRAM 33

OUTPUT
Python Program to clear any elements from the list

PROGRAM 34 OUTPUT
Python Program to print length of list

PROGRAM 35

OUTPUT

You might also like