I am here because I love to sharing my knowledge. 2 Hello!
Roadmap 3 1 3 5 6 4 2 What is Python? First Program Variables, Literals, Data Types Download Python Rules for Identifiers And comments Input in python
What is Python? Python is a programming language that lets you work quickly and integrate systems more effectively. 4
Applications of python Web Development Game Development Machine Learning Mathematics Education: Python is a superb language for teaching programming, both at the introductory level and in more advanced courses. Desktop GUI Software Development: Python is often used as a support language for software developers, for build control and management, testing, and in many other ways. Operating System Artificial Intelligence Internet of Things (IoT) 5
Where to use python online Ideone : https://ideone.com/ GBD compiler: https://www.onlinegdb.com/ Google Colab: https://colab.research.google.com/ And many more... 7
Hello World! My first program in python 8
Code print(“hello world!”) 9
What are identifiers 10 A Python identifier is a name used to identify a variable, function, class, module or other object.
Rules for naming identifiers Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore _. Names like myClass , var_1 and print_this_to_screen , all are valid example. An identifier cannot start with a digit. 1variable is invalid, but variable1 is a valid name. Keywords cannot be used as identifiers. We cannot use special symbols like !, @, #, $, % etc. in our identifier. An identifier can be of any length. 11
What are Keywords 12 Keywords are reserved words and you cannot use them as constant or variable or any other identifier names. All the Python keywords contain lowercase letters only.
Keywords in python are: 13 and exec not assert finally or break for pass class from print continue global raise def if return del import try elif in while else is with except lambda yield
Comments in Python 14 Single Line Comments: Python single line comment starts with hashtag symbol with no white spaces (#) and lasts till the end of the line.
Comments in Python 15 Multi-Line Comments: Python multi-line comment is a piece of text enclosed in a delimiter (""") on each end of the comment.
variables Reserved memory locations to store values 16
17
Using variables in python Assignment operator (=) is used to assign a value to a variable. 18
Literals Raw data given in a variable or constant 19
Data Types in python 20 String: sequence of characters surrounded by quotes. Numeric: they are of three types: Integer Float Complex Boolean: It can have only two values (true/false)
Collections 21 Lists: List is an ordered sequence of items. All the items in a list do not need to be of the same type.
22 Collections Tuple: They are like lists but cannot be modified.
23 Collections Set: Set is a unordered collection of unique items.
Collections 24 Dictionary: Dictionary is an unordered collection of key-value pairs. It is generally used when we have a huge amount of data. Dictionaries are optimized for retrieving data. We must know the key to retrieve the value.
Input in python Using input() 25
26
27 Exercise Write a program to enter a number and print 5 times of that number. (number *5). Write a program to define a set of numbers in table of 19. Write a program to input two numbers and print their sum.
Solutions 28
Link for all Code https://colab.research.google.com/drive/1yMTEr3tL7eYkYeiuXwgVNuxqc7MFbMhA?usp=sharing Like
Extra Resources https://www.youtube.com/watch?v=73DKe1W5KmU&t=9s https://www.youtube.com/watch?v=ErJ0DHZIHVk https://www.youtube.com/watch?v=-KToCMl9XT0 https://www.youtube.com/watch?v=SF7IYpAab60&t=4s Subscribe