- Practical Data Wrangling
- Allan Visochek
- 348字
- 2021-07-02 15:16:08
Data types, variables, and the Python shell
In the next few sections, I will use a tool called the Python shell, which will help you get more comfortable using Python. The Python shell is a tool that allows the user to enter in Python commands, which get run instantaneously. This makes the Python shell a great place to quickly and easily experiment with small bits of code or new functionality in Python.
You can run the Python shell from a Terminal. To do this, open a Terminal and, from any directory, enter one of the following depending on your configuration:
$ Python
$ python3
You should see a new command prompt within the Terminal that looks something like this:

In Python, a single instruction is called a simple statement. For now, each individual line of code represents a simple statement. The Python shell will accept one line of code at a time. The following is an example of a simple statement that adds two numbers:
>> 1+1
Notice the >> at the beginning of our command. The >> symbol indicates that the line of code should be entered into the Python shell. The >> symbol should not be copied over with the rest of the code. You can run this statement by typing it into the shell and pressing Enter.
The Python shell will print out the result of every statement that you write. When you write the previous statement in your Python shell and press Enter, you should see the result of 2 printed just preceding it. The number 2 is an example of a value in Python. Values are like the nouns of programming languages. The + symbol is an example of an operator. Operators are like the verbs of programming languages, and they express what you would like to do with a value.
- Hands-On Machine Learning on Google Cloud Platform
- 微型計算機控制技術
- Pig Design Patterns
- Visual C++編程全能詞典
- Embedded Programming with Modern C++ Cookbook
- 信息物理系統(tǒng)(CPS)測試與評價技術
- Containers in OpenStack
- Learn QGIS
- Spark大數(shù)據(jù)商業(yè)實戰(zhàn)三部曲:內核解密|商業(yè)案例|性能調優(yōu)
- Java組件設計
- Microsoft System Center Data Protection Manager Cookbook
- 網絡信息安全項目教程
- Practical Network Automation
- Arduino創(chuàng)意機器人入門:基于Mind+
- 從實踐中學嵌入式Linux操作系統(tǒng)