Python Forum
TypeError: can only concatenate list (not "str") to list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TypeError: can only concatenate list (not "str") to list
#1
Output:
lt1/forums /home/forums 1> py3 Python 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> a=[1,2,3]+'foobar' Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate list (not "str") to list >>> a=[1,2,3] >>> a+='foobar' >>>
so, do you know what a now references? did you need to cheat?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
TypeError: can only concatenate list (not "str") to list - by Skaperen - Jan-13-2018, 06:50 AM

Forum Jump:

User Panel Messages

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