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

Introduction to Python Programming

Uploaded by

mr.nosenseguyyt
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)
10 views2 pages

Introduction to Python Programming

Uploaded by

mr.nosenseguyyt
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

SHARJAH INDIAN SCHOOL, JUWAIZA

INTRODUCTION TO PYTHON
• Python is an interpreted high-level programming language that supports GUI programming.
• It was developed by GUIDO VAN ROSSUM in 1991.

ADVANTAGES

1. Easy to use
2. Platform-independent

3. Ample availability of libraries.

4. Free and open source

5. Variety of usage/application

6. Syntax Highlighting

7. It supports GUI applications.

8. Higher productivity

BASIC MODES OF PYTHON

1. Interactive mode

Python provides an interactive shell to execute code immediately and produce output instantly. In
interactive mode, type the command in front of the Python command prompt (>>>)

2. Script mode

In the Script mode of working, Python instructions are stored in a file generally with the .py or .pyw
extension and are executed together in one go as a unit. The saved instruction is known as Python script or
Python program.

Click on File in Python shell -> Click New Window-> Type the python codes->Save the file (by clicking
File->Save As) -> Run the code (click Run module or F5)

Python programs

1. #Arithmetic operator

a=20

b=10

c=a+b
print("sum of a and b is a+b:",c)

print("floor division:a//b:",a//b)

print("Subtraction:b-a:",b-a)

print("Exponent:4*2:",4*2)

print("Multiplication:4*3:",4*3)

2. Python program to find the total marks of any 5 subjects and find the average.

marks1= int(input("enter 1st mark :"))

marks2= int(input("enter 2nd mark :"))

marks3= int(input("enter 3rd mark:"))

marks4= int(input("enter 4rd mark:"))

marks5= int(input("enter 5rd mark:"))

Total=(marks1+marks2+marks3+ marks4+ marks5)

average = (marks1+marks2+marks3+ marks4+ marks5)/5

print("total marks:",Total)

print("average::",average )

You might also like