Print 42
Created on Dec. 9, 2016 by Julien Palard
Write a single line of code displaying the number 42.
What you'll learn
In this exercise you'll learn to use a function by trying the
print
builtin
function.
A function is a named thing that does something specific:
- the
print
function displays what's given to it, - the
len
function measures the thing we give to it, - …
The syntax to make a function work is called a "function call", to make print
display the string "Hello world"
the syntax is:
print("Hello world")
Advice
You'll need a number
and the print()
builtin function.
I'm not asking to print the string "42", (composed of two chars), but the number 42.
Don't hesitate to hit the "Submit" button, do as many test as you
like, until you feel confident you understand how print
works.