LoginSignup
0
1

More than 1 year has passed since last update.

Pythonで学び直す高校数学

Last updated at Posted at 2021-11-13

Pythonで学び直す高校数学では、Jupyter Notebookをつかってましたが、Google Colabでやってみます。
https://colab.research.google.com

まずは準備。y=x^2+2x+1のグラフを描いてみます。

>>>from sympy import *
>>>(x,y)=symbols('x y')
>>>y = x**2 + x*2 + 1
>>>plot(y,(x,-10,10),ylabel='y',ylim=(-10,10))

べき乗。

>>>10 ** 3
1000
>>>10 ** 0
1
>>>10 ** -2
0.01

2/16進数。

>>>bin(10)
'0b1010'
>>>bin(-10)
'-0b1010'
>>>bin(-10 & 0xFF)
'0b11110110'
>>>hex(10)
'0xa'
>>>hex(-10 & 0xFF)
'0xf6'

実数/商/余。

>>>10 / 3
3.3333333333333335
>>>10 // 3
3
>>>10 % 3
1
0
1
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
1