Python 3

Python 3 is a text-based programming language used by Google, Pinterest, Microsoft and many others! It’s relatively easy and fun to learn.
I am currently working on a maths game and a ‘choose-your-way’ themed Terraria story.
I think the most used commands in Python include ‘print’, ‘if else’ and ‘input’. ‘Print’ is probably very heavily used because it is needed to display text on the screen. How boring and/or confusing would a game be if it had no text in it at all??
Conditions (if and else commands) are pretty simple and pretty useful at the same time.
In a very basic number guessing game, it would probably look something like this (by the way, text after hashtags means notes):

if input(“Guess a number. “) ==  “28”:
    print(“You got it right!”) #Displays text on the screen
else: #tests if the number is not 28 (in this example)
    print(“You got it wrong.”) #Displays text on the screen

The first line asks a question and waits for the user to type something and press enter. After the user has typed in something, it tests if they typed in 28.

I should stop babling about this different language because your eyes must have glazed over by now.

That’s all from me for now, see you later!

Advertisements

3 thoughts on “Python 3

  1. Next you should look into making your own functions. For example
    def MyNewFunction():
    if input(“Guess a number. “) == “28”:
    print(“You got it right!”) #Displays text on the screen
    else: #tests if the number is not 28 (in this example)
    print(“You got it wrong.”) #Displays text on the screen

    MyNewFunction()

    I have to call the function now and then if you want to play again you can just call function again.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s