This is what I have tried:
class Solution(object): def twoSum(self, nums, target): if sum(nums) > target: for i in nums: