0% found this document useful (0 votes)
14 views28 pages

Unit II PYTHON OPERATORS AND CONTROL FLOW STATEMENTS

The document outlines the second unit of a Python programming course, focusing on operators and control flow statements. It covers various types of operators including arithmetic, comparison, assignment, logical, bitwise, membership, and identity operators, along with their usage and examples. Additionally, it discusses control flow statements such as conditional statements and looping structures in Python.

Uploaded by

giteanuja09
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)
14 views28 pages

Unit II PYTHON OPERATORS AND CONTROL FLOW STATEMENTS

The document outlines the second unit of a Python programming course, focusing on operators and control flow statements. It covers various types of operators including arithmetic, comparison, assignment, logical, bitwise, membership, and identity operators, along with their usage and examples. Additionally, it discusses control flow statements such as conditional statements and looping structures in Python.

Uploaded by

giteanuja09
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/ 28

Padmashri Dr.

Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar


PWP-22616,CM

UNIT II
PYTHON OPERATORS AND CONTROL FLOW STATEMENTS
(10 Marks)

Unit Outcomes

h
2a. Write simple Python program for the given arithmetic expressions.

ik
ha
2b. Use different types of operators for writing the arithmetic expressions.
2c. Write a 'Python' program using decision making structure for two-way
.S
branching to solve the given problem.
2d. Write a Python' program using decision making structure for multi-way
.A

branching to solve the given problem.


.A

Topics and Sub-topics


of

 Basic Operators: Arithmetic, Comparison, Relational, Assignment


Pr

 Logical, Bitwise, Membership, Identity operators, Python Operator


Precedence
 Control Flow Statements
 Conditional Statements (if, if ... else, nested if)
 Looping in python (while loop, for loop, nested loops)
 loop manipulation using continue, pass, break, else.

1
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Python Operators
o The operator can be defined as a symbol which is responsible for a particular
operation between two operands.
o Operators are the pillars of a program on which the logic is built in a particular
programming language.
o Python provides a variety of operators described as follows.
 Arithmetic operators
 Comparison operators
 Assignment Operators
 Logical Operators

h
 Bitwise Operators

ik
 Membership Operators

ha
 Identity Operators
.S
Arithmetic operators
.A
.A
of
Pr

o Arithmetic operators are used to perform arithmetic operations between two


operands. It includes +(addition), - (subtraction), *(multiplication), /(divide),
%(reminder), //(floor division), and exponent (**).
o Consider the following table for a detailed explanation of arithmetic operators.

2
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Operator Description Example


+ It is used to add two operands. >>> a=20
(Addition) >>> b=10
>>> a+b
30
- It is used to subtract the second operand from the >>> a=20
(Subtraction) first operand. If the first operand is less than the >>> b=10
second operand, the value results negative. >>> a-b
10
/ It returns the quotient after dividing the first >>> a=20

h
(divide) operand by the second operand. Notice that >>> b=10

ik
division results in a floating-point value. >>> a/b

ha
2.0
* It is used to multiply one operand with the other. >>> a=20
.S
(Multiplication) >>> b=10
>>> a*b
.A

200
% It returns the reminder after dividing the first >>> a=20
.A

(reminder) operand by the second operand. >>> b=10


>>> a%b
of

0
Pr

** It is an exponent operator represented as it >>> a=20


(Exponent) calculates the first operand power to second >>> b=10
operand. >>> a**b
10240000000000
// Divides and returns the integer value of the >>> a=20
(Floor division) quotient. It dumps the digits after the decimal. >>> b=10
>>> a//b
2

3
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Comparison operator

o Comparison operators are used to comparing the value of the two operands and
returns boolean true or false accordingly.

h
ik
o The comparison operators are described in the following table.
Operator Description Example
==
ha
If the value of two operands is equal, then the >>> a=30
condition becomes true. >>> b=20
.S
>>> a==b
False
.A

!= If the value of two operands is not equal then the >>> a=30
condition becomes true. >>> b=20
>>> a!=b
.A

True
<= If the first operand is less than or equal to the >>> a=30
of

second operand, then the condition becomes true. >>> b=20


>>> a<=b
Pr

False
>= If the first operand is greater than or equal to the >>> a=30
second operand, then the condition becomes true. >>> b=20
>>> a>=b
True
> If the first operand is greater than the second >>> a=30
operand, then the condition becomes true. >>> b=20
>>> a>b
True
< If the first operand is less than the second >>> a=30
operand, then the condition becomes true. >>> b=20
>>> a<b
False

4
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Python assignment operators

o The assignment operators are used to assign the value of the right expression to the

h
left operand.

ik
o The assignment operators are described in the following table.

ha
Operator Description Example
= It assigns the value of the right expression to the >>> a=30
.S
left operand. >>> a
30
.A

+= It increases the value of the left operand by the >>> a=10


value of the right operand and assign the >>> b=20
.A

modified value back to left operand. >>> a+=b


>>> print(a)
of

30
Pr

-= It decreases the value of the left operand by the >>> a=20


value of the right operand and assign the >>> b=10
modified value back to left operand >>> a-=b
>>> print(a)
10
*= It multiplies the value of the left operand by the >>> a=10
value of the right operand and assign the >>> b=20
modified value back to left operand. >>> a*=b
>>> print(a)
200

5
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

%= It divides the value of the left operand by the >>> a=20


value of the right operand and assign the >>> b=10
reminder back to left operand. >>> a%=b
>>> print(a)
0
**= a**=b will be equal to a=a**b >>> a=4
>>> b=2
>>> a**=b
>>> print(a)
16

h
//= A//=b will be equal to a = a// b >>> a=4

ik
>>> b=3

ha
>>> a//=b
>>> print(a)
.S
1
.A
.A
of
Pr

6
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Bitwise operator

o The bitwise operators perform bit by bit operation on the values of the two operands.

h
ik
ha
.S
For example,
.A

Operator Description Example


& It performs bit by bit AND operation on the two values. >>> a=2
.A

(binary and) Here, binary for 2 is 10, and that for 3 is 11. &-ing them >>> b=3
results in 10, which is binary for 2. >>> bin(a)
of

'0b10'
Pr

>>> bin(3)
'0b11'
>>> a&b
2
| It performs bit by bit OR on the two values. Here, OR- >>> a=2
(binary or) ing 10(2) and 11(3) results in 11(3). >>> b=3
>>> bin(a)
'0b10'
>>> bin(3)
'0b11'

7
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

>>> a|b
3
^ It performs bit by bit XOR(exclusive-OR) on the two >>> a=2
(binary xor) values. Here, XOR-ing 10(2) and 11(3) results in 01(1). >>> b=3
>>> bin(a)
'0b10'
>>> bin(3)
'0b11'
>>> a^b
1

h
~ It returns the one’s complement of a number’s binary. It >>> a=2

ik
(negation) flips the bits. Binary for 2 is 00000010. Its one’s >>> b=3

ha
complement is 11111101. This is binary for -3. So, this >>> bin(a)
results in -3. '0b10'
.S
>>> ~a
-3
.A

<< It shifts the value of the left operand the number of >>> a=2
(left shift) places to the left that the right operand specifies. Here, >>> bin(a)
.A

binary of 2 is 10. 2<<2 shifts it two places to the left. '0b10'


This results in 1000, which is binary for 8. >>> a<<2
of

8
Pr

>> It shifts the value of the left operand the number of >>> a=2
(right shift) places to the right that the right operand specifies. Here, >>> bin(a)
binary of 2 is 01. 3>>2 shifts it two places to the right. '0b10'
This results in 00, which is binary for 0. >>> a>>2
0

8
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Logical Operators

h
ik
o The logical operators are used primarily in the expression evaluation to make a

ha
decision. Python supports the following logical operators.
Operator Description Example
.S
and If both the expression are true, then the >>> a=2
condition will be true. If a and b are the two >>> b=3
.A

expressions, a → true, b → true => a and b >>> c=3


→ true.
.A

>>> a>b and a>c


False
of

>>> a<b and a<c


True
Pr

or If one of the expressions is true, then the >>> a=2


condition will be true. If a and b are the two >>> b=3
expressions, a → true, b → false => a or b >>> c=2
→ true. >>> a<b or b<c
True
not If an expression a is true then not (a) will be
false and vice versa.

9
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Membership Operators
o These operators test whether a value is a member of a sequence.
o The sequence may be a list, a string, or a tuple.
o We have two membership python operators- ‘in’ and ‘not in’.
Operator Description Example
in This checks if a value is a member of a >>> pets=["dog","cat","rat"]
sequence. In our example, we see that the string >>> "fox" in pets
‘fox’ does not belong to the list pets. But the False
string ‘cat’ belongs to it, so it returns True. >>> "cat" in pets
True

h
not in Unlike ‘in’, ‘not in’ checks if a value is not a >>> pets=["dog","cat","rat"]

ik
member of a sequence. >>> "fox" not in pets

ha
True
>>> "cat" not in pets
.S
False
.A

Identity Operators
o These operators test if the two operands share an identity.
.A

o We have two identity operators- ‘is’ and ‘is not’.


Operator Description Example
of

is If two operands have the same identity, it returns >>> 2 is 20


Pr

True. Otherwise, it returns False. Here, 2 is not the False


same as 20, so it returns False. >>> 2 is 2
True
is not 2 is a number, and “2” is a string. So, it returns a >>> 2 is "2"
True to that. False

10
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Operator Precedence
o The precedence of the operators is important to find out since it enables us to know
which operator should be evaluated first.
o The precedence table of the operators in python is given below.
Operator Description
** The exponent operator is given priority over all the others used
in the expression.
~+- The negation, unary plus and minus.
* / % // The multiplication, divide, modules, reminder, and floor
division.

h
+- Binary plus and minus

ik
>> << Left shift and right shift

ha
& Binary and.
^| Binary xor and or
.S
<= < > >= Comparison operators (less then, less then equal to, greater
then, greater then equal to).
.A

<> == != Equality operators.


= %= /= //= -= Assignment operators
.A

+=
of

*= **=
is is not Identity operators
Pr

in not in Membership operators


not or and Logical operators

11
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Python Conditional Statements

h
ik
ha
o Sometimes, in a program, we may want to make a decision based on a condition.
o We know that an expression’s value can be True or False.
.S
o We may want to do something only when a certain condition is true.
o For example, assume variables a and b. If a is greater, then we want to print “a is
.A

greater”. Otherwise, we want to print “b is greater”.


o For this, we use an if-statement. Also, operators come in handy when you want to join
.A

conditions to make a composite one.


of

Python if Statements
Pr

o An if statement in python takes an expression with it.


o If the expression amounts to True, then the block of statements under it is executed.
o If it amounts to False, then the block is skipped and control transfers to the statements
after the block.
o But remember to indent the statements in a block equally. This is because we don’t
use curly braces to delimit blocks. Also, use a colon(:) after the condition.
o Syntax

if expression:
statement(s)

12
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

h
Example 1

ik
num = int(input("enter the number?"))

ha
if num%2 == 0:
print("Number is even")
.S
Output:
.A

enter the number?10


Number is even
.A

Example 2 : Program to print the largest of the three numbers.


of

a = int(input("Enter a? "));
Pr

b = int(input("Enter b? "));
c = int(input("Enter c? "));
if a>b and a>c:
print("a is largest");
if b>a and b>c:
print("b is largest");
if c>a and c>b:
print("c is largest");
Output:
Enter a? 100

13
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Enter b? 120
Enter c? 130
c is largest

Python if-else statement


o The if-else statement provides an else block combined with the if statement which is
executed in the false case of the condition.
o If the condition is true, then the if-block is executed. Otherwise, the else-block is
executed.

h
ik
ha
.S
.A
.A
of
Pr

o The syntax of the if-else statement is given below.

if condition:
#block of statements
else:
#another block of statements (else-block)

14
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Example 1 : Program to check whether a person is eligible to vote or not.


age = int (input("Enter your age? "))
if age>=18:
print("You are eligible to vote !!");
else:
print("Sorry! you have to wait !!");
Output:
Enter your age? 90
You are eligible to vote !!

h
Example 2: Program to check whether a number is even or not.

ik
num = int(input("enter the number?"))

ha
if num%2 == 0:
print("Number is even...")
.S
else:
print("Number is odd...")
.A

Output:
enter the number?10
.A

Number is even
of

The elif statement


Pr

o The elif statement enables us to check multiple conditions and execute the specific
block of statements depending upon the true condition among them.
o We can have any number of elif statements in our program depending upon our need.
However, using elif is optional.
o The elif statement works like an if-else-if ladder statement in C. It must be succeeded
by an if statement.
o The syntax of the elif statement is given below.

15
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

if expression 1:
# block of statements

elif expression 2:
# block of statements

elif expression 3:
# block of statements

else:
# block of statements

h
ik
ha
.S
.A
.A
of
Pr

Example 1
number = int(input("Enter the number?"))
if number==10:
print("number is equals to 10")
elif number==50:

16
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

print("number is equal to 50");


elif number==100:
print("number is equal to 100");
else:
print("number is not equal to 10, 50 or 100");
Output:
Enter the number?15
number is not equal to 10, 50 or 100
Example 2
marks = int(input("Enter the marks? "))

h
if marks > 85 and marks <= 100:

ik
print("Congrats ! you scored grade A ...")

ha
elif marks > 60 and marks <= 85:
print("You scored grade B + ...")
.S
elif marks > 40 and marks <= 60:
print("You scored grade B ...")
.A

elif (marks > 30 and marks <= 40):


print("You scored grade C ...")
.A

else:
print("Sorry you are fail ?")
of

Output
Pr

Enter the marks? 80


You scored grade B + ...

17
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Python Loop
o When we want some statements to execute a hundred times, you don’t repeat them
100 times.
o Think of when we want to print numbers 1 to 99. Or that we want to say Hello to 99
friends. In such a case, we can use loops in python.
o Here, we will discuss 4 types of Python Loop:
 Python For Loop
 Python While Loop
 Python Loop Control Statements
 Nested For Loop in Python

h
While Loop

ik
 A while loop in python iterates till its condition becomes False.

ha
 In other words, it executes the statements under itself while the condition it takes is True.
 When the program control reaches the while loop, the condition is checked.
.S
 If the condition is true, the block of code under it is executed.

.A

Remember to indent all statements under the loop equally.


 After that, the condition is checked again.
.A

 This continues until the condition becomes false. Then, the first statement, if any, after
the loop is executed.
of

>>> a=3
Pr

>>> while(a>0):
print(a)
a-=1

3
2
1
 This loop prints numbers from 3 to 1. In Python, a—wouldn’t work. We use a-=1 for the
same.

18
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

a. An Infinite Loop
 Be careful while using a while loop.

h
 Because if you forget to increment the counter variable in python, or write flawed

ik
logic, the condition may never become false.

ha
In such a case, the loop will run infinitely, and the conditions after the loop will
.S
starve.
 To stop execution, press Ctrl+C.
.A

 However, an infinite loop may actually be useful.


 This in cases when a semaphore is needed, or for client/server programming.
.A

b. The else statement for while loop


 A while loop may have an else statement after it.
of

 When the condition becomes false, the block under the else statement is executed.
Pr

 However, it doesn’t execute if we break out of the loop or if an exception is raised.

>>> a=3
>>> while(a>0):
print(a)
a-=1
else:
print("Reached 0")

19
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

3
2
1
Reached 0
 In the following code, we put a break statement in the body of the while loop for a==1.
So, when that happens, the statement in the else block is not executed.

>>> a=3
>>> while(a>0):
print(a)
a-=1

h
if a==1: break;

ik
else:
print("Reached 0")
ha
.S
3
2
.A

c. Single Statement while


 Like an if statement, if we have only one statement in while’s body, we can write it all in
.A

one line.

>>> a=3
of

>>> while a>0: print(a); a-=1;


Pr

3
2
1
 We can see that there were two statements in while’s body, but we used semicolons to
separate them. Without the second statement, it would form an infinite loop.

20
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

For Loop
 Python for loop can iterate over a sequence of items.
 The structure of a for loop in Python is different than that in C++ or Java.
 That is, for(int i=0;i<n;i++) won’t work here.
 In Python, we use the ‘in’ keyword.
 Lets see a Python for loop Example

>>> for a in range(3):


print(a)

0
1

h
ik
2

ha
If we wanted to print 1 to 3, we could write the following code.

>>> for a in range(3):


.S
print(a+1)
.A

1
2
.A

3
of
Pr

21
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

a. The range() function


 This function yields a sequence of numbers. When called with one argument, say n, it
creates a sequence of numbers from 0 to n-1.

>>> list(range(10))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

 We use the list function to convert the range object into a list object.
 Calling it with two arguments creates a sequence of numbers from the first to the
second.

>>> list(range(2,7))

h
[2, 3, 4, 5, 6]

ik
 We can also pass three arguments. The third argument is the interval.

ha
>>> list(range(2,12,2))
.S
[2, 4, 6, 8, 10]
 Remember, the interval can also be negative.
.A

>>> list(range(12,2,-2))
[12, 10, 8, 6, 4]
.A

 However, the following codes will return an empty list.


of

>>> list(range(12,2))
Pr

[]
>>> list(range(2,12,-2))
[]
>>> list(range(12,2,2))
[]

b. Iterating on lists or similar constructs


 We aren’t bound to use the range() function, though. You can use the loop to iterate
on a list or a similar construct.

>>> for a in [1,2,3]:


print(a)

22
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

1
2
3
>>> for i in {2,3,3,4}:
print(i)
2
3
4

 You can also iterate on a string.

h
>>> for i in 'wisdom':

ik
print(i)

ha
w
i
.S
s
d
.A

o
m
.A

c. Iterating on indices of a list or a similar construct



of

The len() function returns the length of the list.


 When you apply the range() function on that, it returns the indices of the list on a
Pr

range object. You can iterate on that.

>>> list=['Romanian','Spanish','Gujarati']
>>> for i in range(len(list)):
print(list[i])
Romanian
Spanish
Gujarati

23
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

d. The else statement for for-loop


 Like a while loop, a for-loop may also have an else statement after it. When the loop is
exhausted, the block under the else statement executes.

>>> for i in range(10):


print(i)
else:
print("Reached else")
0
1
2

h
3

ik
4

ha
5
6
.S
7
8
.A

9
Reached else
.A

 Like in the while loop, it doesn’t execute if you break out of the loop or if an exception is
of

raised.
Pr

>>> for i in range(10):


print(i)
if(i==7): break
else: print("Reached else")
0
1
2
3
4
5
6
7

24
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

4. Nested for Loops Python


 We can also nest a loop inside another.
 We can put a for loop inside a while, or a while inside a for, or a for inside a for, or a
while inside a while. Or we can put a loop inside a loop inside a loop.
 We can go as far as you want.

>>> for i in range(1,6):


for j in range(i):
print("*",end=' ')
print()

h
*

ik
**

ha
**
***
.S
****
Let’s look at some nested while loops to print the same pattern.
.A

>>> i=6
>>> while(i>0):
.A

j=6
while(j>i):
of

print("*",end=' ')
Pr

j-=1
i-=1
print()
*
**
***
****
*****

25
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

Loop Control Statements in Python


 Sometimes, we may want to break out of normal execution in a loop.
 For this, we have three keywords in Python- break, continue, and pass.

h
ik
a. break statement

ha
 When we put a break statement in the body of a loop, the loop stops executing, and
control shifts to the first statement outside it.
.S
 We can put it in a for or while loop.
.A

>>> for i in 'break':


print(i)
.A

if i=='a': break;

b
of

r
Pr

e
a

b. continue statement
 When the program control reaches the continue statement, it skips the statements after
‘continue’.
 It then shifts to the next item in the sequence and executes the block of code for it.
 We can use it with both for and while loops.
>>> i=0
>>> while(i<8):

26
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

i+=1
if(i==6): continue
print(i)
1
2
3
4
5
7
8

h
 If here, the iteration i+=1 succeeds the if condition, it prints to 5 and gets stuck in an

ik
infinite loop. You can break out of an infinite loop by pressing Ctrl+C.

ha
>>> i=0
>>> while(i<8):
.S
if(i==6): continue
print(i)
.A

i+=1
0
.A

1
2
of

3
Pr

4
5

c. pass statement
 In Python, we use the pass statement to implement stubs.
 When we need a particular loop, class, or function in our program, but don’t know what
goes in it, we place the pass statement in it.
 It is a null statement.
 The interpreter does not ignore it, but it performs a no-operation (NOP).
>>> for i in 'selfhelp':

27
Padmashri Dr. Vitthalrao Vikhe Patil Institute Of Technology Engineering (Polytechnic ), Pravaranagar
PWP-22616,CM

pass
>>> print(i)
p

 To run this code, save it in a .py file, and press F5. It causes a syntax error in the shell.

h
ik
ha
.S
.A
.A
of
Pr

28

You might also like