0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

関数

Posted at
1
def say_hi():
    s = 'Hi'
    return s

result = say_hi()
print(result)
1に実行結果
Hi
2
def what_is_this(color):
    if color == '':
        return 'トマト'
    elif color == '':
        return 'きゅうり'
    else:
        return 'わかりません。'

r = what_is_this('')
g = what_is_this('')
w = what_is_this('')

print(r)
print(g)
print(w)
2の実行結果
トマト
きゅうり
わかりません。
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?