0
0

More than 3 years have passed since last update.

Python3学習1

Last updated at Posted at 2020-06-12

前回は開発環境を仮想環境で整え、Python3が動作するのを確認するところまで行いました。
今回は、Python3で入力など行っていきたいと思います。

初めに

コンソール画面でPython3と入力するとPythonのコーディングが可能になりますので
ここでコーディングを行っていきたいと思います。

python3
>>>

出力

printで囲われた内容が出力されます

>>> print("任意")
任意

四則演算

>>> print(3 + 4)
7
>>> print(5 - 1)
4
  • /
>>> print(10 / 2)
5.0
  • *
>>> print(4 * 4)
8
  • 文字+数値
>>> print(9 + ”4”)
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'
  • 文字+文字
>>> print("7 + 4”)
7 + 4
>>> print("7" + "4”)
7 4
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0