Only approved questions will enter the prompt. Questions repeated across selected lectures are automatically de-duplicated in the final prompt.
IncludedL46: Input/output and type conversion Theory2025 · 1 mark(s)
What will be the output of the following code:
x = "python"
y = "hello"
print(y + x)
a) "python hello"
b) "hello python"
c) "pythonhello"
d) "hellopython"
IncludedL46: Input/output and type conversion Theory2025 · 1 mark(s)
Which function will convert string "100" into integer?
a) int( )
b) str( )
c) float( )
d) id( )
IncludedL46: Input/output and type conversion Theory2025 · 1 mark(s)
What is the output of the following code:
print(str([1,2,3]))
a) '123'
b) '1,2,3'
c) '[1,2,3]'
d) error
IncludedL46: Input/output and type conversion Theory2025 · 1 mark(s)
What will be the output of the following Python code?
value= "12/4"
print("value")
(a) 12/4
(b) 3.0
(c) 3
(d) value
IncludedL46: Input/output and type conversion Theory2025 · 1 mark(s)
Predict the output of the following code?
exam="SEE 2025-26"
print(exam[-2::-2][::-1])
a) No output
b) 250 E
c) E 052
d) 2-520
IncludedL46: Input/output and type conversion Theory2025 · 1 mark(s)
Identify the invalid Python statement out of the following options
A) print("A", 10, end="*")
B) print("A", sep="*",10)
C) print("A", 10, sep="*")
D)print("A"*10)
IncludedL46: Input/output and type conversion Theory2025 · 1 mark(s)
Which of the following will convert a string to a list of characters?
(a) list()
(b) str.split()
(c) str()
(d) char()
IncludedL46: Input/output and type conversion Theory2025 · 1 mark(s)
Which function out of the following will return data type of object
a) id()
b) ord()
c) str()
d) type()
IncludedL46: Input/output and type conversion Theory2025 · 1 mark(s)
What will be the output of following:
t=(1,2,3,4)
print(sum( t[1:3]*3) )
a) Error
b) 15
c) 27
d) 9
IncludedL46: Input/output and type conversion Theory2025 · 2 mark(s)
What is the output of the following code?
for i in range(2,5):
for j in range(1,i+1):
print(j,end="")
print()
IncludedL46: Input/output and type conversion Theory2025 · 2 mark(s)
Write the output of the following
num1,num2=2,6
num1, num2=num2, num1+2
print(num1,num2)
IncludedL46: Input/output and type conversion Theory2025 · 3 mark(s)
Write one example python statement for each of the following:
1) Syntax Error 2) Implicit type conversion 3) Type casting
IncludedL46: Input/output and type conversion Theory2025 · 4 mark(s)
myaddress="Wazirpur 1, New Yamuna Nagar, New Delhi"
for i in range(_________) #line 1
if myaddress[i].____ : #line 2
print(myaddress[i].upper(), end="")
elif myaddress[i].______: # line 3
print("*",end="")
else:
print(myaddress[i],end="")
print()
print(len(myaddress.split(","))) #line 4
print(myaddress.replace("New","Old")) #line 5
a. Fill in the blank in Line 1 to calculate length of string
b. Write the function in line 2 to check lower letter.
c. Write the function in line 3 to check digit.
d. What will be the output of line 4.
IncludedL46: Input/output and type conversion Theory2025 · 4 mark(s)
Differentiate between implicit and explicit type conversion.
IncludedL46: Input/output and type conversion Theory2025 · 5 mark(s)
Mihir took part in a Code Challenge and was presented with following incomplete codes with problem statement each. Help Mihir to win the Code Challenge
(i) Write code for Fibonacci Series where every next term is sum of previous two terms
f=0
s=1
print(f)
print( ) #Statement-1
for i in range(10):
t= __________________________ #Statement-2
print(t)
f=s
s= ______________ #Statement-3
(ii) Complete the code to calculate sum of digits of a number
n=input("Enter a number :")
s= #Statement-1
for i in n:
s= #Statement-2
IncludedL46: Input/output and type conversion Theory2025 · 5 mark(s)
(i) What possible outputs(s) will be obtained when the following code is executed? Also write the maximum and minimum possible values of the variable From.
import random
ar=[20,30,40,50,60,70]
From=random.randint(1,3)
To=random.randint(2,4)
for k in range(From,To+1):
print(ar[k],end="#")
(a) 20#30#40 (b) 30#40#50# (c) 50#60#70# (d) 40#50#70#
(ii) Name the Python Library modules which need to be imported to invoke the following functions.
(a) sin() (b) randint()
Reset All Progress?
This will clear all Done and Missed marks and rebuild the schedule from scratch.
A backup will be created automatically before resetting. You can restore it from the Backups page.