100 was added to achieve a python

'' ' 
Python achieved by adding any number to any number, such as: 1 was added to 100
' ''

# is the first for loop
# DEF SUM (Start, End):
# = 0 SUM
# for One in Range (Start, . 1 + End):
# One SUM = SUM +
# One +. 1 =
# SUM return
#
# Result = SUM (. 1, 100)
# Print (Result)

# while loop is a second
DEF SUM2 (Start, End):
I Start =
SUM = 0
the while I <= End:
SUM = I +
I + =. 1
return SUM

Result = SUM2 (-0.01,100.0009)
Print (Result)

# third import function module built reduce, only integer ?
# Import from the reduce functools
# DEF SUM (the X-, the y-):
# return the y-the X-+
# result = reduce(sum, range(1,101))
# print(result)

Guess you like

Origin www.cnblogs.com/tracker001/p/11202705.html