Suyash Python File
Suyash Python File
OF
PYTHON
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++.
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.
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.
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
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')
f=6
g=7
h=f<g
print (type(h))
Output