#πŸ”’ index 1 out of range

8 messages Β· Page 1 of 1 (latest)

sinful hedge
#

heyy I created a tuple with a lot of vars and am trying to use format() with this 1 var containing multiples ones but it gives me an index error, is there a correct way to do it or should I manually put all the vars ?

here's the code:

speech = adjective1, noun1, past_verb1, adverb1, adjective2, noun2, noun3, adjective3, verb1, adverb2, past_verb2, adjective4

madlib_library = {

    1: """Today I went to the zoo. I saw a(n) {} {} jumping up and down in its tree.
    He {} {} through the large tunnel that led to its {} {}.
    I got some peanuts and passed them through the cage to a gigantic gray {}
    towering above my head. Feeding that animal made me hungry. I went to get a {}
    scoop of ice cream. It filled my stomach. Afterwards I had to {} {} to catch our bus.
    When I got home I {} my mom for a {} day at the zoo.""".format(speech),
lofty ridgeBOT
#

@sinful hedge

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

sinful hedge
#

ooooh

#

tysm

#

!close

lofty ridgeBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.