Python Forum
Error:unsupported operand type(s) for ** or pow(): 'list' and 'int'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error:unsupported operand type(s) for ** or pow(): 'list' and 'int'
#1
this code is generating the error message written on the subject line.
I am not understanding why.

L=[1,2]
L3=[3*L]
L4=[k**2 for k in L3]
print(L4)
Reply


Messages In This Thread
Error:unsupported operand type(s) for ** or pow(): 'list' and 'int' - by mcgrim - Mar-22-2019, 12:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [pandas] TypeError: list indices must be integers or slices, not str but type is int. cspower 4 1,092 Dec-30-2023, 09:38 AM
Last Post: Gribouillis
  GroupBy - Sum = Error [datetime64 type does not support sum operations] BSDevo 4 3,518 Oct-27-2023, 07:22 PM
Last Post: BSDevo
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,799 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  Type error in Cross_val_score Vicral 0 1,898 Jul-20-2021, 12:18 PM
Last Post: Vicral
  type error array BrianPA 2 2,500 Jan-17-2021, 01:48 PM
Last Post: BrianPA
  Error binding parameter 0 - probably unsupported type. illmattic 7 10,631 Jul-18-2020, 09:32 PM
Last Post: illmattic
  Error Message: TypeError: unhashable type: 'set' twinpiques 4 19,397 May-22-2019, 02:31 PM
Last Post: twinpiques
  Type Error Confusion Oliver 4 14,689 Dec-06-2017, 03:20 PM
Last Post: Oliver
  type error and access violation error pyopengl hsunteik 0 3,396 Nov-04-2017, 04:51 AM
Last Post: hsunteik
  AUCPR of individual features using Random Forest (Error: unhashable Type) melissa 1 3,382 Jul-10-2017, 12:48 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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