# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     name: python3
# ---

# + [markdown] id="view-in-github" colab_type="text"
# <a href="https://colab.research.google.com/github/WUMENGMENG702/basic_algorithms_a/blob/master/Untitled1.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>

# + [markdown] id="BhAKzFmH3WgS" colab_type="text"
# 2.変数、文字列とリストを変数xに導入する
#
#

# + id="yJS1UZH-4Ga6" colab_type="code" outputId="1c874046-ba4a-4e09-8901-bc4702cd0ed1" colab={"base_uri": "https://localhost:8080/", "height": 68}
x=1  #xは整数
print(x)
x="hello" #は文字列
print(x)
x=[1,2,3] #xは1,2,3のリスト
print(x)

# + id="g9MFt1rI5RLF" colab_type="code" outputId="0bf51034-b616-4f49-d480-65936c344fd9" colab={"base_uri": "https://localhost:8080/", "height": 34}
y=x
print(y)

# + [markdown] id="UStUlwHk5Y9M" colab_type="text"
# append()を使って、xの変数に4を追加する

# + id="T7vV8h335wnC" colab_type="code" outputId="13a68fe2-4b59-40dc-98ee-aeb46f9e64e0" colab={"base_uri": "https://localhost:8080/", "height": 34}
x.append(4)
print(y)

# + [markdown] id="EUjovQ3H6_L3" colab_type="text"
# 5.xに他のものに導入し、yを出力してみる

# + id="rHNjjkPP7d7n" colab_type="code" outputId="11142907-af25-4e95-b1fe-edf3840d842d" colab={"base_uri": "https://localhost:8080/", "height": 34}
x="something else"
print(y)

# + [markdown] id="OsK52RWZ7xpn" colab_type="text"
# 4をxに導入し、type() を使って、xの種類を見せてください。

# + id="NitJMjl28h32" colab_type="code" outputId="6d9bb4bd-80f9-4bef-a4c0-f862d46a4559" colab={"base_uri": "https://localhost:8080/", "height": 34}
x=4
type(x)

# + id="GfFUh1kd8z-H" colab_type="code" outputId="7918649e-b7da-45b6-b9db-1bc11c8e06b1" colab={"base_uri": "https://localhost:8080/", "height": 34}
x="hello"
type(x)


# + id="5jTGcOEw9An_" colab_type="code" outputId="0d3e9ad8-82d2-462b-c1e4-5ad8de098ffc" colab={"base_uri": "https://localhost:8080/", "height": 34}
x=3.14159
type(x)

# + id="RU9xDO6E9HbK" colab_type="code" outputId="5a2f0ab7-7c06-4c45-ae63-ac3b11b4019c" colab={"base_uri": "https://localhost:8080/", "height": 34}
print((5+2)*(12/4))


# + id="r-RXl8Co9WKs" colab_type="code" outputId="1a2a5e27-50e2-432c-dc2d-54a831ec56df" colab={"base_uri": "https://localhost:8080/", "height": 51}
print(11/3)
print(11//3)

# + id="j4Qack9N9jS0" colab_type="code" outputId="81095890-834c-484c-dc43-47253bf9f0f0" colab={"base_uri": "https://localhost:8080/", "height": 34}
print(2**5)

# + [markdown] id="Rcojnex6-NGM" colab_type="text"
# 12の2進数を計算してください。

# + id="dCPwIk6W-U58" colab_type="code" outputId="0757e279-5bdb-4f21-d2a0-b40c7fea80ba" colab={"base_uri": "https://localhost:8080/", "height": 34}
x=bin(12)
print(x)

# + id="FGgu2bO8_arc" colab_type="code" outputId="3446f473-181c-4f98-8a3b-71b8a0e6f9c0" colab={"base_uri": "https://localhost:8080/", "height": 34}
x=bin(4)
print(x)

# + id="SzBd4oZL_ssD" colab_type="code" outputId="b6bc884b-cc4c-4aa0-be03-3fcbd22fe951" colab={"base_uri": "https://localhost:8080/", "height": 34}
a=bin(12)
b=bin(4)
x=a or b
print(x)

# + id="QFglgQHQE0gh" colab_type="code" outputId="e986fda0-fd0e-4503-9245-7b4b66196cd0" colab={"base_uri": "https://localhost:8080/", "height": 34}
a=5
b_bin=bin(a)
print(a)

# + id="jjzrK_W7E9XR" colab_type="code" outputId="54f0d574-a0d6-429a-a088-88a9294e6605" colab={"base_uri": "https://localhost:8080/", "height": 34}
b=67
b_bin=bin(b)
print(b)

# + id="nkOVcMyTFNwj" colab_type="code" outputId="9b0a6b14-3820-4f38-daf8-bb2c19d4e498" colab={"base_uri": "https://localhost:8080/", "height": 34}
print(a | b)

# + id="ZrSqzcOwFYXN" colab_type="code" outputId="e31d4e24-2340-4dab-d7a9-b05c654a9833" colab={"base_uri": "https://localhost:8080/", "height": 34}
print(a<<b)

# + id="oPbrKHvoFcnF" colab_type="code" outputId="42f830d3-93e3-4acb-cdd4-028c0dfaf868" colab={"base_uri": "https://localhost:8080/", "height": 34}
print(a>>b)

# + id="n_NubPirFlLP" colab_type="code" outputId="ff97f49a-4510-4d1d-a7a9-eb8979ada0c5" colab={"base_uri": "https://localhost:8080/", "height": 34}
print(a & b)

StarcoderdataJupyterScriptsDedupFiltered