python 18//3?
时间: 2023-11-04 10:04:50 浏览: 22
The answer is 6. The double slashes "//" represent integer division in Python, which means the result will be the quotient of the division operation rounded down to the nearest integer. In this case, 18 divided by 3 is 6, and there is no remainder. Therefore, the result of 18//3 is 6.
相关问题
Traceback (most recent call last): File "3.py", line 131, in <module> name = config.get('Variables', 'name') File "/usr/local/python3/lib/python3.7/configparser.py", line 780, in get d = self._unify_values(section, vars) File "/usr/local/python3/lib/python3.7/configparser.py", line 1146, in _unify_values raise NoSectionError(section) from None configparser.NoSectionError: No section: 'Variables'
这个错误是由于配置文件中的节(section)名称不正确导致的。根据你的错误信息,配置文件中找不到名为`Variables`的节。
请确保你的配置文件(`test.ini`)的格式正确,并包含一个名为`Variables`的节。示例配置文件的正确格式如下:
```
[Variables]
name = 张三
age = 18
```
请检查你的配置文件,确保节的名称和配置项的格式正确。如果问题仍然存在,请提供你的配置文件内容以供进一步排查。
ubuntu18 升级 python3
Ubuntu 18.04 默认安装了 Python 3.6,如果需要升级到 Python 3.x 版本,可以按照以下步骤进行操作:
1. 确认更新源
```bash
sudo apt update
```
2. 安装 Python 3.x
Ubuntu 18.04 可以通过以下命令安装 Python 3.7:
```bash
sudo apt install python3.7
```
如果需要安装 Python 3.8,可以使用以下命令:
```bash
sudo apt install python3.8
```
3. 验证 Python 版本
安装完成后,可以通过以下命令验证 Python 版本:
```bash
python3 --version
```
输出类似以下信息即表示升级成功:
```
Python 3.x.x
```
注意:升级 Python 版本时,可能会导致已经安装的一些 Python 模块失效。如果出现这种情况,需要重新安装这些模块。
相关推荐
![py](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)