Results 1 to 8 of 8

Thread: Short Python intro.

  1. #1
    Banned
    Join Date
    Jan 2016
    Location
    Alabama, USA
    Posts
    191

    Default Short Python intro.

    EMPTY THREAD. I messed up this tutorial.
    Last edited by ModSim; 02-02-2016 at 06:38 PM.

  2. #2
    Lesser Wizard VendLolx's Avatar
    Join Date
    Jan 2016
    Location
    Finland, Kotka
    Posts
    341

    Default

    Quote Originally Posted by ModSim View Post
    Hi guys! I am doing a small introduction to the language of Python! So, this will work on ipad, PC, or Mac. Head over and download Python from their website python.org. So, depending on what you are using it on ( I only use iPad ) you should have a code window. We are going to jump straight into some things.

    Function: string (Usage: string("Text")
    Function: input (Usage: input("Do you want money? ")

    So we will make a dialog system with 2 functions.

    String just generates text, input generates text that allows you to type stuff.

    So our first line of code, we will do a comment. To do it, simply put a # in front.

    Code:
    #First Python code!
    So, we have our comment, now we assign a variable. It's super simple, just do this.

    Code:
    #First Python code!
    input_1 = input("Hi, what is your name? ");
    So, input_1 is our variable. The code assigned to it is an input. So when you run the console application, it will ask your for your name. Then type it.

    Next bit of code, we add strings, another variable with input assigned, and if statements!

    Code:
    #First Python code!
    input_1 = input("Hi, what is your name? ");
    print("Hello "+input_1+"!");
    #Use whatever question you want here.
    input_2 = input("Choose 1 for my name, 2 for my mums name, and 3 for my dads name.");
    So, we added our print string, and a second variable set with an input, so now we do our if statements t declare what happens when the number is chosen.

    Code:
    #First Python code!
    input_1 = input("Hi, what is your name? ");
    
    print("Hello "+input_1+"!");
    
    #Use whatever question you want here.
    input_2 = input("Choose 1 for my name, 2 for my mums name, and 3 for my dads name.");
    
    if(input_2 == 1) :
       print("My name is Py!");
    
    input_2 = input("Choose 1 for my name, 2 for my mums name, and 3 for my dads name.");
    
    if(input_2 == 2):
       print("My mums name is Th!");
    
    input_2 = input("Choose 1 for my name, 2 for my mums name, and 3 for my dads name.");
    
    if(input_2 == 3):
       print("My dads name is On!");
    
    print("Bye!");
    
    exit();
    Try running it, and play around with the code some. I will start an RTsoft series on making a 2d Python platformer! Stay tuned for more!
    I will Try THIS "Python"
    VendTheNub's box.

    #3.: No need to post same thing again.


  3. #3
    Lesser Wizard VendLolx's Avatar
    Join Date
    Jan 2016
    Location
    Finland, Kotka
    Posts
    341

    Default

    Quote Originally Posted by VendLolx View Post
    I will Try THIS "Python"
    THIS "Python" is Very hard.
    VendTheNub's box.

    #3.: No need to post same thing again.


  4. #4
    Banned
    Join Date
    Jan 2016
    Location
    Alabama, USA
    Posts
    191

    Default

    Quote Originally Posted by VendLolx View Post
    THIS "Python" is Very hard.
    This "Python" is the simplest language other than GML. There is alot more to the language than this, but this shows the console functions.

  5. #5
    Banned
    Join Date
    Jan 2016
    Location
    Alabama, USA
    Posts
    191

    Default

    Quote Originally Posted by TEROBERO View Post
    I learn python and i guess its the easiest
    I just started learning Python, this tutorial was stupid. I completely left out the fact that on PC, you can install libraries like pygame, py2exe, cx_Freeze, Panda3D, ect.

  6. #6
    Master Sorcerer MyLegGuy's Avatar
    Join Date
    Mar 2014
    Location
    United States
    Posts
    1,631

    Default

    Quote Originally Posted by ModSim View Post
    I just started learning Python, this tutorial was stupid. I completely left out the fact that on PC, you can install libraries like pygame, py2exe, cx_Freeze, Panda3D, ect.
    If you just started, why are you already making a tutorial?

  7. #7
    Banned
    Join Date
    Jan 2016
    Location
    Alabama, USA
    Posts
    191

    Default

    Quote Originally Posted by MyLegGuy View Post
    If you just started, why are you already making a tutorial?
    Dude, back off m8. If you don't like my post, then don't look at them. You have an argument about every post I make.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •