Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

count pairs with given sum python

count = 0
given_sum = 7
x = 4
y = 3
pair = x + y
if pair == 7:
	count += 1
#count goes up if the sum of x and y is the given number
 
PREVIOUS NEXT
Tagged: #count #pairs #sum #python
ADD COMMENT
Topic
Name
9+7 =