The Student Room Group

Python Programming

I'm doing my computer science GCSE NEA and the presentation and organisation obviously has to be very neat and look nice. I don't know if I should use variables in my functions and if I do, do I put the variables right at the top and put all of my variables from all of the functions there, together, before all of my functions?

e.g.

TV = print("TV = Transit Van")
RR = print("RR = Reliant Robin")

def choiceA():
ㅤprint("example")

def choiceB()
ㅤprint("examplee")
(edited 3 years ago)
Reply 1
Original post by jaxp
I'm doing my computer science GCSE NEA and the presentation and organisation obviously has to be very neat and look nice. I don't know if I should use variables in my functions and if I do, do I put the variables right at the top and put all of my variables from all of the functions there, together, before all of my functions?

e.g.

TV = print("TV = Transit Van")
RR = print("RR = Reliant Robin")

def choiceA():
ㅤprint("example")

def choiceB()
ㅤprint("examplee")

I just did it to how the program normally works. Like functions on top then at the end of all of the functions is the main program
(edited 3 years ago)

Quick Reply

Latest

Trending

Trending