Introduction to Python

From Open Source Ecology
Jump to: navigation, search

This page highlights an approach to rapid on-boarding in Python programming. Sample files with a few concepts are presented. Participants type in the files and then examine the behaviour of the resulting programs, learning the effect of a few Python keywords each step.

<source lang="Python" line='line'>

  1. Quiz Program

answer = input("What is the capital city of Guyana?") if answer == "Georgetown":

   print("Good answer")

elif answer == "GT":

   print("Ok.  We will accept that")

else:

   print("What kind of an answer is that?")

</source>