Sunday, August 31, 2014

Python: 7 lessons in 7 minutes

  • Python: the 7 ingredients
Variables:
  • matt = "grumpy" 

Conditionals: 
  • if matt=='grumpy': 
  •     print("you are "+matt)
  • else:
  •     print("you're not grumpy")

Lists:
  • dev_club=["luke","matt","albert","chad","james"] 
  • dev_club.append("new person")

Loops:
  • for person in dev_club:
  •     print(person)

Functions:
  • def new_person(name):
  •     dev_club.append(name)

Documentation:

Execution:

No comments:

Post a Comment