GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Python/maths/find_max.py at master · jusing-es/Python Expand file tree/ Copy pathfind_max.pyMore file actions 25 lines (19 loc) · 413 Bytes / Copy pathfind_max.pyFile metadata and controls25 lines (19 loc) · 413 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 # NguyenU def find_max(nums): """ >>> for nums in ([3, 2, 1], [-3, -2, -1], [3, -3, 0], [3.0, 3.1, 2.9]): ... find_max(nums) == max(nums) True True True True """ max_num = nums[0] for x in nums: if x > max_num: max_num = x return max_num def main(): print(find_max([2, 4, 9, 7, 19, 94, 5])) # 94 if __name__ == "__main__": main() |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |