Line: 1 to 1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
![]() Slide 1: Introduction to Internet of Things (IoT) | |||||||||
Line: 222 to 222 | |||||||||
The operand to the left of the = operator is the name of the variable and the operand to the right of the = operator is the value stored in the variable. | |||||||||
Changed: | |||||||||
< < | ![]() | ||||||||
> > | ![]() | ||||||||
Data Types in PythonPrograms store data in one form or the other and must be of a certain type. | |||||||||
Line: 312 to 312 | |||||||||
We have seen conditions already in the very first example | |||||||||
Changed: | |||||||||
< < | ![]() | ||||||||
> > | ![]() | ||||||||
LoopsA loop statement allows us to execute a statement or group of statements multiple times. | |||||||||
Line: 379 to 379 | |||||||||
We can therefore find out if the module is imported or executed by checking the name variable: | |||||||||
Changed: | |||||||||
< < | if _name_ == "__main__" | ||||||||
> > | _if name_ == "__main__" | ||||||||
this executes the main code only if not imported into a main program
| |||||||||
Line: 415 to 415 | |||||||||
The syntax for creation of classes is similar to functions | |||||||||
Changed: | |||||||||
< < | ![]() | ||||||||
> > | ![]() | ||||||||
You may define a method with name __init__which is called when | |||||||||
Changed: | |||||||||
< < | the instance object of the class is created (in the above example: mc = !<a href="https://afnog.iotworkshop.africa/do/edit/AFNOG/MyClass?topicparent=AFNOG.IntroductionToPython;nowysiwyg=0" rel="nofollow" title="MyClass (this topic does not yet exist; you can create it)"> MyClass </a> () | ||||||||
> > | the instance object of the class is created (in the above example: mc = MyClass) | ||||||||
Changed: | |||||||||
< < | The short description of the class can be found in the instance variable _ _doc__ | ||||||||
> > | The short description of the class can be found in the instance variable __Doc.__ | ||||||||
Classes Example | |||||||||
Line: 435 to 435 | |||||||||
A very typical example of a python library is matplotlib for plotting. | |||||||||
Changed: | |||||||||
< < | ![]() | ||||||||
> > | ![]() ![]() | ||||||||
Callbacks![]() | |||||||||
Line: 460 to 462 | |||||||||
| |||||||||
Changed: | |||||||||
< < |
| ||||||||
> > |
| ||||||||
| |||||||||
Line: 475 to 477 | |||||||||
| |||||||||
Changed: | |||||||||
< < |
| ||||||||
> > |
| ||||||||
| |||||||||
Added: | |||||||||
> > |
|