Python Forum
unsupported operand type(s) for %: 'list' and 'int'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
unsupported operand type(s) for %: 'list' and 'int'
#4
nonprimenumbers=[]
primenumbers = []
for i in range (2,100000):
  if (i%primenumbers==0):
    nonprimenumbers.append 
else: 
  primenumbers.append 
  print(primenumbers)
Output:
Traceback (most recent call last): File "main.py", line 8, in <module> if (i % primenumbers == 0): TypeError: unsupported operand type(s) for %: 'int' and 'list'
answer ASAP
Reply


Messages In This Thread
RE: unsupported operand type(s) for %: 'list' and 'int' - by cool_person - May-07-2022, 07:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Type Error: Unsupported Operand jhancock 2 1,295 Jul-22-2023, 11:33 PM
Last Post: jhancock
  search a list or tuple for a specific type ot class Skaperen 8 2,005 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  TypeError: unsupported operand type(s) for +: 'dict' and 'int' nick12341234 1 9,410 Jul-15-2022, 04:04 AM
Last Post: ndc85430
  TypeError: unsupported opperand type(s) for %: 'int' and 'list' cool_person 7 2,264 May-07-2022, 08:40 AM
Last Post: ibreeden
  You have any idea, how fix TypeError: unhashable type: 'list' lsepolis123 2 3,086 Jun-02-2021, 07:55 AM
Last Post: supuflounder
  unsupported operand type(s) for /: 'str' and 'int' Error for boxplot soft 1 3,107 Feb-09-2021, 05:40 PM
Last Post: soft
  What type of *data* is the name of a list/tuple/dict, etc? alloydog 9 4,454 Jan-30-2021, 07:11 AM
Last Post: alloydog
Question dict value, how to change type from int to list? swissjoker 3 2,789 Dec-09-2020, 09:50 AM
Last Post: perfringo
  unsupported operandtype(s) for -: 'list' and 'int' Lakkad 2 3,629 Apr-27-2020, 10:16 AM
Last Post: pyzyx3qwerty
  calculate_bai -- TypeError: unsupported operand type(s) for *: 'float' and 'NoneType' pantherd 1 3,286 Apr-21-2020, 12:31 PM
Last Post: anbu23

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020