4.2 การเรียกใช้ฟังก์ชัน

#python 4-2 #coding here #call function show_info() #coding here def show_info(): print("My name is Nattapon Buaurai") print("My classroom is 413") print("My number is 1") #call function show_info()
use: edit function

#python 4-2 def Summation(): x = int(input("Input x : ")) y = int(input("Input y : ")) z = x + y print("Summation is ",z) def triangleArea(): w = int(input("Input weight : ")) h = int(input("Input height : ")) area = 0.5 * w * h print("Area is ",area) #coding here def Summation(): x = int(input("Input x : ")) y = int(input("Input y : ")) z = x + y print("Summation is ",z) def triangleArea(): w = int(input("Input weight : ")) h = int(input("Input height : ")) area = 0.5 * w * h print("Area is ",area) #coding here triangleArea() Summation()
use: call function