Python Forum
[Guidance needed] Python def question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Guidance needed] Python def question
#5
It looks like concat_words is meant to take one parameter, a list, not three parameters as you have it set up.

Take a look at this example, and see if it helps you get there:

words = ['apple', 'orange', 'pear']
for index in range(len(words)):
    print(index, words[index])
Really this should be done with enumerate, but I have a feeling you haven't covered that yet:

words = ['apple', 'orange', 'pear']
for index, word in enumerate(words):
    print(index, word)
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
[Guidance needed] Python def question - by PieTurn - Aug-04-2019, 03:45 AM
RE: [Guidance needed] Python def question - by ichabod801 - Aug-04-2019, 08:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation Python Homework (Urgent help needed!!) chickenseizuresalad 6 4,497 Oct-11-2021, 01:59 AM
Last Post: Underscore
  Need guidance on String indexing Gateux 3 2,228 Jun-22-2019, 12:44 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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