pythonで「A と、見せかけて B」と、出力してくるコードを作成する
目的
pythonで「A と、見せかけて B」と、出力してくるコードを作成した際の備忘録です
準備
pythonのchoiceを使います。
コード
import random
l = ["りんご",
"みかん",
"いちご",
"パイナップル",
"ドラゴンフルーツ"]
string1=random.choice(l)
string2=random.choice(l)
print(string1, " と、見せかけて ", string2)
$ python sample.py
りんご と、見せかけて ドラゴンフルーツ