/
2.1.1.6Lab.py
42 lines (32 loc) · 1.04 KB
/
2.1.1.6Lab.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Lab 2.1.1.6 Lab the print() function
'''
Estimated time
5-10 minutes
Level of difficulty
Very easy
Objectives
becoming familiar with the print() function and its formatting capabilities;
experimenting with Python code.
Scenario
The print() command, which is one of the easiest directives in Python,
simply prints out a line to the screen.
In your first lab:
use the print() function to print the line Hello, Python! to the screen. Use double quotes
around the string;
having done that, use the print() function again, but this time print your first name;
remove the double quotes and run your code. Watch Python's reaction. What kind of
error is thrown?
then, remove the parentheses, put back the double quotes, and run your code again.
What kind of error is thrown this time?
experiment as much as you can. Change double quotes to single quotes,
use multiple print() functions on the same line, and then on different lines. See what happens.
'''
# solution
# 1:
print("Hello, Python!")
# 2:
print('liron')
# 3:
# NameError
# 4:
# syntex error