ソースを参照

More functions for 03.py

master
Dimitri Merejkowsky 5年前
コミット
beecdbbb34
2個のファイルの変更17行の追加8行の削除
  1. +0
    -8
      sources/03-add.py
  2. +17
    -0
      sources/03-fonctions.py

+ 0
- 8
sources/03-add.py ファイルの表示

@@ -1,8 +0,0 @@
# ceci est un commentaire
def add(a, b):
return a + b

a = 1
b = 2
c = add(a, b)
print(c)

+ 17
- 0
sources/03-fonctions.py ファイルの表示

@@ -0,0 +1,17 @@
def add(a, b):
return a + b

a = 1
b = 2
c = add(a, b)
print(c)

def greet(name, shout=False):
print("Hello,", end=" ")
print(name, end="")
if shout:
print("!", end="")
print("", end="\n")

greet("John")
greet("Jane", shout=True)