- Python Programming for S3 – Getting Started
- Python Programming for S3: Output, Variables & Input
- Python Programming for S3 – Working with Variables
A Teaching Tutorial by Mr Brown, Computer Science teacher at Inverness High School.
Python is the fastest growing and one of the most used programming languages in the world.
It is used in most schools, universities and many large companies across the globe. You are going to learn the basics of the Python language.
It is a text based language so you’ll have to learn the specific keywords, exact grammar and correct punctuations to set out instructions – they have to be perfect to run! Coding is frustrating so take your time and check carefully but keep persevering!
1(a) We are going to use a cloud-based online environment called Repl.it to write and run our code so we can work anywhere.
In classroom go back to the assignment or just search in the browser for the “replit” home page. Click on “Sign up” blue button at the top right.
1(b) At the signup screen click on the Google icon to connect through your Google Account and just save the profile that appears.
1(c) On the home screen the folder “My repls” is where any projects you make will be in the cloud. Click the “+ New repl” button to start a new coding repl project.
1(d) Choose the language for coding as “Python”, type “Hello World” as the task name then click the “Create repl” button.
1(e) This is the Repl.it project coding screen with the typing code area left and the run screen at the right to see outputs when you click to “Run >” your program.
1(f) Type in the code below exactly to lines 1, 2 and 3; run program to see what happens.
print ("Hello world!") print ("Hello Inverness!") print ("Hello Inverness High School!")
1(g) Once the code is working click Submit, take a snip screenshot (instructions sheet for Chromebooks) of just part of the output screen and answer the questions below.
What does the program do?…
What print(..) of the Python language is used here and what does it do?…
What are the “…” for?
On Repl.it make a new Python programming project called “About Me” and write a program to display 3 sentences.
One that says your name, another that says what your favourite TV show is and what your favourite animal is. Test run, make mistakes and edit if need be. Take 2 snipped screenshots of the code and the working test run to be pasted below.