Question 1

Edexcel Computer Science Specimen Paper 2GCSE7 marks

On the specification

6.2 Program constructs6.6 Subprograms
Question text

1 A program simulates the roll of a dice. The program uses a random number generator to create a random integer, between 1 and 6, to represent the roll. Open file Q01. Amend the code to add or complete lines to: • import the random library • create one variable • create one constant • assign the result of a library call to a variable • display a message and the contents of a variable on the screen. Do not add any additional functionality. Save your amended code file as Q01FINISHED.py (Total for Question 1 = 7 marks)