Search

Blogs Blogs

Variables Blogs

Newest Most Active

Chapter 2 of How to Think Like a Computer Scientist begins actually exploring Python and its features.   The chapter discusses variables, expressions, and statements. It starts out discussing data types and using the type() function to determine the type of some literals, like strings, integers, and floats. It also discusses using different kind of string delimiters.   Variables have a name and can be created by using the name you want to give the variable, the assignment token (=), and a value, like so:   lunch = "sandwich" weight = 150   Variable names have to begin with a letter or underscore (_) and can't be one of Python's reserved keywords (http://openbookproject.net/thinkcs/python/english3e/variables_expressions_statements.html#variable-names-and-keywords).   Statements are instructions that python can perform. Examples given are while, for, import and others.   Expressions are combinations... read more

Variables Blogs RSS feed