Skip to main content

Month 10 of 12

Advanced Python Basics

Modules, random numbers, error handling, files and list comprehension. This is Month 10 of the 12-month Brolly Python course for kids aged 9 to 15, and it ends with a test and the project “Number Guessing Game”.

  • 4 weeks
  • 8 live classes
  • a test and a project
Month 10
notes.txtopen()random.randint(1, 6)importtry / except

8 classes in 4 weeks

The classes

2 live classes a week, in this order. Under each class is what it teaches.

  1. Week 1

    Using Modules

    1. Class 1 of 8 · No. 73Introduction to Modules and the import Statement
      • Say what a module is and why Python has them
      • Import a module and use its functions with a dot
      • Use from ... import and import ... as
    2. Class 2 of 8 · No. 74The math Module
      • Use math.sqrt, math.ceil, math.floor and math.pow
      • Use the constants math.pi and math.e
      • Solve everyday problems like rounding up the number of buses
  2. Week 2

    Playing with Randomness

    1. Class 3 of 8 · No. 75The random Module
      • Pick a random item from a list with random.choice
      • Shuffle a list with random.shuffle
      • Test random programs by checking what is always true
    2. Class 4 of 8 · No. 76Random Number Generation
      • Make random whole numbers with random.randint
      • Make random decimals with random.random and random.uniform
      • Use random numbers for dice, games and simulations
  3. Week 3

    Handling Errors

    1. Class 5 of 8 · No. 77Python Errors and Exception Handling
      • Tell syntax errors from runtime errors (exceptions)
      • Read an error message to find the line and the kind of error
      • Name common exceptions like ValueError, ZeroDivisionError and KeyError
    2. Class 6 of 8 · No. 78The try and except Statements
      • Catch an exception with try and except so the program keeps running
      • Catch a specific exception like ValueError
      • Use else and finally, and keep asking until the input is valid
  4. Week 4

    Files and Smart Lists

    1. Class 7 of 8 · No. 79File Handling: Reading and Writing Files
      • Write text to a file and read it back
      • Use the modes "w", "a" and "r" and know what each does
      • Use with open(...) so the file is closed for you
    2. Class 8 of 8 · No. 80List Comprehension
      • Build a list in one line with a list comprehension
      • Filter items with an if inside the comprehension
      • Turn a simple for-loop-and-append into a comprehension
  5. End of the month

    Revise, take the test, build the project

    1. Step 1

      Monthly revision

      Everything from the month, before the test

    2. Step 2

      Month 10 test

      60 minutes · 50 marks · 6 parts

      • AMultiple Choice Questions
      • BFill in the Blanks
      • CFind the Output
      • DFind and Correct the Error
      • EPractical Coding
      • FLogical Thinking

After each live class, its examples and practice for your child's age open in the Brolly Python app.

on the year road

Where Month 10 sits in the course

The course is one road of 12 months. The months before this one are filled in, Month 10 is the gold stop, and the months still ahead are dashed.

  • Months 1 to 4
  • Months 5 to 8
  • Months 9 to 12

next step

See if the course suits your child

Book a free trial class, online or at our Hyderabad centre. A teacher will answer your questions, help you choose a batch and tell you the fees.