You are on page 1of 6

Welcome to Python

Python is one of the most popular


programming languages, widely used in web
and game development, data analytics, data
science, machine learning and much more.

Python

This course will get you coding your own


programs in no time, in the simplest way, so
you can solve real-world problems and build
your own applications.
Why Python
Python has a simple syntax, which means
you'll be able to learn it quickly and put it to use
after just a few lessons.

PY

print(65000*1.15)
Tap to try

The example code shows the average


salary in US dollars of an entry-level Python
programmer, plus a 15% annual bonus.
Press the code block to open the Code
Playground, then press run to see the result
the screen.
on
Output
The print command is the easiest way to send
a specified message to the screen or other
display device.
This message or output can be a number, text,
or the result of a calculation.
Run the code below to see the output.

PY

print(60)

Tap to try |
Printing Text
Computers treat text and numbers differently.
When printing text outputs, you need to
enclose the text in either single or double
quotes:

PY

print("Coding is an art")

Tap to try

The text in quotes is called string.

The quotes enclosing the text need to


be the same, either both single or both
double. If you forget to add the quotes
or if the quotes are not the same, Python
will return an error.
Printing Text
There are situations where you might want to
print mutiple messages in your code.
Each print statement outputs text in a new
line.

PY

print("Shopping List : ")


print( "Bread")
print("Eggs")
Tap to try

Python gets its name from the BBC


comedy TV series Monty Python
because its creator thought he needed a
name that was short, unique, and slightly
mysterious.
Lesson Takeaways
Awesome! Now you know how to output text
and numbers with Python!

Remember the following important points:


the print statement needs to be followed by
parentheses, enclosing the output we want to
send to the screen.
a text message (also called string) needs to
be enclosed in quotes.
you don't need quotes to output numbers.
-

In the next lesson you will learn how to get a


computer to do math for you and will solve
your first Code Coach challenge.

You might also like