Help with a reversed list function in Python

Hello There,

Here is my soultion but its not seems okay. How can I fix the bug?

Thank you,

def reversed_list(lst1, lst2):

for i in range(len(lst1)):

for j in range(len(lst2)):

  if lst1[i] != lst2[-j]:

    return False


    return True

Please check the following FAQ: How to ask good questions and get good answers for some guidance on code formatting as it’s very hard to read unformatted code (especially in something like Python where indentation is essential).

Do you have a link to the exercise?

I’m not 100% sure what your task is but consider the order this code will execute in. For any single value of i you check every value of j. You may need to reconsider how you index your two lists.

Be careful with the return statements too. As soon they’re run the entire function stops at that point. Would you have checked every element using an if-else style clause? As written either one or the other of those lines will be run. What about the rest of your loop iterations?