0% found this document useful (0 votes)
22 views7 pages

Suyash Python File

The document is a practical file submitted by a student named Suyash Tripathi that contains Python programs demonstrating different data types, operators, and control flow statements. It begins with an introduction to Python explaining that it is an interpreted, object-oriented, and easy to learn programming language. It then provides examples of built-in data types in Python like integers, floats, strings, lists, tuples, dictionaries, and Boolean values. The file further includes Python programs for various data types, operators, and control structures like if, if-else, nested if-else, for loops, and switch statements.

Uploaded by

Sumit Kumar
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)
22 views7 pages

Suyash Python File

The document is a practical file submitted by a student named Suyash Tripathi that contains Python programs demonstrating different data types, operators, and control flow statements. It begins with an introduction to Python explaining that it is an interpreted, object-oriented, and easy to learn programming language. It then provides examples of built-in data types in Python like integers, floats, strings, lists, tuples, dictionaries, and Boolean values. The file further includes Python programs for various data types, operators, and control structures like if, if-else, nested if-else, for loops, and switch statements.

Uploaded by

Sumit Kumar
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
You are on page 1/ 7

PRACTICAL FILE

OF
PYTHON

SUBMITTED TO: SUBMITTED BY:


Prof. Simrandeep Kaur Suyash Tripathi
Roll no.: 2100448

DEPARTMENT OF CSE
BABA BANDA SINGH BAHADUR ENGINNERING COLLEGE
FATEHGARH SAHIB, PUNJAB
INDEX
S.no Name of the Program Date Signature
1. Write a program to demonstrate the different
data types in python.
2. Write a program to perform different operator
operations in python.
3. Write a program on logic development in
C++.

4. write a program of if statement in c++


5. Write a program of if else statement in
c++
6 Write a program of nested if else
statement in c++
7 Write a program a switch statement in
c++
8 Write a program of for loop in c++
What is Python
Python is a general-purpose, dynamic, high-level, and interpreted programming language. It
supports Object Oriented programming approach to develop applications. It is simple and easy
to learn and provides lots of high-level data structures.

Python is an easy-to-learn yet powerful and versatile scripting language, which makes it
attractive for Application Development.

With its interpreted nature, Python's syntax and dynamic typing make it an ideal language for
scripting and rapid application development.

Python supports multiple programming patterns, including object-oriented, imperative, and


functional or procedural programming styles.

Python is an open-source, cost-free programming language. It is utilized in several sectors and


disciplines as a result.

Why learns Python?


Python provides many useful features to the programmer. These features make it the most
popular and widely used language. We have listed below few-essential features of Python.

o Easy to use and Learn: Python has a simple and easy-to-understand syntax, unlike
traditional languages like C, C++, Java, etc., making it easy for beginners to learn.
o Expressive Language: It allows programmers to express complex concepts in just a
few lines of code or reduces Developer's Time.
o Interpreted Language: Python does not require compilation, allowing rapid
development and testing. It uses Interpreter instead of Compiler.
o Object-Oriented Language: It supports object-oriented programming, making
writing reusable and modular code easy.
o Open Source Language: Python is open source and free to use, distribute and modify.
o Extensible: Python can be extended with modules written in C, C++, or other
languages.
o Learn Standard Library: Python's standard library contains many modules and
functions that can be used for various tasks, such as string manipulation, web
programming, and more.
o GUI Programming Support: Python provides several GUI frameworks, such as
Tkinter and PyQt, allowing developers to create desktop applications easily.
o Integrated: Python can easily integrate with other languages and technologies, such as
C/C++, Java, and. NET.

3
o Embeddable: Python code can be embedded into other applications as a scripting
language.
o Dynamic Memory Allocation: Python automatically manages memory allocation,
making it easier for developers to write complex programs without worrying about
memory management.
o Wide Range of Libraries and Frameworks: Python has a vast collection of libraries
and frameworks, such as NumPy, Pandas, Django, and Flask, that can be used to solve
a wide range of problems.
o Versatility: Python is a universal language in various domains such as web
development, machine learning, data analysis, scientific computing, and more.
o Large Community: Python has a vast and active community of developers
contributing to its development and offering support. This makes it easy for beginners
to get help and learn from experienced developers.
o Career Opportunities: Python is a highly popular language in the job market.
Learning Python can open up several career opportunities in data science, artificial
intelligence, web development, and more.
o High Demand: With the growing demand for automation and digital transformation,
the need for Python developers is rising. Many industries seek skilled Python
developers to help build their digital infrastructure.
o Increased Productivity: Python has a simple syntax and powerful libraries that can
help developers write code faster and more efficiently. This can increase productivity
and save time for developers and organizations.
o Big Data and Machine Learning: Python has become the go-to language for big data
and machine learning. Python has become popular among data scientists and machine
learning engineers with libraries like NumPy, Pandas, Scikit-learn, TensorFlow, and
more.

Python Popular Frameworks and Libraries


Python has wide range of libraries and frameworks widely used in various fields such as
machine learning, artificial intelligence, web applications, etc. We define some popular
frameworks and libraries of Python as follows.

o Web development (Server-side) - Django Flask, Pyramid, CherryPy


o GUIs based applications - Tk, PyGTK, PyQt, PyJs, etc.
o Machine Learning - TensorFlow, PyTorch, Scikit-learn, Matplotlib, Scipy, etc.

4
o Mathematics - Numpy, Pandas, etc.
o BeautifulSoup: a library for web scraping and parsing HTML and XML
o Requests: a library for making HTTP requests
o SQLAlchemy: a library for working with SQL databases
o Kivy: a framework for building multi-touch applications
o Pygame: a library for game development
o Pytest: a testing framework for Python
o Django REST framework: a toolkit for building RESTful APIs
o FastAPI: a modern, fast web framework for building APIs
o Streamlit: a library for building interactive web apps for machine learning and data science
o NLTK: a library for natural language processing

 First Hello World program in python.

print ("Hello World")

Output

5
Program 1: - Write a program to demonstrate the different data types in python.

Datatypes: Data types are the classification or categorization of data items. It represents the
kind of value that tells what operations can be performed on a particular data. The following
are the standard or built-in data types in Python: 1. Integers 2. Float 3. Complex 4.
Dictionary 5. Set 6. List 7. Boolean 8. String 9. Tuple Integer, float and complex numbers are
Numeric types. String, list and tuples are sequence datatype in python.

Code:

a=4
print ("The value of a is: ", a)
print ("Data Type of Variable a: “, type(a))

b=4.5
print ("The value of b is: ", b)
print ("Data Type of Variable b: “, type (b))

c=4j
print ("The value of c is: ", c)
print ("Data Type of Variable c: ", type(c))

S1='Suyash'
S2="Yash"
S3='''
My Name is Suyash as well as Yash is my nick name
'''
print ("The value of S1 is: ", S1)
print ("Data Type of Variable S1: ", type(S1))
print ("The value of S2 is: ", S2)
print ("Data Type of Variable S2: ", type(S2))
print ("The value of S3 is: ", S3)
print ("Data Type of Variable S3: ", type(S3))

6
L=[23,34,5,'Suyash',6.3,'Yash']
print ("The value of List L is: ", type(L))

T=(23,34,5,'Suyash',6.3,'Yash')

print ("The value of Tuple T is: ", type(T))

D= {'Apple':1, 'Banana':4, 'Orange':10}

Print ("The value of Dictionary D is: ", type(D))

f=6

g=7

h=f<g

print (type(h))

Output

You might also like