Course Content
Introduction to Python
Introduction to Python
Some Simple Math
Great job! Python excels at crunching numbers. The syntax is simple: use +
for addition, -
for subtraction, *
for multiplication, and /
for division. Remember to use the print()
function if you want to display the result. Unlike strings, mathematical expressions don't require quotation marks ("..."
or '...'
).
For instance, let's tackle some basic math:
# Addition print(1039 + 948) # Subtraction print(10484 - 9274) # Division print(95873/472)
Swipe to show code editor
Here's your assignment: compute the following and print the outcomes:
2580
added to198
.23
times42
.1512
divided by27
.
Thanks for your feedback!
Some Simple Math
Great job! Python excels at crunching numbers. The syntax is simple: use +
for addition, -
for subtraction, *
for multiplication, and /
for division. Remember to use the print()
function if you want to display the result. Unlike strings, mathematical expressions don't require quotation marks ("..."
or '...'
).
For instance, let's tackle some basic math:
# Addition print(1039 + 948) # Subtraction print(10484 - 9274) # Division print(95873/472)
Swipe to show code editor
Here's your assignment: compute the following and print the outcomes:
2580
added to198
.23
times42
.1512
divided by27
.
Thanks for your feedback!