Skip to content

Instantly share code, notes, and snippets.

@prodeveloper
Last active January 31, 2017 06:11
Show Gist options
  • Select an option

  • Save prodeveloper/7084e0fc191d39ba173cd48ea0bd76c7 to your computer and use it in GitHub Desktop.

Select an option

Save prodeveloper/7084e0fc191d39ba173cd48ea0bd76c7 to your computer and use it in GitHub Desktop.
Introduction to Python

##Step 1

Open up your workspace on c9.io and activate the bash.

Type in

python3

Into the the terminal interface.  photo Screen Shot 2017-01-26 at 13.48.30_zpszy70sdi0.png

This invokes the REPL. The REPL is an interactive mode that allows you to be able to receive the results of operations immediately.

Inside the terminal type in:

print ("Python is so much fun")

You notice that you get the output immediately

Can you get python to print out:

  1. Your name?
  2. Name of the organization?
  3. Your county?

##Step 2

While it is useful to print out items to the screen, we can do much better. Python allows us to specify a variable. A variable is simply a place holder for your information.

Let's try it out. Type in

name = "Jacob Chencha"
print (name)

Not very useful, but let us say you had two people now.

name1 = "Jacob Chencha"
name2 = "Ade Lovelace"
print (name1)
print (name2)

The variables now persist with the information given.

Instead of printing out the names, now use python to first save and then print out.

  1. Your name?
  2. Name of the organization?
  3. Your county?

##Step 3

With the information you have about naming and creating variables, we can now jump into the material.

Work through the exercises presented here http://introtopython.org/var_string_num.html

##References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment