Question types

PYTHON question types

66 questions across 6 question groups — pick any mix to generate a COMPUTER APPLICATIONS paper with step-by-step answer keys.

66
Questions
6
Question groups
5
Question types
Sample Questions

PYTHON questions

One sample from each question group in this chapter. Select any group above to see the full set with answer keys.

Q 2M.C.Q [1M]1 Mark
Which of the following is the name of a function that displays in output screen?
  • A
    disp
  • B
    display
  • print
  • D
    printall

Answer: C.

View full solution
Q 3M.C.Q [1M]1 Mark
Assume that a list ttsl exists. What does the below line display?
print (ttsl[::-1])
  • A
    The whole of the array
  • B
    The array starting with first element, and alternating
  • The reverse of the array
  • D
    None of these

Answer: C.

View full solution
Q 212 Marks Quetions2 Marks
Write a program in Python to Take two strings as input. Print out either the longer string, or that the two strings are of equal length. For example:
Input:dhruv, aseem
Output: The two strings are of equal length
View full solution
Q 242 Marks Quetions2 Marks
Ajit is a programmer who is learning about operators. He is confused about the usage of + operator as it can be used to combine strings too. Explain to him clearly the role of the + operator in a Python program?
View full solution
Q 252 Marks Quetions2 Marks
You are looking at a very complex Python code that runs into many lines. To debug it, you must find out what the data type of two of the variables in the program are. What function in Python allows you to find out the data type of the variables?
View full solution
Q 284 Marks Quetions4 Marks
Write a program in Python to take an integer as input. If the number is zero or less, print an error message. Otherwise, print out "ab" those many times, end to end. For example:
Input: 0
Error in input 
Input: 3
ababab 
Input: 5
ababababab
View full solution
Q 294 Marks Quetions4 Marks
Write a program in Python to take an integer as input. If the number is 0 or less, print an error message. Otherwise, print out your name those number of times on the output screen. For example:
Input: -5
Error in input
Input: 3
DhruvKarthik 
DhruvKarthik
DhruvKarthik
Input: 1
DhruvKarthik
View full solution

Generate a PYTHON paper free

Pick question groups from the list above, set marks and difficulty, and export a branded PDF with step-by-step answer keys. First 3 chapters free — no signup.

Download App