Python Forum
got SyntaxError while building simple function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
got SyntaxError while building simple function
#1
Hi guys,

How can i set up simple function to unpack a list?

i was trying to:
def list_to_string(x):
    x = *x
    return x
but then i can see
SyntaxError: can't use starred expression here
Reply


Messages In This Thread
got SyntaxError while building simple function - by zarize - Feb-14-2020, 10:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Sad SyntaxError: from simple python example file from mind-monitor code (muse 2) warmcupoftea 4 2,749 Jul-16-2021, 02:51 PM
Last Post: warmcupoftea
  Building a method name in a function ffgth 9 3,130 Oct-19-2020, 01:21 PM
Last Post: buran
  Learning python SyntaxError: 'return' outside function Grale1953 3 2,466 Aug-03-2020, 06:55 AM
Last Post: buran
  Function: SyntaxError: invalid syntax vejin 2 2,303 Feb-02-2020, 09:25 PM
Last Post: ThiefOfTime
  Simple statistics with range function Pythonlearner2019 2 2,081 Nov-25-2019, 05:25 PM
Last Post: Pythonlearner2019
  Cannot get simple i/o to function. jerryi 10 6,613 Jul-27-2019, 06:22 PM
Last Post: jerryi
  Need help with a simple function WorldPark 4 2,617 Apr-26-2019, 12:28 PM
Last Post: perfringo
  Why this simple function doesnt work? blackknite 8 3,897 Jan-05-2019, 12:32 PM
Last Post: buran
  def function SyntaxError: invalid syntax Said 1 5,877 Jul-10-2018, 10:16 AM
Last Post: Said
  Simple Function Problem, please help ShadowWarrior17 16 6,921 Jan-03-2018, 09:29 PM
Last Post: ShadowWarrior17

Forum Jump:

User Panel Messages

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