S3 ICT: Python Programming Basics (Paper 1 (basics))
Paper 1 (basics): ten questions on Python programming basics, with answers and notes.
| Item | Detail |
|---|---|
| Questions | 10 |
| Suggested time | 20 |
| Difficulty mix | Foundation 3 · Intermediate 3 · Challenge 3 · Error redo 1 |
| Chapter | Chapter: S3 ICT: Python Programming Basics |
| Level | S3 |
| # | Answer | One-line note |
|---|---|---|
| 1 | 8 | The plus sign adds the two integers, so 5 plus 3 gives 8. |
| 2 | 15 | The star sign means multiply, so 5 times 3 gives 15. |
| 3 | 3 and 1 | Double slash keeps the whole-number part of the quotient, 3, and the percent sign gives the remainder, 1. |
| 4 | 32 | The double star means power, so 2 multiplied five times gives 32. |
| 5 | 20 | int converts the string to the integer 12, then adding 8 gives 20. |
| 6 | Hithere | The plus sign joins the two strings without inserting a space. |
| 7 | 6 | len counts the characters, and Python has six letters. |
| 8 | 5 times | range(5) produces the five numbers 0 to 4, so the loop runs five times. |
| 9 | 11 | Multiplication is done first, so 4 times 2 is 8 and adding 3 gives 11. |
| 10 | 2.5 | A single slash does true division and keeps the decimal, giving 2.5; use 10 // 4 for the whole part. |
Write down the value of every variable line by line before stating the output. Remember input returns a string, so convert it with int before adding.Tutor Registration →
Questions and answers are written originally by the TutorZone team and are not taken from any school, publisher or examination authority paper. Every value is checked by computer.
© TutorZone · www.tutorzone.com.hk · For personal study and teaching use only.

