/python-intro

A set of Python exercises led by hints in comments - suitable for beginner / intermediate level

Primary LanguagePythonCreative Commons Zero v1.0 UniversalCC0-1.0

Python Intro

A Python learning tool with beginner exercises in using variables, data structures and basic control flow. Instructions and guidance are given in comments in the file.

Compatible with both Python2 and Python3.

Contents

  • Printing
  • Variables
  • Basic maths operators (add, subtract, multiply)
  • Basic variable types (strings, integers)
  • Concatenating strings
  • Casting an integer to a string
  • Booleans (True / False)
  • Inequalities (Greater Than / Less Than)
  • If/Else statements
  • Lists
  • List methods (append, extend)
  • Adding lists together with +
  • Sets
  • For Loops
  • Indexing strings
  • Splitting strings
  • Tuples
  • Dictionaries

How to use

Go to intro.py and download the file (right click & save) then open the file in IDLE or IDLE3. Run the file with F5 to see the output then go back to the code and read the instructions, edit away, save and run again.