Input/output and type conversion Theory
Concept ID: XI_U2_INPUT_OUTPUT_TYPE_CONVERSION.
Primary Sub-subtopic: Input/output and type conversion.
Question-bank grouping: Python Basics and Data Concepts.
Use this lecture for theory, examples, misconceptions, and short PYQ checks mapped to this concept ID.
Key things we'll cover
Input/output and type conversion
PYQ references used by all prompt types16 included0 excluded
Flagged questions are excluded from Study Notes, PPT, and Student Notes references until corrected in Paper Analyzer.
Included
ID 1074 · 2025 · 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"
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1077 · 2025 · 1 mark(s)
Which function will convert string "100" into integer?
a) int( )
b) str( )
c) float( )
d) id( )
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1111 · 2025 · 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
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1255 · 2025 · 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
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1297 · 2025 · 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
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1338 · 2025 · 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)
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1424 · 2025 · 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()
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1593 · 2025 · 1 mark(s)
Which function out of the following will return data type of object
a) id()
b) ord()
c) str()
d) type()
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1602 · 2025 · 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
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1090 · 2025 · 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()
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1210 · 2025 · 2 mark(s)
Write the output of the following
num1,num2=2,6
num1, num2=num2, num1+2
print(num1,num2)
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1322 · 2025 · 3 mark(s)
Write one example python statement for each of the following:
1) Syntax Error 2) Implicit type conversion 3) Type casting
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1182 · 2025 · 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.
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1506 · 2025 · 4 mark(s)
Differentiate between implicit and explicit type conversion.
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1144 · 2025 · 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
Python Basics and Data Concepts → Input/output and type conversion
Included
ID 1289 · 2025 · 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()
Python Basics and Data Concepts → Input/output and type conversion