Читать книгу Introduction to Python Programming for Business and Social Science Applications - Frederick Kaefer - Страница 49

Stop, Code, and Understand! SCU 2.2 Mathematical Expressions

Оглавление

Download the file “SCU 2_2.py” from the companion website and save it either on your computer or on a removable storage device. Open the file in the Python IDLE editor and add parentheses around two values, a subtraction operator, and an exponentiation operator to the code below so that the code prints the value 25. Execute the modified program after the change to verify that the revised code runs and produces the correct result.

Description

Lessons learned: In this section, we learned about how to use variables in assignment statements, using print statements to visualize our results. We also learned how to use the Python type function to determine and report the data type of an object in a Python program and why the order of operations is important when we have Python code that performs calculations.

Introduction to Python Programming for Business and Social Science Applications

Подняться наверх