Solve Problems by Coding Solutions - A Complete solution for python programming
test_list = [(4, 5, 9), (-3, 2, 3), (-3, 5, 6), (4, 6)]
print("The original list is : " + str(test_list))
res = [sub for sub in test_list if all(ele >= 0 for ele in sub)]
print("Positive elements Tuples : " + str(res))
Post a Comment
No comments:
Post a Comment