American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

6PM Python Level 1

November 3, 2018 @ 6:00 pm - 7:00 pm

  1. We went over last week homework.
    1. Learned how to generate random number generator.
    2. Learned how to do forever loop using While loop.
    3. We learned how to make Magic 8 Ball program.
  2. Homework:
    1. Create a new python file in Thony, name it Nov3_2018Homework.py.
    2. Create a new variable called “students”. Data type of this variable would be List of String and value would be: “Vivian”, “Jessalyn”, “Eason”.
    3. Create a for loop which will go through each of the String inside the List and print the name. This is what you need to put to loop through each of the String inside the List.
      for name in students:   
          print(name)
    4. Run above program and make sure it prints like the following
      1. Vivian
        Jessalyn
        Eason
    5. Now change above program to do the following inside the loop
      1. Generate a random number between 1 to 3. Look at last week homework to know how to do this.
      2. If generated number is 1 print “I am a Python programmer, my name is <whatever the name from students>
      3. If generated number is 2 print “I am a Scratch programmer, my name is <whatever the name from students>
      4. If generated number is 3 print “I am a Java programmer, my name is <whatever the name from students>

Details

Date:
November 3, 2018
Time:
6:00 pm - 7:00 pm
Event Categories:
,