0

I keep getting an error and I am not sure how to fix it. the code basically asks the user to input 2 list of numbers then checks if their palindromes etc... Here is the error I keep getting:

list1.append(int(num))
ValueError: invalid literal for int() with base 10: 'y'

Here is the block that is the issue:

while num != 'y' or 'Y':
    num = input('Give numerical values for list 1 \n If finished press Y/y: ')
    if num != 'y' or 'Y':
        list1.append(int(num))
    print(list1)
Karl Knechtel
  • 56,349
  • 8
  • 83
  • 124
  • Welcome to Stack Overflow. Please re-read the [formatting help](https://stackoverflow.com/help/formatting); to post multi-line blocks of code, there should be **three** backticks on each side, *on a separate line each time*. Please also [try to search for existing questions first](https://meta.stackoverflow.com/questions/261592) and [study basic techniques for diagnosing the problem](https://ericlippert.com/2014/03/05/how-to-debug-small-programs/). – Karl Knechtel Mar 09 '22 at 02:44

0 Answers0