Continually prompting user for input in Python

前端 未结 7 2117
余生分开走
余生分开走 2021-01-16 16:22

Objective: * Write a python program that repeatedly prompts for input of a positive number until the sum of the numbers is greater than 179. Use at least three modules/fun

7条回答
  •  忘掉有多难
    2021-01-16 17:18

    here some well-known tricks:

        def min_and_max(your_num_list)
            min=your_num_list[0]
            max=your_num_list[0]
            for num in your_num_list:
                if num < min:
                    min=num
                if max > num
                    max=num
            return min,max
    

提交回复
热议问题