python slides operators and types of it.pptx

AishaAnwar16 68 views 31 slides Jun 21, 2024
Slide 1
Slide 1 of 31
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31

About This Presentation

pythonoperators slides


Slide Content

Python

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

Download Python 6 https://www.python.org/downloads/

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

Thanks! Any questions? 31
Tags