Skip to Content
Learn
Learn Python: Syntax
Strings

Computer programmers refer to blocks of text as strings. In our last exercise, we created the string “Hello world!”. In Python a string is either surrounded by double quotes ("Hello world") or single quotes ('Hello world'). It doesn’t matter which kind you use, just be consistent.

Instructions

1.

Print your name using the print() command.

2.

If your print statement uses double-quotes ", change them to single-quotes '. If it uses single-quotes ', change them to double-quotes ".

Try running your code again after switching the type of quote-marks. Is anything different about the output?

Folder Icon

Sign up to start coding

Already have an account?