Python basics: print, variables and input

This first RunPy unit covers the three tools every Python program uses: printing output to the screen, storing information in variables, and reading what the user types with input(). It's the standard entry point for KS3 Python and GCSE Computer Science, mapped board-agnostically to OCR J277, AQA 8525, Pearson Edexcel, Eduqas and WJEC. Every example runs in your browser via RunPy's built-in Skulpt-powered Python IDE — no install, nothing for IT to whitelist, and safe on school networks. Perfect for classroom teaching, GCSE and A Level revision, and independent or home-schooled learners.


What you'll learn

  • Use print() to display strings and numbers
  • Create and name variables (snake_case, meaningful names)
  • Read user input with input() and store it in a variable
  • Combine print() and variables to build a greeting program
  • Understand that input() always returns a string

UK GCSE topic coverage

  • Sequence & output
  • String literals
  • Output formatting & escape sequences
  • Variables & assignment
  • String concatenation
  • String formatting
  • Input & interactive I/O
  • End-of-unit consolidation

Worked example

Ask the user for their name and greet them

name = input("What is your name? ")
print("Hello, " + name + "!")

This whole unit is free with a RunPy account

Sign up free and get every lesson in this unit — fully interactive, with checked tasks, instant feedback, and progress tracking. No card required.


Lessons in this unit

Full interactive lessons with checked tasks are available to signed-in RunPy users. Every lesson below is free with a RunPy account.

  1. Your First Output
  2. Strings and Quotation Marks
  3. Line Breaks
  4. Introducing Variables
  5. Joining Strings with +
  6. f-strings
  7. Introducing input()
  8. Recap: Output & Variables

Frequently asked questions

Is this suitable for KS3?
Yes. Print, variables and input are the standard KS3 Python starting point across UK schools and the National Curriculum for computing.
Do I need to install Python?
No. RunPy runs Python entirely inside your browser via the Skulpt interpreter. Pupils can start writing and running code immediately.
Does input() need a prompt string?
It's optional, but including one (e.g. input("Name? ")) is good practice — it tells the user what they're being asked for.