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'
#3
to get your list:
for numeric:
a = list(num for num in range (0, 11))
print(a)
Output:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a = list(str(num) for num in range (0, 11))
print(a)
Output:
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
Reply


Messages In This Thread
RE: unsupported operand type(s) for %: 'list' and 'int' - by Larz60+ - Feb-22-2022, 02:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Type Error: Unsupported Operand jhancock 2 1,313 Jul-22-2023, 11:33 PM
Last Post: jhancock
  search a list or tuple for a specific type ot class Skaperen 8 2,010 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  TypeError: unsupported operand type(s) for +: 'dict' and 'int' nick12341234 1 9,431 Jul-15-2022, 04:04 AM
Last Post: ndc85430
  TypeError: unsupported opperand type(s) for %: 'int' and 'list' cool_person 7 2,275 May-07-2022, 08:40 AM
Last Post: ibreeden
  You have any idea, how fix TypeError: unhashable type: 'list' lsepolis123 2 3,096 Jun-02-2021, 07:55 AM
Last Post: supuflounder
  unsupported operand type(s) for /: 'str' and 'int' Error for boxplot soft 1 3,109 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,478 Jan-30-2021, 07:11 AM
Last Post: alloydog
Question dict value, how to change type from int to list? swissjoker 3 2,803 Dec-09-2020, 09:50 AM
Last Post: perfringo
  unsupported operandtype(s) for -: 'list' and 'int' Lakkad 2 3,635 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