I'm trying to make def get_neg(): so that get_neg(lst) returns "-1, -2, -3" when lst = [-1, -2, -3, 4, 5, 6]. I tried this code below, but I don't know how to get the result in 1 line.
def get_neg():
for n in lst:
if n < 0:
print(str(n) + ',')
else:
pass
This way I get each numbers in a different row and a comma at the end. It has to be programmed with basic commands