programming python all concepts PF) (2).pptx

NajafAli87 4 views 10 slides Jul 03, 2024
Slide 1
Slide 1 of 10
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

About This Presentation

all data is classified


Slide Content

بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ

PYTHON Spring-24 Demo _Session INTRODUCTION TO PYTHON

INTRODUCTION Python is a general-purpose programming language that is often applied in scripting roles . So, Python is a programming language as well as a scripting language. Python is also called an interpreted language.

History Invented in the Netherlands, early 1990s by Guido van Rossum . Python was conceived in the late 1980s and its implementation was started in December 1989 . Guido Van Rossum is a fan of 'Monty Python's Flying Circus’ , this is a famous TV show in the Netherlands Named after Python Open-sourced from the beginning - Guido van Rossum

PYTHON BENEVOLENT DICTATOR FOR LIFE "Python is an experiment in how much freedom programmers need. Too much freedom and nobody can read another's code; too little and expressiveness ."

Running PYTHON Once you're inside the Python interpreter, type in commands: Examples: print( ' Hello world ' ) Hello world print( ' Hello world ' ) ; Hello world print( “ Hello world ” ) Hello world print( “ Hello world ” ) ; Hello world Note: Correct…!

PYTHON code execution Python's traditional runtime execution model The text describes the process of how Python code is executed. Source code This refers to the Python code you write , typically saved in a file with a .py extension. Bytecode When you run your Python code, the Python interpreter translates it into bytecode . Bytecode is a low-level representation of your code that the Python Virtual Machine ( PVM ) can understand. Python Virtual Machine (PVM) This is a program that translates the bytecode into instructions that your computer's processor can understand.

LOOP Loop Type Description While loop Repeats a statement or group of statements while a given condition is TRUE . It tests the condition before executing the loop body. For loop Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable. Nested loops You can use one or more loops inside any other while, for, or do while loop.

Conditional statements Statement Description if statements An if statement consists of a Boolean expression followed by one or more statements. if-else statements An if statement can be followed by an optional else statement, which executes when the Boolean expression is false . nested if statements You can use one if or else if statement inside another if or else if statement (s).

BITWISE OPERATOR AND Operator OR Operator NOT Operator XOR Operator COMPLEMENT Operator LEFT SHIFT Operator RIGHT SHIFT Operator