American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

3 PM – Intro To Python – Gamas

January 24 @ 3:00 pm - 4:00 pm

Today We Learned
  1. We continued to learn about functions
  2. And how we can reduce code duplication with functions.
Homework
  1. Create jan_24_draw_face_hw.py
    1. Create a face function that can draw like this.
      1. function name – face
      2. parameter – x,y, eye_color, mouth_color
    2. Call the function two times with different coordinate
      1. face_2(0,0, "green", "black")
        face_2(0,100, "brown", "red")

        And it will produce like this

  2. Create jan_24_many_function_2.py
    1. Create a function to convert from miles to kilometer.
    2. There are 1.6 kilometer in one mile.
    3. When the function is called and 2 miles is given to the function, the function will say “There are 3.2 kilometers in 2 miles.”
    4. When the function is called and 3 miles is given to the function, the function will say “There are 4.8 kilometers in 3 miles.”
    5. Remember you should not do if elif statements problem. You need to do multiplication inside function. The function need to work for any miles.
    6. Figure out a good function name and parameter.

Details

Date:
January 24
Time:
3:00 pm - 4:00 pm