Class 7 Computer & AI Chapter 4: Programming with Python: First Steps — practice questions with answers
Free practice for Class 7 Computer & AI, Chapter 4: Programming with Python: First Steps. Try the solved questions below, then take a free test with instant marking and explanations.
25 questions8 easy, 11 medium, 6 hardNCERT · CBSE · State boards
Sample questions with solutions
Q1. Which Python command shows text on the screen?
- print()
- show()
- write()
- display()
Show answer
Answer: A. print()
Why: print("Hello") displays Hello. [NAL syllabus, Class 7 Unit 4]
Why: print("Hello") displays Hello. [NAL syllabus, Class 7 Unit 4]
Q2. What will print("Namaste") display?
- Namaste
- "Namaste"
- Nothing
Show answer
Answer: A. Namaste
Why: The quotes mark the text but are not printed. [NAL syllabus, Class 7 Unit 4]
Why: The quotes mark the text but are not printed. [NAL syllabus, Class 7 Unit 4]
Q3. A named place in a program that stores a value, like age = 12, is called a ______.
Show answer
Answer: variable
Why: age is a variable holding 12. [NAL syllabus, Class 7 Unit 4]
Why: age is a variable holding 12. [NAL syllabus, Class 7 Unit 4]
Q4. After a = 5 and b = 3, what does print(a + b) show?
Show answer
Answer: 8 (± 0)
Why: 5 + 3 = 8. [NAL syllabus, Class 7 Unit 4]
Why: 5 + 3 = 8. [NAL syllabus, Class 7 Unit 4]
Q5. What does input() do in Python?
- Takes text typed by the user
- Prints text
- Ends the program
- Draws a picture
Show answer
Answer: A. Takes text typed by the user
Why: name = input("Your name? ") stores what the user types. [NAL syllabus, Class 7 Unit 4]
Why: name = input("Your name? ") stores what the user types. [NAL syllabus, Class 7 Unit 4]
Q6. marks = 45. if marks >= 40: print("Pass") else: print("Try again"). What is printed?
- Pass
- Try again
- Both
- Nothing
Show answer
Answer: A. Pass
Why: 45 ≥ 40 is True. [NAL syllabus, Class 7 Unit 4]
Why: 45 ≥ 40 is True. [NAL syllabus, Class 7 Unit 4]
Practise all 25 questions free
Timed test, marked instantly, with the correct answer and explanation for every question and a chapter-wise report.
Start the free testFrequently asked questions
How many practice questions are there for Class 7 Computer & AI Chapter 4: Programming with Python: First Steps?
25 questions (8 easy, 11 medium, 6 hard). A few are solved on this page; the free test shows the answer and explanation for every question after you submit.
Is this chapter from the NCERT book?
Yes — it follows the NCERT Class 7 Computer & AI syllabus, used by CBSE and many state boards.