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

Exp no _1 python etc sss2 (1)

Uploaded by

Shaunak Sardesai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views7 pages

Exp no _1 python etc sss2 (1)

Uploaded by

Shaunak Sardesai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Exp no:1 Date:14/01/25

CASE STUDY OF PYTHON PROGRAMMING

Aim: To study basic concepts of python programming

Theory:

1)Introduction to python language: Python is a popular programming language. It was created


by Guido van Rossum, and released in 1991.It is used for:

I)Web Development:
a). Frameworks: Python offers powerful web frameworks like Django and Flask, which simplify
web application development.
b). Scalability: Python’s scalability and flexibility make it suitable for building robust, scalable
web applications.

II)Software Development:
a). Prototyping: Python’s readability and simplicity enable rapid prototyping and iterative
development
b). Integration: Python easily integrates with other languages and technologies, making it a great
choice for developing software components.

III)Mathematics and Python:


a). Libraries: Python provides extensive mathematical libraries like NumPy and SciPy for
numerical computations and scientific research
b). Data Analysis: Python is widely used for data analysis and visualization, thanks to tools like
Pandas and Matplotlib.

IV)System Scripting and Python:


a). Automation: Python’s simplicity makes it ideal for writing scripts to automate repetitive tasks
and system operations.
b). Cross-Platform: Python scripts can run on multiple operating systems, making it a versatile
choice for system scripting.

2)Features of python language:

a). Readable Syntax: Python's syntax is designed to be clear and easy to understand, making
code more readable.

b). Dynamic Typing: Variable types are determined at runtime, which makes coding
more flexible and convenient
c). Extensive Libraries: Python comes with a vast standard library and many third-party
libraries, enabling rapid development.
d). Cross-Platform: Python code can be run on multiple operating systems without
modification.
e). Interpreted Language: Python is executed line by line, which makes debugging
easier and enhances the development process.

3)Application of python language:

a).Web Development: Python frameworks like Django and Flask enable developers to
build robust and scalable web applications efficiently.
b). Data Science & Analytics: With libraries such as Pandas, NumPy, and Matplotlib,
Python is a go-to language for data analysis, visualization, and scientific computing.
c). Machine Learning & AI: Python is extensively used in machine learning and AI
thanks to powerful libraries like TensorFlow, Keras, and Scikit-learn.
d). Automation & Scripting: Python's simplicity makes it ideal for automating repetitive
tasks and writing scripts to manage system operations.
e). Game Development: Libraries like Pygame allow developers to create simple and
even complex games.

4)Advantages of python language:

a). Ease of Learning: Python’s syntax is simple and intuitive, which makes it accessible
for beginners and experienced developers alike.
b). Versatility: Python can be used for a wide range of applications, from web
development to data science, machine learning, and more.
c). Community Support: Python has a large and active community, providing extensive
resources, libraries, and frameworks that can help solve almost any problem.
d). Integration Capabilities: Python can easily integrate with other languages and
technologies, making it a great choice for system integration and automation.
e). Productivity: Python’s simplicity and readability result in faster development and
fewer lines of code, boosting overall productivity.

5)Difference between python and c programming:

Metrices C Python

Introduction C is a general-purpose, Python is an interpreted, high-level,


Metrices C Python

procedural computer general-purpose programming


programming language. language.

Compiled programs execute


Interpreted programs execute slower
Speed faster as compared to
as compared to compiled programs.
interpreted programs.

It is easier to write a code in Python


Program syntax is harder than
Usage as the number of lines is less
Python.
comparatively.

There is no need to declare the type


In C, the type of a variable of variable. Variables are untyped in
Declaration of must be declared when it is Python. A given variable can be stuck
variables created, and only values of that on values of different types at
type must be assigned to it. different times during the program
execution

In C, error debugging is Error debugging is simple. This


difficult as it is a compiler means it takes only one in instruction
Error dependent language. This at a time and compiles and executes
Debugging means that it takes the entire simultaneously. Errors are shown
source code, compiles it and instantly and the execution is stopped,
then shows all the errors. at that instruction.

C does not support function


Function Supports function renaming
renaming mechanism. This
renaming mechanism i.e, the same function can
means the same function cannot
mechanism be used by two different names.
be used by two different names.

The syntax of a C program is Syntax of Python programs is easy to


Complexity
harder than Python. learn, write and read.

In C, the Programmer has to do


Memory- Python uses an automatic garbage
memory management on their
management collector for memory management.
own.

Applications C is generally used for Python is a General-Purpose


Metrices C Python

hardware related applications. programming language.

Built-in C has a limited number of built- Python has a large library of built-in
functions in functions. functions.

Implementing data structures Gives ease of implementing data


Implementing
requires its functions to be structures with built-in insert, append
Data Structures
explicitly implemented functions.

No pointers functionality available in


Pointers Pointers are available in C.
Python.

6)Difference between python and java programming:

Parameters Python Java

Python has generally fewer


Code Java has long lines of code.
lines of code.

Compare to JAVA, Python


has a lower number of Java has a large number of Frameworks.
Framework
Frameworks. Popular ones Popular ones are Spring, Hibernate, etc.
are Django and Flask.

The syntax is easy to


The syntax is complex as it throws errors
Syntax remember almost similar to
if you miss semicolons or curly braces.
human language.

Less line no of code, Rapid


Self-memory management, Robust,
Key Features deployment, and dynamic
Platform independent
typing.

Python is slower since it


uses an interpreter and also Java is faster in speed as compared to
Speed
determines the data type at python.
run time.
Parameters Python Java

Python’s database access


(JDBC)Java Database Connectivity is the
layers are weaker than
Databases most popular and widely used to connect
Java’s JDBC. This is why it
with databases.
is rarely used in enterprises.

Machine
Learning Tensorflow, Pytorch. Weka, Mallet, Deeplearning4j, MOA
Libraries

Python has always had a Java enjoys more consistent refactoring


presence in the agile space support than Python thanks on one hand
Practical and has grown in popularity to its static type system which makes
Agility for many reasons, including automated refactoring more predictable
the rise of the DevOps and reliable, and on the other to the
movement. prevalence of IDEs in Java development.

Multiple Python supports multiple Java partially supports Multiple


Inheritance Inheritance. Inheritance through interfaces.

Programmes:

1) Python programme to print hello world :


#To print hello world
print("Hello, World!")

2) Python programme to add 2 numbers:


# Define two numbers
num1 = 5
num2 = 3
# Add the two numbers
sum = num1 + num2
# Print the result
print("The sum of", num1, "and", num2, "is", sum)

3) Python programme to multiply 3 numbers:


# Define three numbers
num1 = 2
num2 = 4
num3 = 6
# Multiply the three numbers
product = num1 * num2 * num3
# Print the result
print("The product of", num1, ",", num2, "and", num3, "is", product)

Conclusion: Basic concepts of python programming were studied successfully

You might also like