American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

6:30pm – Intro to Python – Roland

May 14 @ 6:30 pm - 7:30 pm

Today We Did

        1. Reviewed HW
          1. Questions 2, 3 and 4 from the HW (starwars functions)
        2. Errors and how to fix them
          1. Click on the blue text to figure out where the error is
          2. Read the red error message as a hint
          3. Fix the error and rerun the code
          4. Types of errors
            1. SyntaxError = you broke the language rules of python!
            2. NameError = typo most likely in the variable name
            3. IndentationError = indented wrong
            4. IndexError = most likely out of range index

Homework:

Submit the following file into your Google Drive Homework Folder

  1. Make a new file named May14_Errors1HW.py and try to fix all the errors in the following program below. Paste it into your Thonny and once you get it fixed upload your file.
  2. budget1 = 50 * 5
    print ("budget1 "+budget1)
    
    abigail = 11
    ryan = 10
    
    budget2 = abigail * Ryan
    print ("budget2 "+budget2)
    
    hot_day = "20"< 15
    print (hot_day)
    
    if hot_day == True:
    print("It is really hot out there"
    else:
    print("It is cool out there")
    
    print("I live in "+ hometown)
    
    hometown = "Moscow"
    
    def greeting(first_name, last_name):
    print("Hello {first_name} {last_name}")
    
    greeting("Gamas")

    If you are able to fix all the problems, the program will print the following

    budget1 250
    budget2 110
    False
    It is cool out there
    I live in Moscow
    Hello Gamas Chang

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

Details

Date:
May 14
Time:
6:30 pm - 7:30 pm
Verified by MonsterInsights