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

Python入門

Posted at

Pythonを使う準備方法

https://www.python.org/downloads/
最新版をダウンロードする
IDLEを開く

コードを新規ファイルに書いた場合の実行方法

RUN
RUN Module

変数とか型の基本の話

print(1)
1

print("こんにちは")
こんにちは

print('こんにちは')
こんにちは

s ="今日は晴れですね"
print(s[3,7])
晴れです
//0から数えるので3文字目は「晴」。
//0から数えて7文字目ではなく、6文字目のこと。
//抜き出したい文字列の終了位置に「+1」するので「す」までになる

s ="今日は晴れですね"
print(s[:5])
今日は晴れ
//これは0から数えて4文字目までということ

s ="今日は晴れですね"
print(s[3:])
晴れですね
//0から数えて3番目から末尾まで出力される

s ="今日は晴れですね"
print(s.replace("晴れ","雪")
今日は雪ですね
//新潟豪雪らしいです

list = [1,2,3,4]
list.append(5)
print(list)
1,2,3,4,5
//appendって追加って意味 なので末尾に追加する機能がある

list = [1,2,3,4]
list.append(3,5)
print(list)
1,2,3,5,4
//insertって入れるって意味 なので指定の位置に入れる機能がある
//3番目に5を入れるって書いてあるけど、0,1,2,3番目の3番目の前に5を入れるってことらしい?

参考資料

動画×会話でゼロからはじめるPython入門

第4章 pip install moviepyでインストールエラー

pip install --upgrade numpy
Successfully installed numpy-1.21.6

pip install numpy==1.25.0
ERROR: Could not find a version that satisfies the requirement numpy==1.25.0
ERROR: No matching distribution found for numpy==1.25.0

python -m pip list
Package Version
pip 25.0.1

解決しませんでした。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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?