Difference: Exercises (1 vs. 14)

Revision 142022-08-29 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 22 to 22
 
Added:
>
>
  -- Uli Raich - 2020-05-03

Revision 132022-08-29 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 13 to 13
 
Changed:
<
<
>
>
 Supplementary exercises:
Changed:
<
<
>
>
  -- Uli Raich - 2020-05-03

Revision 122022-03-05 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 9 to 9
 
Changed:
<
<
>
>
 

Revision 112021-02-06 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 18 to 18
 Supplementary exercises:
Changed:
<
<
>
>
 
Changed:
<
<
>
>
  -- Uli Raich - 2020-05-03

Revision 102021-02-06 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 20 to 20
 
Changed:
<
<
>
>
  -- Uli Raich - 2020-05-03

Revision 92021-01-23 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 20 to 20
 
Added:
>
>
  -- Uli Raich - 2020-05-03

Revision 82021-01-22 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 17 to 17
  Supplementary exercises:
Added:
>
>
  -- Uli Raich - 2020-05-03

Revision 72021-01-20 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 15 to 15
 
Added:
>
>
Supplementary exercises:
  -- Uli Raich - 2020-05-03

Revision 62020-09-02 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 14 to 14
 
Changed:
<
<
>
>
  -- Uli Raich - 2020-05-03

Revision 52020-07-31 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 11 to 11
 
Changed:
<
<
>
>
 

Revision 42020-07-26 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 10 to 10
 
Changed:
<
<
>
>
 

Revision 32020-05-22 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Course on Internet of Things

Line: 8 to 8
 
Changed:
<
<
>
>
 

Revision 22020-05-03 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
Changed:
<
<

Exercise 1: REPL and standard Python programming

Introduction

>
>

Course on Internet of Things

 
Changed:
<
<
The goal of these exercises is to bring your Python programming skills to a level needed for the rest of the course.

Course on Internet of Things

Exercises Session 1:

Exercise 1:

Connect to your ESP32 with minicom or thonny.

Using REPL:

  • print “Hello World!”

  • read in a text using input() and print it

  • Calculate

    calculations.png

  • Calculate sin(30°)
    If you see errors, how do you correct them? Are the results correct?

Exercise 2:

Write a script that assigns the values 5 and 3 to the variables a and b respectively

Print the results of 4 basic arithmetic operations:

  • a+b

  • a-b

  • a*b

  • a/b

Which result do you observe for division? Can you correct?

Improve this program asking the user to enter 2 integers separated by a space. If this happens when the user mistypes and enters something that is not an integer can you capture the error and simply ask him to repeat his input until you get 2 correct integer numbers?

Exercise 1:

Connect to your ESP32 with minicom or thonny.

Using REPL:

  • print “Hello World!”

  • read in a text using input() and print it

  • Calculate

  • Calculate sin(30°)
    If you see errors, how do you correct them? Are the results correct?

Exercise 2:

Write a script that assigns the values 5 and 3 to the variables a and b respectively

Print the results of 4 basic arithmetic operations:

  • a+b

  • a-b

  • a*b

  • a/b

Which result do you observe for division? Can you correct?

Improve this program asking the user to enter 2 integers separated by a space. What happens when the user mistypes and enters something that is not an integer?

Can you capture the error and simply ask him to repeat his input until you get 2 correct integer numbers?

Exercise 3:

Ask the user for 2 integer numbers. Check with one is bigger and print the result:

Running the program should result in output as shown below:

Exercise 3:

Ask the user for 2 integer numbers. Check with one is bigger and print the result:

Running the program should result in output as shown below:

>
>

Exercises:

  -- Uli Raich - 2020-05-03
Line: 75 to 23
 
<--/commentPlugin-->

META FILEATTACHMENT attachment="calculations.png" attr="" comment="" date="1588497723" name="calculations.png" path="calculations.png" size="2388" user="UliRaich" version="1"
Changed:
<
<
META FILEATTACHMENT attachment="conversionError.png" attr="" comment="" date="1588497743" name="conversionError.png" path="conversionError.png" size="19759" user="UliRaich" version="1"
>
>
META FILEATTACHMENT attachment="conversionError.png" attr="" comment="" date="1588512371" name="conversionError.png" path="conversionError.png" size="19759" user="UliRaich" version="1"

Revision 12020-05-03 - UliRaich

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"

Exercise 1: REPL and standard Python programming

Introduction

The goal of these exercises is to bring your Python programming skills to a level needed for the rest of the course.

Course on Internet of Things

Exercises Session 1:

Exercise 1:

Connect to your ESP32 with minicom or thonny.

Using REPL:

  • print “Hello World!”

  • read in a text using input() and print it

  • Calculate

    calculations.png

  • Calculate sin(30°)
    If you see errors, how do you correct them? Are the results correct?

Exercise 2:

Write a script that assigns the values 5 and 3 to the variables a and b respectively

Print the results of 4 basic arithmetic operations:

  • a+b

  • a-b

  • a*b

  • a/b

Which result do you observe for division? Can you correct?

Improve this program asking the user to enter 2 integers separated by a space. If this happens when the user mistypes and enters something that is not an integer can you capture the error and simply ask him to repeat his input until you get 2 correct integer numbers?

Exercise 1:

Connect to your ESP32 with minicom or thonny.

Using REPL:

  • print “Hello World!”

  • read in a text using input() and print it

  • Calculate

  • Calculate sin(30°)
    If you see errors, how do you correct them? Are the results correct?

Exercise 2:

Write a script that assigns the values 5 and 3 to the variables a and b respectively

Print the results of 4 basic arithmetic operations:

  • a+b

  • a-b

  • a*b

  • a/b

Which result do you observe for division? Can you correct?

Improve this program asking the user to enter 2 integers separated by a space. What happens when the user mistypes and enters something that is not an integer?

Can you capture the error and simply ask him to repeat his input until you get 2 correct integer numbers?

Exercise 3:

Ask the user for 2 integer numbers. Check with one is bigger and print the result:

Running the program should result in output as shown below:

Exercise 3:

Ask the user for 2 integer numbers. Check with one is bigger and print the result:

Running the program should result in output as shown below:

-- Uli Raich - 2020-05-03

Comments

<--/commentPlugin-->

META FILEATTACHMENT attachment="calculations.png" attr="" comment="" date="1588497723" name="calculations.png" path="calculations.png" size="2388" user="UliRaich" version="1"
META FILEATTACHMENT attachment="conversionError.png" attr="" comment="" date="1588497743" name="conversionError.png" path="conversionError.png" size="19759" user="UliRaich" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback