Python Forum
Indexing + ''.join Help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Indexing + ''.join Help
#1
I'm not a programmer; I'm taking my first course in Python and I have absolutely no experience, so please excuse this if it's mindbogglingly simple and I'm just a dummy.

I have to do an assignment and can't get past the second question:
def make_str_from_row(board, row_index):
    """ (list of list of str, int) -> str

    Return the characters from the row of the board with index row_index
    as a single string.

    >>> make_str_from_row([['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']], 0)
    'ANTT'
    """
I have figured out in my practice shell what it is that I need to do (i.e. isolate the indexed board, then use ''.join() to return the characters as a single string). However, I can't seem to get the code correct in my .py file. Could someone please explain to me what I have to do here? The assignment is due in 36 hours and I'm freaking out.
Reply


Messages In This Thread
Indexing + ''.join Help - by OwlEyesToo - Nov-05-2016, 04:34 PM
RE: Indexing + ''.join Help - by Yoriz - Nov-05-2016, 05:54 PM
RE: Indexing + ''.join Help - by nilamo - Nov-07-2016, 05:18 PM

Forum Jump:

User Panel Messages

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