Should I learn Python?

Should I learn Python?


If you haven't programmed before, i would use Python 100% until you can at least make a simple game like snake or something.

Python is much simpler than Java to understand at first. Java has things you wont understand why you need to add to your code.
Python makes you understand programming so effortlessly.

I can write a program right here for example.

-----------------------------------------------------------------------------------------------
you = input('What is your age?')
friend = input('What is your friends age?')

if you > friend: print('You are older than your friend')
elif you < friend: print('You are younger than your friend')
else: print('You are the same age as your friend')
-----------------------------------------------------------------------------------------------

That is just an example to hopefully show how you simple the program is to use.
Also i haven't used the input function in ages, i've probably only ever used it like twice.
After i learned the basic syntax, i moved straight on to using Pygame which is for drawing on a window which you can make games with.

If you are ready to start learning how to program, here are the steps you should take:
1. Download Python 3.4.2 from https://www.python.org/
Click this link for a direct download. https://www.python.org/ftp/python/3.4.2/python-3.4.2.msi
2. Watch a video to get you started with how Python works.
3. Look at some short example programs to get you started.

When you know the basics, here is a site you can download everything Python has to offer.
http://www.lfd.uci.edu/~gohlke/pythonlibs/
You don't want to forget this link. You'll find anything you'll ever need which looking on Google you may not find.

The package you should download is Pygame.
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
Download the latest version. (pygame‑1.9.2a0.win32‑py3.4.exe)

The official site is http://www.pygame.org/download.shtml but it may still not have the latest version of Pygame to work with the latest version of Python (3.4.2) that's why i gave you the other link.

On the official Pygame website you can download other peoples programs which could be a game or app. You can also learn how to use Pygame from there and there are examples of how to use the code you learn too!

Here is a short blank program i just wrote to start you off making a game:

-----------------------------------------------------------------------------------------------
import pygame, sys

pygame.init()
pygame.display.set_caption("Game Title")
screen = pygame.display.set_mode((300,300))
white = (255,255,255)

while True:
    screen.fill(white)
    pygame.display.flip()
    pygame.time.Clock().tick(60)
    if pygame.event.get(pygame.QUIT): pygame.quit(); sys.exit()
-----------------------------------------------------------------------------------------------

All it is, is a window which is 300 pixles by 300 pixels and is filled with the color white.

The code below the "while True" is what runs the game (program).
All it's doing is:
1. filling the screen white
2. updating the screen (drawing doesn't make it appear until we flip, this is so the program doesn't flicker)
3. limits the program to run 60 times per second (60fps)
4. checks if the user clicks the red exit button on the window, then quits the game.

This is the main stuff, but then you can add code to draw shapes and after learning from other peoples code, you'll figure out how to make a game. The first game i made was pong.

All you need to do is draw paddles on each side of the screen and a block which bounces around.
And you will need to know how to get input from your keyboard to move the paddles.
Look on YouTube for a tutorial, or look for somebody elses code on the internet to learn how it works.

Once you just start, you'll enjoy doing this.
Reading all this may of been boring, but making games isn't, i'm sure that's why you're probably looking how to program.

If you want to learn how to program please click on our sponsor for code school. For just 1 dollar a day you can be programmer. Learn Code

Comments

Popular posts from this blog

Chef's Choice Diamond Hone Knife Sharpener 436-3 instructions manual

Natural Remedies For Acne Treatment