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

Python Practical Synopsis

This document provides an introduction and overview of Python including: 1. A brief history of Python and how it was created to have simple and readable syntax. 2. The main uses of Python including web applications, artificial intelligence/machine learning, and data science. 3. Examples of how to use the input function in Python to take user input as floats or integers. 4. Lists of common arithmetic and relational operators in Python. 5. Programs demonstrating the use of various operators and functions in Python like calculating averages.

Uploaded by

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

Python Practical Synopsis

This document provides an introduction and overview of Python including: 1. A brief history of Python and how it was created to have simple and readable syntax. 2. The main uses of Python including web applications, artificial intelligence/machine learning, and data science. 3. Examples of how to use the input function in Python to take user input as floats or integers. 4. Lists of common arithmetic and relational operators in Python. 5. Programs demonstrating the use of various operators and functions in Python like calculating averages.

Uploaded by

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

1.

CERTIFICATE 3
2. Introduction to Python 4
3. Uses of Python 5
4. Input Function Introduction 6
5. Input Function Example 7
6. List of Arithmetic Operators 9
7. Arithmetic Operators Program 10
8. List of Relational Operators 11
9. Relational Operators Program 12
10. WAP to identify if a number is 13
Even or Odd
11. WAP to find the average 14
temperature of the week
12. WAP to reverse any 2 digit 15
number
13. WAP which functions as a 16
basic calculator
2.Introduction To Python

Guido van Rossum started implementing Python in 1989. Python is a very simple
programming language so even if you are new to programming, you can learn
python without facing any issues.

Interesting fact: Python is named after the comedy television show Monty Python’s Flying Circus. It is
not named after the Python snake.

Python has a simple syntax similar to the English language.

Mainly developed for emphasis on code readability, and its syntax allows
programmers to express concepts in fewer lines of code.
3.Uses of Python

1) In Web Applications – Python is used to develop things such as web apps,

user interactive web pages, games, 3-D applications, network programming

etc.

2) Artificial Intelligence and Machine Learning – Python is largely versatile and

compatible with many devices and used for many apps such as Spotify,

Google and Facebook. But since its very versatile, we can solve A.I and

machine learning problems just by learning simple python algorithms.

3) Data Science – Data is a vast topic and requires a lot of consistent

organization. Python is a largely used language in the field of data science.

Apps like Uber use python to not only increase user interaction but also

manage their ever-growing database of users.


4.Input Function Introduction

Input Function allows user to input information.

We can use either float values or integer values.

Code for float values-

a=float(input("Enter the first number"))


b=float(input("Enter the second number"))
c= a+b
print ("The answer is", c)

Code for integer values –

a=int(input("Enter the first number"))


b=int(input("Enter the second nunber"))
c= a+b
print ("The answer is", c)
5.Input Function Example

Code for Float Values -


Code for Integer values-
6.List of Arithmetic Operators

Assuming that X and Y are two values that are input before the code is
written –
Addition - a= x+y
Subtraction - b= x-y
Multiplication - c=x*y
Division - d=x/y
Percent of - e=x%y
Floor Division - f= x//y
Exponent - g= x**y
7.Arithmetic Operators Program
8.List of Relation Operators

Assuming that x and y are values that are input before coding

x > y – x is greater than y


x < y – x is smaller than y
x == y – x is equal to y
x != y – x is not equal to y
x >= y – x is greater than or equal to y
x <= y – x is lesser than or equal to y
9.Relation Operators Program
10.WAP to identify if a number is Even or Odd
11.WAP to find the average temperature of the week

Thus, the average temperature is 25.428 degree Celsius


12.WAP to reverse any 2-digit number
13.WAP which functions as a basic calculator

Without nested if loops –


*********

You might also like