- This event has passed.
1 PM – Intro To Python
June 20, 2020 @ 1:00 pm - 2:00 pm
- Homework:
- Page 138
- Create a function with return value, “convert_kg_to_gram”
- It has one parameter: “kg”
- Inside the function it will return the value of 1 Kilogram from the parameter into gram. There are 1000 gram in 1 Kilogram.
- Return the value.
- Get input from user “Enter number of Kilogram: “
- Whatever user enter, pass to the “convert_kg_to_g” function
- Call the function, get the result and print the result to the screen
- If you code correctly, you should be getting something like this in the shell.
-
Enter number of Kilogram: 1 There are 1000 grams in 1 kilograms. Enter number of Kilogram: 2 There are 2000 grams in 2 kilograms.