CISC 121 Lecture Notes - Lecture 2: Equals Sign, Style Guide

85 views3 pages
Verified Note

Document Summary

Variables in python 3 must be named as follows. Name starts with a letter or underscore. The rest of the name may contain letters, numerals 0 through 9, or underscores, but no spaces. There are also conventions in variable naming, i. e. thisstyleiscalledcamelcase (because of the humps) this_style_is_called_snake_case. The official python 3 style guide gives preference to snake case over camel case for variable naming. When we give a value to a variable in this way, the computer is performing an assignment. In python and c-like languages, the equals sign, =, is used as the assignment operator. This goes between a variable name (a variable identifier), on the left and some value on the right, and means, overwrite the memory location used for the variable on the left with the value on the right. Here are some variables of the types we have looked at being assigned to new values:

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents