Computer Fundamental
วันจันทร์ที่ 14 กันยายน พ.ศ. 2558
Lab 4x : Calculate sum of integers from 1 to N
def setup():
print("Sum = ",number(50))
def number(n):
x = 1
sum = 0
while(x <= n):
sum = sum+x
x +=1
return sum
setup()
ไม่มีความคิดเห็น:
แสดงความคิดเห็น
บทความใหม่กว่า
บทความที่เก่ากว่า
หน้าแรก
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น