Python Interviews: Difference between revisions

Line 195:
Positive lookbehind (?<=regex) (?<=s)t matches the first t in streets.
Negative lookbehind (?<!regex) (?<!s)t matches the second t in streets.
 
= Sum Function =
 
lst = []
num = int(input('How many numbers: '))
for n in range(num):
numbers = int(input('Enter number '))
lst.append(numbers)
print("Sum of elements in given list is :", sum(lst))