Make a list contain any 4 names and also using for loop to print this list and please print the last string in the list
# variant 1
some_name = ['Nick', 'Andrew', 'Daniel', 'Mark']
del some_name[-1]
for i in some_name:
print(i)
# variant 2
some_name = ['Nick', 'Andrew', 'Daniel', 'Mark']
a = some_name[-1]
some_name2 = []
for i in some_name:
if i != a:
some_name2.append(i)
for a in some_name2:
print (a)
Comments
Leave a comment