Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuition

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labs

Reference

GlossaryBlogDiscoveries
Practice › Class 8 › Computer Science

Introduction to Python: practice questions

Class 8 Computer Science. Ten questions with step-by-step answers, for CBSE and ICSE. Try each one before you open its answer.

Practise this with your AI tutorGo to the questions

Key ideas

  • print, variables and input.
  • These are the multi-step questions examiners like to set. Read each one twice, write down what you know, then plan before you calculate.
  • These go beyond the syllabus. Each one has a neat idea that makes it short; brute force is slow.

Read each question twice and say the answer out loud before you check it. For code or binary questions, work it out on paper step by step, the way a computer would.

Ten questions

  1. 1.What does this print? print(35 // 5)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 7

  2. 2.What does this print? x = 7 x = x + 7 print(x)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 14

  3. 3.What does this print? x = 9 x = x + 7 print(x)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 16

  4. 4.What does this print? print(33 % 8)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 1

  5. 5.What does this print? print(54 // 9)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 6

  6. 6.What does this print? print(7 % 2)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 1

  7. 7.What does this print? x = 2 y = 9 print(x * y + 1)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 19

  8. 8.What does this print? print(9 % 2)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 1

  9. 9.What does this print? x = 8 x = x + 6 print(x)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 14

  10. 10.What does this print? print(33 % 4)

    Show the answer

    Think: // is whole-number division, % is the remainder.

    Work: Run it line by line.

    Answer: 1

Before you check an answer

  • // is whole-number division, % is the remainder.

Questions students ask

What does Introduction to Python in Class 8 Computer Science cover?
print, variables and input. These are the multi-step questions examiners like to set. Read each one twice, write down what you know, then plan before you calculate. These go beyond the syllabus. Each one has a neat idea that makes it short; brute force is slow.
How should I practise Introduction to Python?
Read each question twice and say the answer out loud before you check it. For code or binary questions, work it out on paper step by step, the way a computer would. Try all ten questions on this page, then open the chapter in Gradient tuition for step-by-step lessons, a live experiment and an AI tutor who explains where you went wrong.
Is this for CBSE or ICSE?
The questions follow the Class 8 Computer Science syllabus shared by CBSE and ICSE / ISC, and suit most state boards too.

Stuck on one of these?

Gradient tuition teaches Introduction to Python step by step, with experiments you can play with and an AI tutor who circles the part of the question you missed.

Open Introduction to Python in tuition
Web pages with HTMLAll practice