1. Python Presented By: Rajesh Kumar Guided By: Mr. Jaishankar Bhatt 2. Content Python Introduction Python Code Execution Python Comments & Indentation Variables Data Types Strings Collections (Arrays) 3. Python Introduction What is Python? Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum Released in 1991 4. Python Code Execution Source code extension is .py Byte code extension is .pyc (compiled python code) Python’s runtime execution model: 5. Comments •Creating a Comment: Ex: Comments starts with a # Output: 6. Comments •Multi Line Comments: Ex: or: 7. Python Indentation •Indentation refers to the spaces at the beginning of a code line. Ex1: Ex2: 8. Variables •Variables are containers for storing data values. Ex: 9. Data Types •Built-in Data Types 10. Getting the Data Type •You can get the data type of any object by using the type() method. Ex: Print the data type of the variable x: Output: 11. Setting the Data Type •In Python, the data type is set when you assign a value to a variable: 12. Strings •String literals in python are surrounded by either single quotation marks, or double quotation marks. •'hello' is the same as "hello". Ex: 13. Multiline Strings •You can assign a multiline string to a variable by using three quotes Ex: Output: 14. Slicing •You can return a range of characters by using the slice syntax. Ex:Get the characters from position 2 to position 5. Output: 15. String Methods Method Description len() Returns the length of a string. lower() Returns the string in lower case. upper() Returns the string in upper case. count() Returns the number of times a specified value appears in the string. 16. Collections (Arrays) •There are four collection data types in the Python programming language. Types: 1. List 2. Tuple 3. Set 4. Dictionary 17. Python Lists •A list is a collection which is ordered and changeable. In Python lists are written with square brackets. Ex: Create a List: Output: 18. Python Tuples •A tuple is a collection which is ordered and unchangeable. In Python tuples are written with round brackets. Ex: Create a Tuple: Output: 19. Python Sets •A set is a collection which is unordered and unindexed. In Python sets are written with curly brackets. Ex: Create a Set: 20. Python Dictionaries •A dictionary is a collection which is unordered, changeable and indexed. In Python dictionaries are written with curly brackets. Ex: Create a Dictionary: 21. Conclusion Python is a great option, whether you are a beginning programmer looking to learn the basics, an experienced programmer designing a large application, or anywhere in between. The basics of Python are easily grasped, and yet its capabilities are vast. 22. Reference https://www.udemy.com/course/learn- programming-with-python https://www.w3schools.com/python/default.asp