- Python Essentials
- Steven F. Lott
- 203字
- 2021-07-16 13:53:12
Chapter 4. Variables, Assignment and Scoping Rules
An expression creates objects; we can assign objects to variables to preserve them for future use. Python offers a number of variations on the theme of assignment. In addition to simply assigning a single variable, we can assign items from a tuple to multiple variables. We can also combine an operator with assignment, which updates a mutable object.
In this chapter, we'll also look at the input()
function as a way to introduce new objects into a running script. This is limited—it doesn't compare with a proper graphical user interface (GUI). It will, however, help us learn more Python programming techniques before we introduce how to read data from files and the filesystem in Chapter 10, Files, Databases, Networks, and Contexts.
We'll also look at some important Python language concepts. We'll look at the way Python programs are always written generically, without specific bindings to data types or classes. We'll also look at the general concept of a namespace, and how this is applied widely in various Python language constructs. It defines the scope in which an identifier is visible; something that will become increasingly important as our programs become more complex.
- Visual C++程序設計教程
- MySQL數據庫管理實戰
- 程序員修煉之道:程序設計入門30講
- C#程序設計(慕課版)
- NumPy Essentials
- Full-Stack Vue.js 2 and Laravel 5
- Java應用開發技術實例教程
- 深入淺出PostgreSQL
- 深入理解Android:Wi-Fi、NFC和GPS卷
- Visual Basic程序設計實踐教程
- C/C++程序員面試指南
- Natural Language Processing with Java and LingPipe Cookbook
- Python Data Science Cookbook
- HTML5+CSS3+jQuery Mobile APP與移動網站設計從入門到精通
- 愛上C語言:C KISS