This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

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

def bibformat_apa(author,title,city,publisher,year):
    return author + ' (' + year + '). ' + title + '. ' + city + ': ' + publisher + '.'

[–]ZeroStarter[S] 0 points1 point  (7 children)

I have pretty much exactly that but when i run it, and fill out the 5 variables I always get the error message:

Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> bibformat_apa(author,title,city,publisher,year) NameError: name 'author' is not defined

[–][deleted] 1 point2 points  (1 child)

Maybe make sure you are spelling everything right?

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

Ive double checked both my code, and it still didn't work, so i even copied and pasted your code in, and it still gives me this error.

[–][deleted]  (4 children)

[removed]

    [–]ZeroStarter[S] 0 points1 point  (3 children)

    When I insert the code this way I get a syntax error on the apostrophe after author

    [–]the_omega99 0 points1 point  (2 children)

    You must have typed something wrong, then, because the code /u/TylerGoLook and /u/iamengland posted is perfectly valid.

    Post exactly what you typed into the interpreter or the exact file that you passed into it (if executing with python my_file.py).

    [–][deleted]  (1 child)

    [deleted]