You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am not sure what is the goal here, do we need to make few if statements to correlate strings with positions ? ex. if position = "first" insert(0) ?
It does work, but that does not seem to be efficient, am I missing something here ?
The text was updated successfully, but these errors were encountered:
Apparently so, which is not indicated. I don't mind combining what we've learned, I'd just like to know that we're combining elements, thus far I've been under the impression that we're learning bit by bit and will be combining later.
def insert_human(a_list, position, elem):
if position is 'first':
position = 0
elif position is 'second':
position = 1
elif position is 'third':
position = 2
elif position is 'last':
position = 3
a_list.insert(position, elem)
return a_list
I don't know how to convert string words into integer value except by using the if command as I did above, but that's HEAVILY restricting it to just meet the requirements of the test.
Hello,
I am not sure what is the goal here, do we need to make few if statements to correlate strings with positions ? ex. if position = "first" insert(0) ?
It does work, but that does not seem to be efficient, am I missing something here ?
The text was updated successfully, but these errors were encountered: