- This event has passed.
6:30pm – Intro to Python – Roland
May 14 @ 6:30 pm - 7:30 pm
Today We Did
- Reviewed HW
- Questions 2, 3 and 4 from the HW (starwars functions)
- Errors and how to fix them
- Click on the blue text to figure out where the error is
- Read the red error message as a hint
- Fix the error and rerun the code
- Types of errors
- SyntaxError = you broke the language rules of python!
- NameError = typo most likely in the variable name
- IndentationError = indented wrong
- IndexError = most likely out of range index
- Reviewed HW
Homework:
Submit the following file into your Google Drive Homework Folder
- 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.
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