Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- listempt = []
- while True:
- x = input("Do you want to add more numbers? y/n: ")
- if x== 'y':
- number = input("the list is :")
- listempt.append(int(number))
- continue
- else:
- break
- tuplelist = []
- for i in range(len(listempt)):
- for j in range(i+1,len(listempt)):
- if (listempt[i] + listempt[j]) % 2 != 0 and (listempt[i] * listempt[j]) % 2 == 0:
- tuplelist.append((listempt[i], listempt[j]))
- print("The list of tuple pair whose sum is an odd number and product is an even number is :", tuplelist)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement