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.
Continue reading ]]>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.
]]>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:
Continue reading ]]>
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:
]]>
Use of loops with “while”
Continue reading ]]>
Use of loops with “while”
]]>
Use of “elif” with a conditional
Continue reading ]]>
Use of “elif” with a conditional
]]>
Use of “else” with a conditional
Continue reading ]]>
Use of “else” with a conditional
]]>
Use of the conditional “if”
Continue reading ]]>
Use of the conditional “if”
]]>
Calling and Creating Python functions
]]>
Ability to create Python project in IDE and run inside the IDE
]]>
Ability to create Python file and run from command line
Continue reading ]]>
Ability to create Python file and run from command line
]]>
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:
def helloworld():
print "hello"
import hello
hello.helloworld()
>>>'hello'
]]>