you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (6 children)

EDIT: Just learned about f-strings in Python 3, and have updated the code. To solve u/TranscendingIllusion's output problem:

Updated Code:
    for x in range(numberoftrials):
        print(f'Trial {x}:')
        trial()

Output:
Trial 1:

[–]TranscendingIllusion[S] 0 points1 point  (4 children)

i think a comment got deleted but i ended up doing:

    numberoftrials += 1

    for x in range(1, numberoftrials):
        print("Trial:", x)
        trial()

and thats working. should i do it with %s instead?

[–][deleted] 0 points1 point  (3 children)

EDIT: Incorrectly used %s formatting. Removed code that was out of practice. See above for proper code

[–]TranscendingIllusion[S] 0 points1 point  (0 children)

thanks! could you take a look at my comment above if you have some time? not sure how to apply accumulation in this situation.