瀏覽代碼

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)