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

Variable Assignment

Оглавление

Assignment statements specify what value something is to take. You read assignment statements in Python code from right to left, storing the value on the right-hand side of the equal sign in the variable on the left-hand side of the equal sign, following the syntax:

variable_name = value

For example, taxi_number = 333 for an integer variable or my_name = “John Doe” for a string variable. If you want one variable to contain the same values as another variable, you can do so like in the following code statement: other_survey_values = survey_values.

Introduction to Python Programming for Business and Social Science Applications

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