American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

FRI – 7 PM – Indo – Intro to Python – Joel

March 22 @ 7:00 pm - 8:00 pm

Today we did:
  1. We worked on the second version of the magic 8-ball project using random.choice().
Homework:
  1. Copy the code from pages 138-139 (if you’re using the online pdf) and put the in a file called March25_FunctionsWithReturnValueHomework.
  2. Create a new file called March25_RandomHomework and inside,
  3. #1 Create a list called ‘fruits’ with 5 fruits of your choice, and randomly pick a fruit from that list. After that, simply print the randomly picked fruit.
  4. #2 Generate a random number between 1 and 6 that will represent the outcome of rolling a die. Store that random number in a variable, and print that variable.
  5. If you are confused, check your random file either on your device on in the google drive to see which function (random.choice or random.randint) you should use for number 3. Likewise, if you’re stuck on number 4, you can also check which function you should use.
  6. Remember, if you have an error where random is not defined, then you probably forgot to ‘import random’ in the top of your file.

If you have any questions, feel free to ask me at joel@ayclogic.com or Mr. Gamas at gamas@ayclogic.com.

 

Details

Date:
March 22
Time:
7:00 pm - 8:00 pm
Verified by MonsterInsights