Author Archives: Joel Erles

Mastery20

Use of loops with “for”

This loop allows you to repeat a code n number of times. 

Example:

Where the a in “for a in range(x)” is a random character, you can put a string if you want.

20 1014

Mastery18

Nesting of conditional statements

If you want to check a condition after a previous condition that was true, then you might want to use nested statements.

Example:

NESTED IF CONSTRUCT

In a nested if construct, you can have an if…elif…else construct inside another if…elif…else construct. The syntax of the nested if…elif…else construct may be:

18 1014

Mastery19

Use of loops with “while”

19 1014

Mastery17

Use of “elif” with a conditional

17 1014

Mastery16

Use of “else” with a conditional

16 1014

Mastery15

Use of the conditional “if”

15 1014

Mastery11 and 12

Calling and Creating Python functions

11 12 1014

Mastery02

Ability to create Python project in IDE and run inside the IDE

02 1014

Mastery01

Ability to create Python file and run from command line

01 1014

 

Mastery14

Creating and using a Python module

A module is a file containing Python definitions and statements. The file name is the module name with the suffix “.py”

Example:

  • Create “hello.py” then write the following function:
def helloworld():
   print "hello"

import hello
hello.helloworld()
>>>'hello'

AWESOME PAGE

14 1014