Question types

Review of Python – 1 question types

123 questions across 8 question groups — pick any mix to generate a Computer Science paper with step-by-step answer keys.

123
Questions
8
Question groups
5
Question types
Sample Questions

Review of Python – 1 questions

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

Q 6M.C.Q1 Mark
 Common types of exception in python are:
  • A
    SyntaxError
  • B
    ZeroDivisionError
  • (i) and (ii) Both
  • D
    None of the above

Answer: C.

View full solution
Q 8M.C.Q1 Mark
 The continue statement is used:
  • To pass the control to the next iterative statement.
  • B
    To come out from the iteration.
  • C
    To break the execution and passes the control to else statement.
  • D
    To terminate the loop.

Answer: A.

View full solution
Q 191 Marks Each1 Mark
Identify invalid variable names from the following, give reason for each:
Group, if, int, total marks, S.I., volume,
tot_strength, #tag, tag$, 9a
View full solution
Q 201 Marks Each1 Mark
A book publisher conducted a survey and found that 70% of the teenagers love to read fiction novels. In general, maximum 40% of the population of a city are teenagers. The publisher earns a profit of Rupees n on the sale of each copy of a fiction novel. Write Python script to find maximum profit that the publisher can earn by selling copies of one fiction novel to teenagers in a city.
View full solution
Q 232 Marks Each2 Marks
 Write a script which inputs two numbers from the user and checks if first number is divisible by the second or not. The script should then display an appropriate message.
View full solution
Q 252 Marks Each2 Marks
Write Python script to input a time duration in seconds and display it in the following : ____________ Seconds = _____ hr ________ min _______ seconds. For example, if the user input is 4526, the output should be: 4526 seconds = 1 hr 15 min 26 seconds
View full solution
Q 315 Marks Each5 Marks
Pawan is confused in understanding Dictionary concept. Help him to understand the concept by choosing the appropriate answer. (a) Which statement will display Not Available?
(i)Statement 9 (ii)Statement 10 (iii)Statement 11(iv)Statement 13
(b) Choose the key from Dictionary.
(i)ADMNO (ii)‘admno’ (iii)101 (iv)“Not Available”
(c) Which statement will display None?
(i)Statement 9 (ii)Statement 10 (iii)Statement 11(iv)Statement 13
(d) Which Statement will display Tejas?
(i) Statement 8 (ii) Statement 9 (iii) Statement 10 (iv) Statement 11
(e) Choose the identifier.
(i) ADMNO (ii) ‘admno’ (iii) setdefault (iv)Not Available
View full solution
Q 325 Marks Each5 Marks
The Teacher wrote the following code. Sanya was absent on the day when the topic was taught. Help her to complete the assignment. Choose the output on the basis of the above code.
(a) Which statement is used to display “HeLLo PyThon”?
(i) Statement 1 (ii) Statement 12
(iii)Statement 13 (iv) No Statement will display.
(b) Which statement will check for capital letters?
(i) Statement 6 (ii) Statement 7
(iii) Statement 8 (iv) Statement 9
(c) Which statement will convert it into capital letters?
(i) Statement 6 (ii) Statement 7
(iii) Statement 8 (iv) Statement 9
(d) Which is iterative Statement?
(i) Statement 5 (ii) Statement 6
(iii) Statement 8 (iv)There is No iterative Statement.
(e) What will be the output of Python code (Statement 1 to Statement 13)
(i) HeLLo PyThon (ii) No Output
(iii) hEllO pYtHON (iv) Hello Python
View full solution
Q 335 Marks Each5 Marks
Choose the correct option.

(a) What is String data-type in Python?

(i)It is written in double quotes only.

(ii)Its value can be changed.

(iii)It is enclosed in square brackets.

(iv)It is immutable data-type.

(b) Ms. Ragini is confused on the way to compare the strings. Help her in choosing the correct statement.

(i)equal() (ii)equals() (iii) == (iv)compare()

(c) Tejas is confused in the output of the following code. Help him to choose the correct option.

age = 12

txt = "My name is Tejas, I am " , age

print(txt)

(i)('My name is Tejas, I am ', 12)

(ii)My name is Tejas, and I am 12

(iii)(My name is Tejas, I am , 12)

(iv)[My name is Tejas, I am , 12]

(d) Help mini to choose the correct output of the following Python code.

rollno = 3

name = "Mini"

Average = 88.76

Txt = "My name is {1}, having roll no {0} and scored {2} percent."

print(Txt.format(rollno, name, Average))

(i)My name is ‘Mini’, having roll no 3 and scored 88.76 percent.

(ii)My name is Mini, having roll no 3 and scored 88.76 percent.

(iii)‘My name is Mini, having roll no 3 and scored 88.76 percent.’

(iv)(My name is Mini, having roll no 3 and scored 88.76 percent.)

(e) Help Gurnika to choose the correct option for the following Python code.

b = "Hello, World!"

print(b[-5:2])

(i)Hello, World! (ii)orl (iii) Error (iv) No Output

View full solution

Generate a Review of Python – 1 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