Programming Fundamentals
วันอังคารที่ 15 กันยายน พ.ศ. 2558
Lab 4x - (Python) Summary of Integers
def setup():
print (cal_sum(10))
print (cal_sum(15))
def cal_sum (i):
a = 0
x = 1
while (x<=i):
a = a+x
x = x+1
print("Sum 1 to",i,"=",a)
setup()
ไม่มีความคิดเห็น:
แสดงความคิดเห็น
บทความใหม่กว่า
บทความที่เก่ากว่า
หน้าแรก
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น