Skip to content

raspberrypilearning/python-intro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an archived resource. The repo will remain available but the resource will no longer be maintained or updated. Some or all parts of the resource may no longer work. To see our latest resources, please visit raspberrypi.org.

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.

Python

Compatible with both Python 3 and Python 2.

Also designed to be PEP-8 compliant to encourage good coding style.

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

Run the command wget http://goo.gl/0ZDOdX -O intro.py --no-check-certificate and open with idle3 intro.py &.

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.

Python 2 or Python 3?

The code works in both versions of Python, but Python 3 is recommended. Read about this in our documentation.

Licence

Unless otherwise specified, everything in this repository is covered by the following licence:

Creative Commons Attribution 4.0 International Licence

Python Intro by Ben Nuttall is licensed under a Creative Commons Attribution 4.0 International Licence.

Based on a work at https://github.com/bennuttall/python-intro

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%