American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

3 PM – Intro To Python – Gamas

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

Today We Did
  1. We learned more about function
  2. We created triangle_area function
  3. We created circle_are function
Homework
  1. Create jan_17_many_function_2_hw.py. All of below homeworks are similar to what we did in the class today
  2. Create a function that can calculate the area of a rectangle.
    1. function name – rectangle_area
    2. function parameters – width, height
  3. Create a function that can calculate the volume of a rectangular prism
    1. function name – rectangular_prism_volume
    2. function parameters – width, height, depth
  4. Create a function that can do division of two numbers. Come up with a good function name and parameters.
  5. Create a function that can calculate perimeter of a triangle. Come up with a good function name and parameters
  6. Calculate how many candies each person gets

    • Function name: candies_per_person
    • Parameters: total_candies, people
      • When you call “candies_per_person(10, 2)” then it will output With 10 candies and 2 people, each person will get 5 candies.”
      • When you call “candies_per_person(100, 5)” then it will output With 100 candies and 5 people, each person will get 20 candies.”
  7. Create jan_17_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

Details

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