Book
Week 1 - Section 1 - Input and Output
Week 1 - Section 1 - Input and Output
In the first section of the first week we will learn how to send the output of a program to the screen and how to read from the keyboard.
Chapter 1.2 - Printing Results of Expressions
1.2 - Printing Results of Expressions
This next program does not have quotes around 2+3, and the computer will evaluate it as a mathematical expression. It will print 5 rather than 2+3.
print(2 + 3)
The code below will generate an error because the computer will try to evaluate “Hello World” as a mathematical expression, and that doesn't work at all:
print(Hello World)
The code above will print out an error SyntaxError: invalid syntax which is computer-speak for not knowing what “Hello” and “World” mean.
Try to print the output of other expressions using the CLI.