Write a program which allows the user to enter a list of numbers.

Write a program which allows the user to enter a list of numbers.
Write a program which allows the user to enter a list of numbers,then works out whether there are any two numbers in the list which sum to 100.Hint:you could loop through the numbers in the list,and for each number,loop through the list again looking for a number that adds to it to make 100.However,there are other ways to do this too.
英语人气:698 ℃时间:2020-04-16 15:23:42
优质解答
def checkio(data, target):data.sort()i = 0j = len(data)-1while(i < j):if data[i] + data[j] > target:j -= 1elif d...
我来回答
类似推荐
请使用1024x768 IE6.0或更高版本浏览器浏览本站点,以保证最佳阅读效果。本页提供作业小助手,一起搜作业以及作业好帮手最新版!
版权所有 CopyRight © 2012-2024 作业小助手 All Rights Reserved. 手机版