SEESathi
HomeSubjectsPast PapersMock TestSavedSearch
SEESathi

Empowering every Class 10 student across Nepal with world-class, beautifully structured study notes and solved questions.

Study

  • Master Notes
  • Question Bank
  • Past Papers

Subjects

  • Science & Technology
  • English
  • नेपाली
  • Social Studies
  • Computer Science
  • Mathematics

Resources

  • SEE Grading Guide
  • Syllabus Breakdown
  • Topper Answer Sets
  • Mock Test Simulator

Legal

  • About Mission
  • Editorial Board
  • Privacy Policy
  • Terms of Use

© 2026 SEE Sathi Technologies Pvt. Ltd. Kathmandu, Nepal.

Built for every Class 10 student across Nepal

Python — Basics of PythonSolved Questions· Unit 4
Computer Science · Chapter 04a
17 solved questions

Programming In Python - 4.1 Basic Of Python

Every question in this chapter, answered and explained — step-by-step solutions drawn live from the chapter library across 1 question section.

Section A: Concept in Practice-1 (Textbook MCQs)17
01

Section A: Concept in Practice-1 (Textbook MCQs)

17
1Textbookcs1-q1

Which function is used to take user input in Python? a) scanf() b) cin c) input() d) read()

Ans.c) input() — the input() function takes user input as a string in Python.
2Textbookcs1-q2

What will be the output of the following code? a, b = 10, 3 print(a // b) a) 3.33 b) 3 c) 4 d) Error

Ans.b) 3 — // is floor division; 10 // 3 gives the whole-number quotient 3.
3Textbookcs1-q3

What is the purpose of the else clause in a loop? a) It runs when the loop finishes without encountering break. b) It runs when the loop finishes with break. c) It executes before the loop. d) It has no effect.

Ans.a) It runs when the loop finishes without encountering break.
4Textbookcs1-q4

What is the output of 2 ** 3 ** 2? a) 64 b) 512 c) 9 d) None of the above

Ans.b) 512 — the ** operator is right-associative, so 2 ** 3 ** 2 = 2 ** (3 ** 2) = 2 ** 9 = 512.
5Textbookcs1-q5

What will be the output of the following code? num = -5 if num > 0: print("Positive") elif num == 0: print("Zero") else: print("Negative") a) Positive b) Zero c) Negative d) None of the above

Ans.c) Negative — since num = -5 is not greater than 0 and not equal to 0, the else block runs.
6Textbookcs1-q6

Which of the following is not a valid conditional statement in Python? a) if condition: b) elif condition: c) else condition: d) else:

Ans.c) else condition: — the else keyword never takes a condition; the correct form is simply 'else:'.
7Textbookcs1-q7

How many times will the loop run? for i in range(2, 10, 2): print(i) a) 3 b) 4 c) 5 d) 8

Ans.b) 4 — range(2, 10, 2) generates 2, 4, 6, 8, which is 4 values.
8Textbookcs1-q8

What will be the output of the following while loop? x = 5 while x > 0: print(x, end=" ") x -= 1 a) 5 4 3 2 1 b) 5 4 3 2 c) 4 3 2 1 d) None of these

Ans.a) 5 4 3 2 1 — the while loop prints x from 5 down to 1 before x becomes 0 and the loop stops.
9Textbookcs1-q9

What will be the output of this code? fruits = ["apple", "banana", "cherry"] print(fruits[-1]) a) apple b) banana c) cherry d) Error

Ans.c) cherry — negative index -1 refers to the last element of the list.
10Textbookcs1-q10

How do you add a new key-value pair to a dictionary? a) dict.add("key", "value") b) dict["key"] = "value" c) dict.append("key", "value") d) dict.insert("key", "value")

Ans.b) dict["key"] = "value" — this is the correct way to add or update a key-value pair.
11Textbookcs1-q11

What does the following code return? text = "hello" print(text.upper()) a) hello b) HELLO c) Hello d) Error

Ans.b) HELLO — upper() converts all characters of the string to uppercase.
12Textbookcs1-q12

What will be the output of the following code? text = "Python" print(len(text)) a) 5 b) 6 c) 7 d) Error

Ans.b) 6 — "Python" has 6 characters, so len(text) returns 6.
13Textbookcs1-q13

What will be the output of abs(-10)? a) -10 b) 1 c) 0 d) None of above

Ans.The mathematical value of abs(-10) is 10 (the absolute/positive value of -10). Note: among the printed textbook options (a) -10, b) 1, c) 0, d) None of above), the correct numeric answer 10 is not explicitly listed, so the intended correct choice is d) None of above.
14Textbookcs1-q14

What does math.sqrt(16) return? a) 4.0 b) 4 c) 8 d) None of these

Ans.a) 4.0 — math.sqrt() always returns a float value, so the square root of 16 is 4.0.
15Textbookcs1-q15

What will be the output of this program? for i in range(3): for j in range(2): print(i, j)

Ans.The nested loop prints: 0 0 / 0 1 / 1 0 / 1 1 / 2 0 / 2 1 — because the outer loop runs for i = 0,1,2 and the inner loop runs for j = 0,1 for each value of i.
16Textbookcs1-q16

What happens when break is used inside a loop? a) It skips the current iteration and continues the loop. b) It terminates the loop immediately. c) It raises an error. d) It moves to the next loop.

Ans.b) It terminates the loop immediately.
17Textbookcs1-q17

What will be the output of the following code? for i in range(5): if i == 3: continue print(i, end=" ") a) 0 1 2 b) 0 1 2 4 c) 0 1 2 3 4 d) None of the above

Ans.b) 0 1 2 4 — continue skips printing when i == 3, so 3 is missing from the output, while 0, 1, 2, and 4 are printed.
Review the NotesBack to Chapter