The answersDownload the PDF
Worksheet

F1.2 Output: print

Programming basics · GCSE · OCR J277 2.2.1, AQA 8525 3.2.7, Edexcel 1CP2 6.4.1 · about 10 min

BugBotLab
NameClassDate

What this lesson is about

Print text and numbers, several things at once.

Questions 6 marks in all

  1. [1 mark]What does this program print?

    print("one", "two", "three")
  2. [1 mark]What does this program print?

    print("a" "b")
  3. [1 mark]What does this program print?

    print("above")
    print()
    print("below")
  4. [1 mark]What is the difference between 42 and "42"?

    1. A42 is a number and "42" is text that looks like a number
    2. BThere is no difference
    3. C"42" is a bigger number
    4. D42 is text and "42" is a number
  5. [1 mark]You want to print: BugBot's LED is green. Which line works?

    1. Aprint("BugBot's LED is green")
    2. Bprint('BugBot's LED is green')
    3. Cprint(BugBot's LED is green)
    4. Dprint("BugBot's LED is green)
  6. [1 mark]What does this program print?

    print("the answer is", 6 * 7)

The task: say hello

Print exactly three lines: - Hello from BugBot - 1 2 3 (three numbers, one print, commas between them) - BugBot BugBot BugBot (the word three times from one print)

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

print("Hello from BugBot")

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/f1-2-print/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Print a line with the battery and the distance both on it.
  2. Print a box made of +, - and | characters around the word BugBot, four lines tall.
  3. Find out what print("a", "b", sep="-") does.