0% found this document useful (0 votes)
3 views21 pages

Python All Concepts40s (Responses)

The document contains a list of email addresses, scores, and names of individuals, followed by a series of Python programming questions and answers. It includes topics such as data types, comments, variable names, user input, and functions. The document appears to be an assessment or quiz related to Python programming.

Uploaded by

dbda.iacsdakurdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views21 pages

Python All Concepts40s (Responses)

The document contains a list of email addresses, scores, and names of individuals, followed by a series of Python programming questions and answers. It includes topics such as data types, comments, variable names, user input, and functions. The document appears to be an assessment or quiz related to Python programming.

Uploaded by

dbda.iacsdakurdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Timestamp Email Address Score Name

3/8/2025 12:25:35 shubhampawarask@g 36 / 40 Shubham Dhanlal Paw


3/8/2025 12:33:24 pranavpathak1998@g 31 / 40 pranav santosh patha
3/8/2025 12:40:15 kanasedipali5@gmail 23 / 40 Dipali Dattatray Kana
3/8/2025 12:41:42 paditya2148@gmail. 32 / 40 Aditya Pandey
3/8/2025 12:42:02 [email protected] 39 / 40 Bunty Virwani
3/8/2025 12:51:47 aarzoosrathaur@gmai 36 / 40 Aarzoo Rathaur
3/8/2025 12:59:19 priencess0192@gmai 33 / 40 Samiksha Santosh Ha
3/8/2025 12:59:45 karishmagaikwad456 27 / 40 Karishma Gaikwad
3/8/2025 13:01:30 shedagepooja4@gmai 37 / 40 Pooja Nandkumar Sh
3/8/2025 13:03:42 purushottamchavan1 38 / 40 Purushottam Laxmika
3/8/2025 14:43:02 jadhavyogi82@gmail 38 / 40 Yogita Vinod Jadhav
Roll No
What is Python? Which symbol is used for comments in Python?
DS24070013 A high-level program ##
DS24070010 A high-level program ##
DS24070004 A high-level program ##
DS24070028 A high-level program ##
DS24070003 A high-level program ##
DS2024711 A high-level program ##
DS24070012 A high-level program ##
DS24070005 A high-level program ##
DS2024710 A high-level program ##
DS24070018 A high-level program ##
DS24070029 A high-level program ##
What happens in the below Python OOP c
Which data type is used to store whole numbers in Python?
0,0 int
100,0 int
100,0 int
Error int
Error int
100,0 int
Error int
No output int
Error int
Error int
Error int
x=2
y=3 In Python, which of the following is NOT a valid variable name?
8 2ndNum
8 2ndNum
8 _value
8 2ndNum
8 2ndNum
8 2ndNum
8 2ndNum
10 XYZ
8 2ndNum
8 2ndNum
8 2ndNum
How do you get user input in Python?What data type does the input() function return?
input() str
input() str
input() str
input() str
input() str
input() str
input() str
input() str
input() str
input() str
input() str
What will be the output of the following code?
name = "Alice"
Which operator is used for exponentiation in Python?
** agename
My = 25 is Alice and I am 25 years old.
* My name is Alice and I am 25 years old.
** My name is "Alice" and I am 25 years old.
** My name is Alice and I am 25 years old.
** My name is Alice and I am 25 years old.
** My name is Alice and I am 25 years old.
** My name is Alice and I am 25 years old.
** My name is Alice and I am 25 years old.
** My name is Alice and I am 25 years old.
** My name is Alice and I am 25 years old.
** My name is Alice and I am 25 years old.
What is the result of the following expression?
What is the correct way to convert a string to an integer in Python?
int(str_value) 12 // 5 2
int(str_value) 2
convert_to_int(str_value) 2.5
int(str_value) 2
int(str_value) 2
int(str_value) 2
int(str_value) 2
int(str_value) 2
int(str_value) 2
int(str_value) 2
int(str_value) 2
How do you add a multi-line comment in Python?Which data type is used to store a sequence of characters in Python?
" " " " Here we can write multiple lines of c str
" " " " Here we can write multiple lines of c str
" " " " Here we can write multiple lines of c str
" " " " Here we can write multiple lines of c str
" " " " Here we can write multiple lines of c str
" " " " Here we can write multiple lines of c str
" " " " Here we can write multiple lines of c str
" " " " Here we can write multiple lines of c str
# This is a comment str
" " " " Here we can write multiple lines of c str
" " " " Here we can write multiple lines of c str
Which of the following is NOT a valid Python
How
variable
do youname?
check data type of a variable in Python?
2ndVar type(variable)
2ndVar type(variable)
_var type(variable)
2ndVar type(variable)
2ndVar type(variable)
2ndVar type(variable)
2ndVar type(variable)
2ndVar variable.type()
2ndVar type(variable)
2ndVar type(variable)
2ndVar type(variable)
x=5
What is the correct way to create a list in Python?
y=2
l = [1, 2, 3] 1
l = [1, 2, 3] 1
l = [1, 2, 3] 2.5
l = [1, 2, 3] 1
l = [1, 2, 3] 1
l = [1, 2, 3] 1
l = [1, 2, 3] 1
l = [1, 2, 3] 1
l = [1, 2, 3] 1
l = [1, 2, 3] 1
l = [1, 2, 3] 1
x=5
y=3
How do you define a function 'my_func' in Python?
def my_func(): z=7 26
void my_func(): 26
def my_func(): 26
def my_func(): 26
def my_func(): 26
def my_func(): 26
def my_func(): 26
def my_func(): 26
def my_func(): 26
def my_func(): 26
def my_func(): 26
x=4
y=3
Which method is used to convert a string to uppercase in Python?
z=2 262144 "abc".upper()
262144 "abc".upper()
4096 "abc".upper()
4096 "abc".upper()
262144 "abc".upper()
262144 "abc".upper()
262144 "abc".upper()
262144 "abc".upper()
262144 "abc".upper()
262144 "abc".upper()
262144 "abc".upper()
Which method is used to convert a string toHow
lowercase
do youinconcatenate
Python? two lists in Python?
"ABC".lower() list1 + list2
"ABC".lower() list1 + list2
"ABC".lower() concat(list1,list2)
"ABC".lower() list1 + list2
"ABC".lower() list1 + list2
"ABC".lower() list1 + list2
"ABC".lower() list1 + list2
"ABC".lower() concat(list1,list2)
"ABC".lower() list1 + list2
"ABC".lower() list1 + list2
"ABC".lower() list1 + list2
x=5
y=3 Which of the following is a valid way to initialize an empty dictionary 'd1'
15 d1={}
15 d1={}
15 d1 = []
15 d1={}
15 d1={}
15 d1={}
15 d1={}
15 d1 = []
15 d1={}
15 d1={}
15 d1={}
Which of the following is NOT a valid way toHow
initialize
do youancheck
tuple 't1'
if a in
value
Python?
is present in a list 'l1' in Python?
t1 = (7) value in l1
t1 = (7) value in l1
t1 = tuple('ABC') value in l1
t1 = (7) value in l1
t1 = (7) value in l1
t1 = (7) value in l1
t1 = (7) l1.contains(value)
t1 = tuple() value in l1
t1 = (7) value in l1
t1 = (7) value in l1
t1 = (7) value in l1
Which data type is used to store true or false
Howvalues
do you
in Python?
remove an item from a list 'l1' in Python?
bool l1.remove(item)
bool l1.remove(item)
Boolean del l1[item]
bool l1.remove(item)
bool l1.remove(item)
Boolean l1.remove(item)
bool l1.remove(item)
bool l1.remove(item)
Boolean l1.remove(item)
bool l1.remove(item)
bool l1.remove(item)
What is the output of the following code snippet?
Which of following is a constructor in python?
print("Hello"
TypeError: can+ 2)only concatenate str (not "int
__init__
TypeError: can only concatenate str (not "int __new__ and __init__
TypeError: can only concatenate str (not "int __init__
TypeError: can only concatenate str (not "int __init__
TypeError: can only concatenate str (not "int __new__ and __init__
TypeError: can only concatenate str (not "int __new__ and __init__
TypeError: can only concatenate str (not "int __init__
TypeError: can only concatenate str (not "int __new__ and __init__
TypeError: can only concatenate str (not "int __new__ and __init__
TypeError: can only concatenate str (not "int __new__ and __init__
TypeError: can only concatenate str (not "int __new__ and __init__
for num in range(n): if n % num == 0:
if n%num == 0: return False
print("prime")
ZeroDivisionError All prime True
return numbers from 2 to 100
not prime All prime numbers from 2 to 100
ZeroDivisionError All prime numbers from 2 to 100
ZeroDivisionError Logical error
ZeroDivisionError All prime numbers from 2 to 100
not prime All prime numbers from 2 to 100
ZeroDivisionError Logical error
prime Function is not checking against all ‘n’ nu
ZeroDivisionError All prime numbers from 2 to 100
ZeroDivisionError All prime numbers from 2 to 100
ZeroDivisionError All prime numbers from 2 to 100
print("Number is even") Add = 0
else:
TypeError TypeError
TypeError SyntaxError
TypeError SyntaxError
TypeError output will be following
TypeError output will be following way
TypeError output will be following way
TypeError output will be following
SyntaxError output will be following way
TypeError output will be following way
TypeError output will be following way
TypeError output will be following way
Val = int(Text1[I]) Val = int(Text1[I])
q=20
Val = Val + 1 Val = Val + 1
p*=q//3
Text2Loop
Infinire = Text2 + str(Val) Text2
BDA *34 = Text2 + str(Val) Syntax Error
Infinire Loop DBDA 400, 420
DBDA BDA *34 Syntax Error
BDA 23 BDA 23 Syntax Error
Infinire Loop BDA *34 Syntax Error
Infinire Loop BDA *34 Syntax Error
DBDA BDA 23 Syntax Error
BDA 23 BDA 23 400, 420
Infinire Loop BDA *34 Syntax Error
Infinire Loop BDA 23 Syntax Error
BDA *34 BDA *34 Syntax Error
x="hello world"
print(x[:2],x[:-2],x[-2:])
print(x[6],x[2:4])
output will be
Syntax Error
output will be
output
output will be
output will be
output will be
output will be
output will be
output will be
output will be

You might also like