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

Python 2batch 1

The document outlines various fundamental concepts and features of Python, including keywords, variables, data types, type casting, and looping statements. It also presents several code snippets and questions to determine expected outputs from Python code. Key differences between certain operators and control flow statements are discussed, along with the behavior of logical expressions.

Uploaded by

balajibaala06
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 views3 pages

Python 2batch 1

The document outlines various fundamental concepts and features of Python, including keywords, variables, data types, type casting, and looping statements. It also presents several code snippets and questions to determine expected outputs from Python code. Key differences between certain operators and control flow statements are discussed, along with the behavior of logical expressions.

Uploaded by

balajibaala06
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

Python:

1, What are the key features of Python?

2, List down the Python keywords and explain it

3, What are variables in Python and also explain the scope of variable
4, What are mutable and immutable data types?

5, What is type casting and explain it types

6, What is the difference between ‘= = ‘ and ‘is’ ?

7, difference between ‘break’, ‘continue’ and ‘pass’

8, What are looping statements and explain its types

9, What is function in Python and explain the types of arguments

10, difference between argument and parameter

Find the output of the following:

1, what is the output of the following:

a = [1,2,3]

b = [1,2,3]

print(a == b)

print(a is b)

2, What is the output of the following:


a = 10

def test():

a = 20

print(a)

test()

print(a)

3, What is the output of this code?


for i in range(1, 5, 2)

print(i, end=" ")


4, What will be the output?

def f():

return "Hi"

print("Hello")
print(f())

5, Output of the following:

x = 10

x += 5

x -= 3

print(x)

6, Find the output of the following:


print(10 / 3)

print(10 // 3)

print(10 % 3)

7, Find the output of the following:

print(2 ** 3 ** 2)

8, Find the output of the following:

print(True == 1)
print(False == 0)

print(True + True)

print(False + True)

9, Find the output of the following:

print(5 < 6 < 7)

print(5 < 6 > 7)


10, Find the output of the following:

print(0 and 10)

print(0 or 10)

print(5 and 0)
print(5 or 0)

11, Find the output of the following:

print(2 < 3 and 4 < 5)

print(2 < 3 and 4 > 5)

print(2 > 3 or 4 < 5)

print(not (2 < 3))

You might also like