Python Forum
Noobie Python TypeError question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Noobie Python TypeError question
#3
(Aug-30-2021, 05:12 PM)zoid Wrote:
>>> x = list['6048922', '334318']
You must use parentheses to use the list() constructor. Not square brackets.
 x = list('6048922', '334318')
Or else you can just say:
 x = ['6048922', '334318']
By using just square brackets you make clear you mean a list.
zoid likes this post
Reply


Messages In This Thread
Noobie Python TypeError question - by zoid - Aug-30-2021, 05:12 PM
RE: Noobie Python TypeError question - by bowlofred - Aug-30-2021, 05:21 PM
RE: Noobie Python TypeError question - by ibreeden - Aug-30-2021, 05:27 PM
RE: Noobie Python TypeError question - by zoid - Sep-01-2021, 02:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Newbie Question re "TypeError: '<' not supported between instances of 'list' and 'int sr12 8 13,116 Apr-11-2019, 08:19 PM
Last Post: sr12
  Noobie Question, Libreries on Intellij donjon 2 3,077 Dec-16-2017, 01:59 PM
Last Post: Larz60+
  Noobie - IF and Else statement help Jedi 3 3,996 Mar-19-2017, 03:20 AM
Last Post: wavic

Forum Jump:

User Panel Messages

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