Pythonの基本チートシート!
4890 ワード
こんにちは皆さん、私はあなたにPythonのチートシートを提供します> :)
1>パイソンとは?
Python は、1991 年 2 月 20 日に Guido Van Rossum によって作成された OOP (オブジェクト指向プログラミング) 言語です.
2> グイド・ヴァンの情報
Guido は Google で働いていましたが、DropBox の作成にも貢献しました.
3>基本機能
3.1> ハローワールド!
3.2>変数!
また、変数を追加することもできます!
3.3>インプット!
3.4>もし
3.5 (PROJECT) チャットボットを作ろう!
4>ループ
2 種類のループがあります.1 つは
1つはwhileです(私のお気に入り)
4.1> for() は、たとえば順番に数字を設定するために使用されます
4.2> while ループは、たとえば危険なループを作成するために使用されます
わかりましたので、チートシート全体を作成できませんでしたが、コメントで何が見逃したのか教えてください.今のところ、この投稿を好きでユニコーンにしてください:)
1>パイソンとは?
Python は、1991 年 2 月 20 日に Guido Van Rossum によって作成された OOP (オブジェクト指向プログラミング) 言語です.
2> グイド・ヴァンの情報
Guido は Google で働いていましたが、DropBox の作成にも貢献しました.
3>基本機能
3.1> ハローワールド!
#this is a comment
#all you have to do for printing hello world is this:
print("Hello World!")
3.2>変数!
x = "this is a variable!"
#to print the variable do this:
print(x)
また、変数を追加することもできます!
a = 2
b = 3
#if you want you can do print(a+b)
#but to make it more comfortable you can do this:
print("2 + 3 is " a+b"!")
3.3>インプット!
input("hi! ")
print("bye")
3.4>もし
x = "hi!"
if x == "bye!": #the == is important!
print()
3.5 (PROJECT) チャットボットを作ろう!
name = input("hello! what is your name? ")
print("nice to meet you "name)
color = input("so, what is your favor of color? ")
if color == "green":
print("mine's too!")
print("") #for some space
print(ok bye")
print("chatbot went offline")
4>ループ
2 種類のループがあります.1 つは
for()
1つはwhileです(私のお気に入り)
while()
4.1> for() は、たとえば順番に数字を設定するために使用されます
words= ["Apple", "Banana", "Car", "Dolphin" ]
for word in words:
print (word)
4.2> while ループは、たとえば危険なループを作成するために使用されます
#be careful this is a very dangerous program
n = 0
while n <=5:
print("the value of n is = " , n)
n ** 1
わかりましたので、チートシート全体を作成できませんでしたが、コメントで何が見逃したのか教えてください.今のところ、この投稿を好きでユニコーンにしてください:)
Reference
この問題について(Pythonの基本チートシート!), 我々は、より多くの情報をここで見つけました https://dev.to/coderrudra/python-basic-cheat-sheets-4khiテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol