1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

理系学生のためのgooglecolab入門

Last updated at Posted at 2025-07-27

googleColab概要

googleColaboratory(以下colab)はJupyterNotebook形式のpythonの実行環境です。ダウンロード・インストールなしでpythonが動かせるので便利!後述するが、googleドライブ中に保存もできるのでよい!

colabの実行と保存

colabこちらのリンクをクリックするか、「googleColab」と検索し、一番上を開き「openColab」をクリック
すると以下の画面になるはず
名称未設定ファイル.drawio.png

ここに書いてあることは初学者のうちは使わないので、右上のごみ箱アイコン(赤丸部分)ですべて消してよい。全て消した後、青下線のところからコードのセルを追加してコードを書くことができる。そのセルに以下のコードを追加してみよう。

sumple_num = 10
if(sumple_num % 2 == 0):
    print("この数は偶数です。")
elif(sumple_num % 2 == 1):
    print("この数は奇数です。")

これをコピペして「すべてのセルを実行」を押すと「この数は偶数です。」と表示されるはず。sumple_num = 10をsumple_num = 11にすると「この数は奇数です。」が表示され、偶奇判定器を作成することができた。

セルを実行の横のドライブにコピーを押すとドライブに保存ができるので、後日編集・実行できるようになる。

1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?