0% found this document useful (0 votes)
79 views4 pages

Python Manual 2023 V1

The document provides an overview of the Python programming language including its advantages and uses. Python is an interpreted, dynamically typed, general-purpose programming language that has a simple, clear syntax. It supports heterogeneous data structures like dictionaries, lists, sets and tuples. Python has a large community support and is modular, making it suitable for larger projects. It can be used for scripting, scientific computing, data analysis, machine learning, web development, IoT applications and game programming.
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)
79 views4 pages

Python Manual 2023 V1

The document provides an overview of the Python programming language including its advantages and uses. Python is an interpreted, dynamically typed, general-purpose programming language that has a simple, clear syntax. It supports heterogeneous data structures like dictionaries, lists, sets and tuples. Python has a large community support and is modular, making it suitable for larger projects. It can be used for scripting, scientific computing, data analysis, machine learning, web development, IoT applications and game programming.
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/ 4

PYTHON MANUAL

Python is a interpreted, dynamically typed, general-purpose, object-oriented, programming


language.
Advantages
 Simple, clear syntax
 Named function arguments
 Heterogeneous data structures
 dictionary
 list
 Set
 Tuple
 Packages: large community of support
 Modular: great for larger projects (modules)
 Runs everywhere: Linux, Mac, and Windows
 Free and Open Source

Compilation Vs. Interpretation

C, C++, JAVA Python, Perl, MATLAB


What can we do with Python ?
 Scripting language
 Scientific Computations
 Data Analysis and Visualization
 Machine Learning and AI Applications
 Web Application Development
 IoT Application Development
 Game Programming
Python Comments
 Comments are lines that exist in computer programs that are ignored by compilers and
interpreters.
 In Python, we use the hash (#) symbol to start writing a comment.

#Print Hello world to console


print("Hello world")

Output:
Hello world

Multi Line Comments


• If we have comments that extend multiple lines, one way of doing it is to use hash (#)
in the beginning of each line.

#This is a long comment


#and it extends
#Multiple lines

• Another way of doing this is to use triple quotes, either ''' or """.

"""This is also a
perfect example of
multi-line comments"""

Python Keywords
• Keywords are the reserved words in python
• We can't use a keyword as variable name, function name or any other identifier
• Keywords are case sensitive

#Get all keywords in python 3.6
import keyword
print(keyword.kwlist)
print("Total number of keywords ", len(keyword.kwlist))
['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal',
'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
Total number of keywords 33

Python Statement
• put multiple statements in a single line using ;

Examples:
a = 10; b = 20; c = 30 #put multiple statements in a single line using ;
print(b)
Output :
20

Storage Locations
if True:
print (“Python Programming")
c = “Python Lab"

Write down regarding the import statement discussed in the lab.

You might also like