Contenido del Curso
Introduction to Python
3. Conditional Statements
Introduction to Python
Storing Text
In the first chapter, you learned how to display the message "Hello world!"
in Python. This message is known as a string. In Python, strings are used to store text, which can also include numbers.
To store text in Python, you need to surround it with quotation marks (either single or double). For instance, you can store the word "Python"
in the language
variable and then display it:
Note
Quotation marks are mandatory. If you omit them, you'll get an error.
If you want to change an object into a string type, use the str()
function.
Task
Assign the course name 'Introduction to Python'
to the variable course
and output it.
¿Todo estuvo claro?
Contenido del Curso
Introduction to Python
3. Conditional Statements
Introduction to Python
Storing Text
In the first chapter, you learned how to display the message "Hello world!"
in Python. This message is known as a string. In Python, strings are used to store text, which can also include numbers.
To store text in Python, you need to surround it with quotation marks (either single or double). For instance, you can store the word "Python"
in the language
variable and then display it:
Note
Quotation marks are mandatory. If you omit them, you'll get an error.
If you want to change an object into a string type, use the str()
function.
Task
Assign the course name 'Introduction to Python'
to the variable course
and output it.
¿Todo estuvo claro?