100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary OCR COMPUTER SCIENCE: PYTHON TO ERL GUIDE - By GCSEMastery

Rating
-
Sold
-
Pages
2
Uploaded on
21-02-2025
Written in
2024/2025

This is to accompany my paper 2 for OCR GCSE Computer Science J277. This is a guide containg absolutely all the python you need to know for the exam, with its equivalent in ERL (Exam Reference Lanuage which is the coding language used in the papers). If you have any queries please feel free to message me. Also if you find this useful please leave a review it helps alot! ENJOY!!!

Show more Read less
Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course
School year
2

Document information

Uploaded on
February 21, 2025
Number of pages
2
Written in
2024/2025
Type
Summary

Subjects

Content preview

PYTHON OCR REFERENCE LANGUAGE
SELECTION
If/elseif
if pi == 3.14: if pi == 3.14 then
print(“Good”) print("Good")
elif pi == 3: elseif pi == 3 then
print(“ok...”) print("ok...")
else: else
print(“wrong!”) print("wrong!")
endif
Switch/case
match name: switch name:
case "1": case "1":
print("1") print("1")
case "2": case "2":
print("2") print("2")
case default: default:
print("????") print("????")
endswitch
ITERATION
FOR (count-controlled)
for count in range(1,11,2): for count = 1 to 10 step 2
# 11 is exclusive print(count)
print(count) next count
WHILE (condition controlled) - pre-check. Might never run
while continue == “Y” While continue == “Y”
continue = input(“continue?”) continue = input(“continue?”)
endwhile
DO…UNTIL (condition controlled) - post-check. Will run at least once
do
continue = input(“continue?”)
until continue == “N”
STRING MANIPULATION text = “Hello”
What it does PYTHON ERL Return: “Hello”
Count the number of characters in a len(text) text.length 5
string
Extract characters from a string text[1:5] [x:y]: text.substring[1:4] [x:y]: ello
x: first character x: first character
y: last (exclusive) y: number of characters incl x
Slice characters from left/right - text.left(2) / text.right(2) He / lo
Convert string to UPPERCASE text.upper() text.upper HELLO
Convert string to LOWERCASE text.lower() text.lower hello
Concatenate/Join strings + + -
Finds ASCII value of the character ord(“A”) ASC(A) 65
Finds the character corresponding to chr(65) CHR(65) A
the ASCII value

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
GCSEMastery
Follow You need to be logged in order to follow users or courses
Sold
10
Member since
2 year
Number of followers
0
Documents
15
Last sold
6 months ago
GCSEMastery

Welcome to GCSEMastery your shortcut to GCSE success! All our notes are of high quality made closely following the exam board specification. In most notes the specification point is even named in BOLD before the summmary underneath it so you know that youv\'e covered everything!. We have notes for AQA RS, AQA Geography & Edexcel Combined Science all split by papers or the cheaper bundle package. Check out the sample pages and make your own judgement. Finally, ENJOY A SWEET RIDE THROUGH GCSE!!!! :)

Read more Read less
5.0

6 reviews

5
6
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions