You are on page 1of 4

Laboratory Activity 1

Programming 1
Malillin, Edelyn Y.
Questions:
1. Use the print () function to print the line “Hello, Python!”
on the screen. Use the double quotes around the string.
2. Run the program. What was the output?
3. Having done that, use the print () function again, but this
time print your first name. Rum the program. What was
the output?
4. Remove the double quotes and run your code. Watch
Python’s reaction. What kind of error is thrown?
5. Remove the parentheses, put back the double quotes, and
run your code again. What kind of error is thrown this
time?
6. Change double quotes to single quotes, what happens?
Answers:

1. print (“Hello, Python”)

Output: It displays the line, “Hello, Python!”).


2. print (“Edelyn”)

Output: It displays my name, which is Edelyn

3. print (Edelyn)

Output: Name error: name ‘Edelyn’ is not defined.


4. print “Edelyn”

Output: Syntax error: Missing parentheses in call to ‘print’

5. print ‘Edelyn’

Output: Syntax error: Invalid character ‘’’ (U+2018)

You might also like