2.3.3

Output

Test yourself

Output

Output is necessary so that we can see the results of programs.

Illustrative background for Why do we need outputs?Illustrative background for Why do we need outputs? ?? "content

Why do we need outputs?

  • Outputs are important so that we can communicate the result of a program to the user.
  • Outputs are usually delivered as text onto the screen.
Illustrative background for The print functionIllustrative background for The print function ?? "content

The print function

  • The output function in Python is called ‘print’.
  • The output function ‘prints’ data onto the screen.
    • E.g. print(“Hello, world!”) would output the text “Hello, World!”.
Illustrative background for What data can be outputted?Illustrative background for What data can be outputted? ?? "content

What data can be outputted?

  • Output data must be a string before we can print it.
  • If we want to display data that is not a string, then we must first cast it to a string.

Jump to other topics

1Computational Thinking & Algorithms

2Programming

3Hardware & Software

4Data

5The Internet

6Online Safety & Security

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson