American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

4 PM – Introduction to Python – Nathaniel Lee

April 24, 2021 @ 4:00 pm - 5:00 pm

  1. Today we completed:
    1. Learning about functions without return values
  2. Homework:
    1. The 2 questions in the file named “Apr24_FunctionsPart2.py” (found in the google drive)
    2. I will also leave the questions below:

”’
Homework:

#1.)
create a function named “print_me”
that gets has two arguments
a list, a limit

list_of_int = [1,2,3,4]

print_me(list_of_int, limit)

in the func, go through the list
and use a for loop to print the elements
of the list according the the limit

ex.

print_me(list_of_int, 2)

output:

1
2

”’

”’

#2.)
create a function named “find_nemo”
one argument, a list

list_of_movies = [cars, incredibles, toy story, nemo]

find_nemo(list_of_movies)

in the func, go through each element in the list
with a for loop
if the element in the list is equal to nemo
then print “I found nemo”
else print(“I have not found nemo”)

ex.
output:

find_nemo(list_of_movies)

i have not found nemo
i have not found nemo
i have not found nemo
i have found nemo

”’

If you have any questions, please feel free to email me at nathaniel@ayclogic.com!

Details

Date:
April 24, 2021
Time:
4:00 pm - 5:00 pm
Event Category: