Ask coding questions

← Back to all posts
its me again (i need to get good at python)
Imthebestthe

how would I be able to define the different game modes and then when it would run the specific game mode. i realise i could just create two different files with the game modes and import them i just want to do it all in one file. thx

Voters
firefish
Coder100
Imthebestthe
Comments
hotnewtop
[deleted]

Well, you can just use functions. Then call the certain functions depending on the game mode selected.

Imthebestthe

@JacksonCowie im kind bad at python so could you please help me with a demo. thx very much!

[deleted]

@Imthebestthe You should already know how to do a function. Oh wait, you didn't write this.

So a function in python works like this

That will output Hello World

I recommend you start learning python from easier projects first. Don't jump straight into Classes if you don't understand functions/procedures.

Imthebestthe

@JacksonCowie thank you
will do!
by the way i did write this. i just havent done python in like 10 months

[deleted]

@Imthebestthe Anytime 🙂