If04. Three integers are given. Find the number of positive numbers in the source set.

Solution in Python 3:

import random

A = random.randrange(-3,3)
B = random.randrange(-3,3)
C = random.randrange(-3,3)
print("Three numbers:", A, B, C)

x = 0
if A > 0:
x += 1
if B > 0:
x += 1
if C > 0:
x += 1

print("Number of positive numbers: ", x)