SRSS 2020 P2
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
This question paper consists of 9 printed pages and 1 blank page. SERANGOON SECONDARY SCHOOL PRELIMINARY EXAMINATION SECONDARY 4 EXPRESS CANDIDATE NAME ( ) CLASS CENTRE NUMBER S INDEX NUMBER COMPUTING 7155/02 Paper 2 (Lab-based) 26 August 2020 2 hours 30 minutes Additional Materials: Electronic version of STBANK.xlsx data file Electronic version of USERNAME.py file Electronic version of FRUIT.py file Insert Quick Reference Glossary Setter(s): READ THESE INSTRUCTIONS FIRST Rename the COMPEXAM folder in the thumb drive to <your name>_<centre number>_<index number>. Retrieve the electronic files from this folder in the thumb drive. Save your work inside this folder in the thumb drive using the file name given. Answer all questions. All tasks must be done in the computer laboratory. You are not allowed to bring in or take any pieces of work or materials on paper or media in any form. Programs are to be written in Python. Save your work using the file name given in the question as and when necessary. The number of marks is given in brackets [ ] at the end of each question or part question. The total number of marks for this paper is 50. For Examiner’s Use 50
2 Quick Reference for Python This quick reference shows some examples of the Python language constructs. The complete Python language is not limited to these examples.
3 1. Identifiers When naming functions, variables and modules, the following rules must be observed: Names should begin with character 'a' - 'z' or 'A' - 'Z' or '_' and followed by alphanumeric characters or '_' Reserved words should not be used. User-defined identifiers are case sensitive. 2. Comments and Documentation Strings # This is a comment """ This is a documentation string over multiple lines """ 3. Input/Output print ("This is a string") s = input ("Instructions to prompt for data entry.") 4. Import import <module> e.g. import math 5. Data Type Data Type Notes int integer float real number Bool boolean str string (immutable) list series of values 6. Assignment Assignment Statement Notes a = 1 integer b = c variable d = "This is a string" string mylist = [1, 2, 3, 5, 5] list or array 7. Arithmetic Operators: Operator Notes + - plus, subtract * / multiply, divide % remainder or modulus ** exponential or power // quotient of floor division 8. Relational Operators: Operator Notes == equality != not equal to > >= greater than, greater than or equal to < <= less than, less than or equal to 9. Boolean Expression Boolean Expression Notes a and b logical and a or b logical or not a logical not 10. Iteration while loop for loop while condition(s): <statement(s) for in range(n): <statement(s)> for record in records: <statement(s)>
4 11. Selection Type 1 Type 2 Type 3 if condition(s): <statement(s)> if condition(s): <statement(s)> else: <statement(s)> if condition(s): <statement(s)>
Content continues in the PDF.
Related notes
- Computing o level notes Notes/Practices · 2023
- BVSS Prelim P1 MSExam Papers · 2024
- BVSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 MSExam Papers · 2024
- computing notesNotes/Practices

