Link Search Menu Expand Document

Announcements


Week 9 Review

Mar 10 · 3 min read ⏳

🕘 Week 9: Storing and Retrieving Data from Files

Dear all,

We hope you all had a great week! With one week left, we hope that you are all looking forward to taking your knowledge to the next level!

  • The slides and class recordings as well as the videos from the class and lab sections are posted on Gauchospace. There were just a few questions during the review session and they mostly revolved around the quiz 6, so we didn’t post a video.

⏰ Week 10 - Due dates and Deadlines ⏰

In the previous announcement (emailed on email on Wednesday, March 8), we extended Week 08 and 09 lab deadlines.

  • To ensure that everyone has a chance to work through the Grade Management labs and submit them, we will extend the LA08 deadline until ⏰ this Saturday (March 11) 23:59.
  • Week 10 Labs have been released, so you can start working on them already.

The deadlines next week are:

  • Wednesday, 3/15 11:59PM: Project Checkpoint 1
  • Saturday, 3/18 11:59PM: LA09 functions are needed for the Project Checkpoint 2, so they will be due in zyBooks at that time as well: at the end of Week 10.
  • Saturday, 3/18 11:59PM: PA10 + CA10

Finals Week

⏰ Final Project Submission and LA10 are due Fri, Mar 24, 23:59.

Final Project Clarification

  • As mentioned in this piazza post, to pass the Gradescope tests for final project (checkpoint 1), you need to add two dash lines (each composed of 42 dashes ‘-‘) in your print_restaurant_menu function. We apologize for the inconsistency.

🔮 Looking ahead to Week 10

  • Start working on the final project! The final project will require more work and is more complex than our regular labs, so it is important to start early. It is similar in difficulty to the Week 08 project.
  • Don’t panic when your code doesn’t behave as expected. It is normal to spend a lot of time debugging the program. Reading the error carefully and using print statements can greatly reduce debugging time.
  • Testing is important. Fully test your program to make sure your code handles different edge cases. It is always a good practice to start from testing each function, and then test the whole program comprehensively.
  • When testing, write different tests to check different cases: it is redundant to check the same case multiple times, so make sure that your tests cover the various branches in your code.
  • Besides the final project, you will work with recursion next week, which is a very powerful concept. There is a video and a reference handout that’s linked on Gauchospace under Week 10 - we recommend watching it first before reading zyBooks Week 10 content.

ESCI Survey Reminder

  • You should all received an email about the ESCI survey. To submit the feedback, please log in to https://esci.id.ucsb.edu using your UCSBNetID and password. Your responses there are anonymous but your thoughtful and constructive feedback will help us improve the course and methods of instruction. The form takes ~6 minutes to complete, so please complete it as soon as possible.

➡️ Resources

Here is an interesting article talking about csv files that we leared how to read this week: CSV FORMAT: HISTORY, ADVANTAGES AND WHY IT IS STILL POPULAR.

We are happy to see that you are working hard and making your way through the difficult weeks of the quarter. Let’s keep the spirit up. We are here to help you with anything you need – don’t hesitate to reach out to us through Piazza or attend our office hours during the week (including the in-person times! 🎊).

Wishing you all a lovely weekend!

Prof K and the mentors

Week 6 Review

Feb 17 · 4 min read ⏳

🎲 Week 6: Repeating and Iterating (Loops)

Dear all,

We hope you all had a great week! With 40% of the course left, we hope that you are all looking forward to taking your knowledge to the next level!

  • This week, we discussed one of the most important and interesting topics - loops!
  • We deconstructed the two types of loop constructs (while, for) and their differences, and how they iterate through a range of numbers or even container types.
  • We saw the range() function in action and discussed how to write loops using the various forms of range: range(stop), range(start, stop), range(start, stop, step).
  • During labs, we went over some concepts reviewed in class such as while and for loop constructs and how to use the range() function for a container type such as a list. We also went through the concept of nested loops.

  • The slides and class recordings as well as the videos from the class and lab sections are posted on Gauchospace (look for the ⏩ icon; use your UCSB address - we won’t be granting access to personal gmail accounts.)

⏰ Week 7 - Due dates and Deadlines ⏰

The deadlines next week are:

Note: Monday 2/20 is a holiday, so there will be no office hours.

  • Tuesday, 2/21 11:59PM: LA06
  • Wednesday, 2/22 11:59PM: LA07 CHECKPOINT Week 7 zyLabs with the word “Checkpoint” in their title
  • Thursday, 2/23: in-class Quiz 5 (starts on Gauchospace, file submission to Gradescope). Quiz covers Week 1-6 content. Starts at 9:30AM sharp.
  • Saturday, 2/25 11:59PM: Weekly reflection posted on Gauchospace + PA07 + CA07

➡️ Preparing for the Quiz

  • Continue practicing with the IDE / IDLE to ensure that you can create new files and are not relying on the Python shell
  • Practice writing code from scratch (see the tips under the “experiment” bullet point listed here)
  • If you haven’t already, take the Practice Gradescope Quiz that’s posted on Gauchospace, and submit your file on Gradescope until you get the full score (Gradescope allows you to submit an unlimited number of times until the deadline)
  • Review Tuesday’s recording (Week 6, Feb 14) to review more tips for IDE tips and Quiz preparation

🔮 Looking ahead to Week 7, your tasks for the upcoming days are:

  • Review your notes from Week 3 about Lists and Dictionaries! 💎
    • In-place modification and modification of a copy of a list is an important distinction.
    • Pay close attention to iterating through the list vs. the dictionary (review our in-class discussion on Thursday).
    • Keep track of the square brackets / parentheses when nesting lists / dictionaries.
    • Make sure that you work through the examples of how to index nested structures.
    • Create your own example of how to nest lists inside a dictionary and dictionaries in a list - feel free to share it on our forum, so others can practice with it too.
    • The “📎 Quick access” notes within the zyBooks sections point you to the resources you will definitely need to reference, so make a note of them.

➡️ Resources

  • If you are still confused about if name == “main”, have a look at this article to read more about it (🐍 snake picture alert!). We encourage you to use a template to help you with the function definition and the if __name__ == "__main__": in your main.py file.
  • Use Python Tutor to visualize your code and let us know if you have other debugging tips that would be helpful to share with others.

Survey Reminder

We are happy to see that you are working hard and making your way through the difficult weeks of the quarter. Let’s keep the spirit up. We are here to help you with anything you need – don’t hesitate to reach out to us through Piazza or attend our office hours during the week (including the in-person times! 🎊).

We hope you’ll get to recharge yourselves over the weekend, since we are moving into the busiest part of the term.

Wishing you all a lovely weekend!

Prof K and the mentors

Week 5 Review

Feb 10 · 4 min read ⏳

🌟 Week 5: Writing reusable, generalizable code (Functions)

Dear all,

We hope you all had a great week! With 50% of the course behind us, we hope you are all enjoying coding in Python and learning more about Computer Science!

  • During class this week, we learned about one of the most important topics - functions and testing done via the assert statements!
  • We discussed how to
    • write functions (function definition),
    • execute functions (function call),
    • the different kinds of arguments a function takes and how they are different from the function parameters,
    • the different kinds of outputs a function can have,
    • how to output values (print vs. return statement),
    • different python IDEs, and much more.
  • During labs, we went over some concepts taught in class such as function definition and function call. In addition to this, we demonstrated how to upload solutions to Gradescope so that they can be autograded. We also demonstrated how to use IDLE and how it can be helpful to test your code. As always, the recording is available on Gauchospace.

Grading

  • Quiz 3 results have been released on Gauchospace.
  • There was no quiz in Week 5 to ensure that you get all your questions answered.
  • Due to the confusion regarding the due dates on Gradescope, Week 5 Checkpoint lab score is going to be dropped. The Week 5 Checkpoint labs will be due as usual with the rest of the labs next week.

⏰ Week 6 - Due dates and Deadlines ⏰

The deadlines next week are:

  • Tuesday, 2/14 11:59PM: LA05
  • Wednesday, 2/15 11:59PM: LA06 CHECKPOINT Week 6 zyLabs with the word “Checkpoint” in their title
  • Thursday, 2/16: in-class Quiz 4 on Gauchospace, covering Week 1-5 content. Starts at 9:30AM sharp.
  • Saturday, 2/18 11:59PM: Weekly reflection - the link to it is available under the Week 5 tab on Gauchospace + PA06 + CA06

➡️ Staying on Track

🔮 Looking ahead to Week 6, your tasks for the upcoming days are:

  • If you run into errors or tests not passing, carefully re-read the instructions. 💎
  • In Week 6, we will be learning about a very important concept: Loops (Repeating and iterating).
    • Note that the while loop needs to have its loop variable initialized before the loop and also updated inside the loop (to get it closer to the sentinel value)
    • Pay close attention to the difference in the behavior of the range() when we give it 1, 2, or 3 arguments
    • continue jumps back to the top of the loop to evaluate its condition again; break causes code execution to break out of the loop

Your TODO - practice Gradescope quiz

The Week 6 tab on Gauchospace contains a Practice Gradescope Quiz, which you should take. The format of the quiz mimicks that of our upcoming quizzes, so make sure that you give it a try, practice the workflow, and work the bugs out before the graded in-class quiz.

➡️ Just for fun

*Just for fun: Here’s a choose-your-adventure walkthrough with a riddle, implemented in Python. Download the zip file using the link, open it up, and run the story.py (if you have IDLE installed, it will open the file automatically if you double-click on it; when it opens, click anywhere inside the file, and then use the Run -> Run Module to get started). This adventure is intended to be run on the terminal, so if you know how to do it (or search the web for “run python in terminal”), we recommend doing so for the best experience!

Things are speeding up and we hope that you’ll use this weekend to catch up on anything that’s been unclear or tripping you up.

We hope that you’ll make time to recharge yourselves over the weekend :)

Prof K and the mentors

Week 4 Review

Feb 3 · 3 min read ⏳

🍀 Week 4: Making decisions in programs (Branching)

Dear all,

We’re almost halfway through the quarter!

  • During class and lab, we discussed different data structures such as:
    • Conditionals
    • Booleans and Boolean Operators: Comparison Operators and Logical Operators
    • Branching using the if-elif-else statements
    • assert statements for writing tests of return values
  • The slides and class recordings as well as the videos from the class and lab sections are posted on Gauchospace (look for the ⏩ icon; use your UCSB address - we won’t be granting access to personal gmail accounts.)

⏰ Week 5 - Due dates and Deadlines ⏰

Check the Calendar, for the due dates. They are the same as they’ve been before.

Upcoming deadlines are:

  • Tuesday, 2/07 11:59PM: LA04
  • Wednesday, 2/08 11:59PM: LA05 CHECKPOINT Week 5 zyLabs with the word “Checkpoint” in their title
  • Saturday, 2/11 11:59PM: Weekly reflection - the link to it is available under the Week 4 tab on Gauchospace + PA05 + CA05

Important: Next Monday, 2/06 is the deadline to drop this course without a W.

Keep in mind that the College of Engineering does not allow this course to be switched to P/NP later.

➡️ Staying on Track

  • Ask for clarifications during the office hours, lab sessions, or post your questions on Piazza

🔮 Looking ahead to Week 5, your tasks for the upcoming days are:

  • Carefully read the instructions! Do NOT rush through them. 💎
    • Take non-function code from zyBooks and see if you can turn it into a function.
    • Write tests for it.
    • Feel free to ask us during the office hours if you are on the right track.
    • The condition should involve checking the result of the function call. Please review the examples from class and practice writing them on your own. We’ll be asking you to write assert statements on the future quizzes.

Grade updates

Your zyBook grades have to be manually transferred to Gauchospace, so the synchronization is not instant. Your grades for each week’s activities will be updated by Thursday at 1pm. We will process the extensions on the same day - you will receive a confirmation when your extension was processed and the grade was updated.

Your TO-DO before Week 5

  • Please download and install Python before next week.
  • Read about Python installation and working with IDLE
  • Create a file called week5_laps.py using the sample lab instructions
  • Create an account on Gradescope using the link provided on Gauchospace (underneath the iClicker link)
  • Submit your week5_labs.py file on Gradescope. You can submit an unlimited number of times until the due date.
  • Now is a good time to review How to Succeed in CSW 8: things will get busier and more complex in the following weeks, so please plan accordingly by creating the study blocks in your calendar.

➡️ Resources

In addition to the installation guide and a brief intro to IDLE that we provided, here are some optional resources for you to explore.

  • Learn about using Python IDLE. Here is a nice resource for doing so.
  • Python Tutor is a cool resource for running code in Python - we highly recommend it!
    • This website allows you to trace through your code step by step so you can see exactly how your code is being executed.

✨ Lastly, here is some great insight on Human-Centered Artificial Intelligence, which is related to our discussion of human-centered design this week.

Wishing you a lovely weekend!

Prof. K and the mentors

Week 3 Review

Jan 27 · 5 min read ⏳

🍡 Week 3: Representing data (Variables and Types)

Dear all,

Hope you’re having a great time thus far! We have been really happy to meet those of you who stopped by the office hours, so don’t hesitate to join us even if it’s just to say “Hello” :-)

Before we dive into Week 4, we wanted to take a step back to review what happened in Week 3. If there is anything from Week 3 that you are still unsure about, especially, regarding indexing and string formatting, make sure that you review and clarify it. The material in this class will begin to build on itself a lot more after Week 4, so make sure that you are comfortable with what we’ve covered so far.

  • In Week 3 chapter and in the labs, we got to practice different data structures such as:
    • Tuples (Immutable Data Store),
    • Sets (Mutable Data Store),
    • Lists (Mutable Data Store),
    • Dictionaries (Mutable Data Store)
    • Indexing in ordered data structures and dictionaries
    • Modifying lists and dictionaries
    • Various useful built-in operations in data structures
    • String Formatting
    • Binary Numbers
  • The book as well as the slides and the class recording include the table comparing the data structures, which we encourage you to use as a reference.
  • In class, we practiced writing functions, differentiating between the print and return results, as well as how the if __name__ == "__main__": block affects the code that is imported as a module.
  • We had our second quiz on Thursday (Quiz 2) and the results have been released on Gauchospace.
    • Quizzes are scheduled to take place each Thursday at the start of the class.
    • Any regrade requests should be submitted through a form that’s linked in the quiz description on Gauchospace.
  • The slides and class recordings as well as the videos from the class and lab sections are posted on Gauchospace (look for the ⏩ icon; use your UCSB address - we won’t be granting access to personal gmail accounts.)

  • Please follow the collaboration guidelines that are outlined in the Syllabus and that we’ve discussed in class (including the Piazza posting guidelines)

⏰ Week 4 - Due dates and Deadlines ⏰

Keep in mind that your grades have to be manually transferred to Gauchospace, so the synchronization is not instant. Your grades for each week’s activities will be updated by Thursday at 1pm. We will process the extensions on the same day - you will receive a confirmation email when your extension was processed and the grade was updated.

Upcoming deadlines are:

  • Saturday, 1/28 11:59PM Due: Weekly reflection that will be posted on Gauchospace + PA03 + CA03
  • Tuesday, 1/31 11:59PM Due: LA03
  • Wednesday, 2/1 11:59PM Due: LA04 CHECKPOINT (Week 4 zyLabs with the word “Checkpoint” in their title).
  • Thursday: in-class Quiz 3 on Gauchospace, covering Week 1-3 content.
  • Saturday, 2/4 11:59PM Due: Weekly reflection that will be posted on Gauchospace + PA04 + CA04

➡️ Staying on Track

As we move into Weeks 4 and 5, this course (as well as your other courses) will begin to pick up the pace. Plan for it and make sure that you stay ahead by ensuring that you finish your reading and zyBook activities early and come to class having done your PAs.

🔮 Looking ahead to Week 4, your tasks for the upcoming days are:

  • Understand the flow of the program based on the results of Boolean conditions. Practice writing assert statements. 💎
    • We will work with branching and assert statements a lot more in the following weeks.
    • The “📎 Quick access” notes within the zyBooks sections point you to the resources you will definitely need to reference, so make a note of them.
    • If the “Instructor note” in zyBooks is asking you a question, work through it - chances are, it might appear on a quiz.
  • Write down anything that’s unclear and ask questions to ask during class.

Troubleshooting Resource

We have the 🐛 Debugging scenarios and solutions on our course website, which lists many common errors that students run into along with the potential solutions. We hope that you’ll find it to be a helpful resource. Use it in combination with the PythonTutor to visualize what is happening in your code.


Just a reminder: you can find these announcements on the main course website as well as under the Instructor Announcements on Gauchospace (which is supposed to email it to you automatically). We also provide course structure, helpful hints, and expectations to help you stay on track in this course.

Remember to carefully read and follow all provided instructions.

✨ Do you do a weekly review? https://nulab.com/learn/collaboration/weekly-review-one/ Try it out, since staying ahead of your workload and planning your week in advance can help you learn how you work and maybe even feel less overwhelmed.

We are looking forward to a productive week ahead!

Prof. K and the mentors

Week 2 Review

Jan 20 · 6 min read ⏳

🐣 Week 2: Objects, Functions, and Expressions

Dear all,

We hope you all had a great start to your quarter and that you are enjoying learning more about CS and Python!

  • This week, some of the topics that we discussed in class and during the labs included:
    • Basic data types (int, float, str) and how to get them from input()
    • How to use math expressions and the math module in Python
    • Functions and their uses in programming
    • Formatted strings in Python
    • Different kinds of errors
    • and much more!
  • As mentioned in the Syllabus: this class “require synchronous interactions and active participation.
    • This week, during the Tue class, we worked through the lab activity (LA 2.18 Week 2 In-class activity - Calorie expenditure in zyBooks). As mentioned in class on Thu, your score from it was added to your in-class participation but it won’t be counted in your LA01 labs, since we marked it as optional.
    • In the lab, just like in class, we focused on writing functions, including the reasons for doing so.
    • We had our first quiz (Quiz 1) and the results have been released on Gauchospace.
      • Quizzes are scheduled to take place each Thursday at the start of the class.
      • Any regrade requests should be submitted before the next quiz through a form that’s linked in the quiz description on Gauchospace.
  • The iClicker scores from this week will not be counted in your participation. Refer to the Syllabus policies about the generous dropped scores and see Thu recording for an explanation of those policies.
  • The slides and class recordings as well as the videos from the class and lab sections are posted on Gauchospace (look for the ⏩ icon; use your UCSB address - we won’t be granting access to personal gmail accounts.)

ℹ️ Pay attention to the Troubleshooting section of the zyLabs, especially, the checkpoint labs - we aggregate the most common issues that we see in the office hours and on Piazza, and add them there with the suggested solutions. If you run into an issue, check those sections first.

Please, make sure to follow the Piazza Posting Guidelines (a pinned post at the top of the list of messages) to help ensure that this is a useful resource for the class. In particular, it is important that you add messages as text instead of posting screenshots and that you do not post your code publicly. At the start of the post there are useful tips and suggestions, such as using the question numbers and search / filters, so we hope that you continue to use it for reference.

⏰ Week 2 and 3 - Due dates and Deadlines ⏰

As you can see on the Calendar, the due dates for this week included:

  • Tuesday, 1/17, 11:59PM: LA01 (in zyBooks, LAB 1.14 - 1.21).
  • Wednesday, 1/18, 11:59PM: complete the Week 2 zyLabs (LA02) with the word “Checkpoint” in their title.
  • Thursday, 1/19: in-class Quiz 1 on Gauchospace, covering Week 1 content.
  • Saturday, 1/21, 11:59PM: Week 2 reflection - the link to it is available under the Week 2 tab on Gauchospace
  • Saturday, 1/21, 11:59PM: PA02 + CA02 in zyBooks are due.

Work on completing LA02 (Week 2 lab activities in zyBooks, LAB 2.10 - 2.16) before Monday 9am - so that you have enough time to ask for clarifications during the office hours, lab sessions, or post your questions on Piazza.

As always, we will have practice reading quizzes available for you on Gauchospace (not graded, just for practice).

The deadlines next week are:

  • Tuesday 11:59PM Due: LA02
  • Wednesday 11:59PM Due: LA03 CHECKPOINT (Week 3 zyLabs (LA02) with the word “Checkpoint” in their title).
  • Thursday: in-class Quiz 2 on Gauchospace, covering Week 1 and 2 content.
  • Saturday 11:59PM Due: Weekly reflection that will be posted on Gauchospace + PA03 + CA03

Staying on Track

🔮 Looking ahead to Week 3, your tasks for the upcoming days are:

  • Do not try to memorize everything! 💎
    • We will work with strings, tuples, lists, and dictionaries a lot in the following weeks, so we will revisit them again.
    • Get a sense of what each data structure (i.e., the data type) does by noticing similarities and differences.
    • The “📎 Quick access” notes within the zyBooks sections point you to the resources you will definitely need to reference, so make a note of them.
  • Write down anything that’s unclear and ask those questions during class
  • Carefully read through the guide for Translating Lab Instructions Into Code.

If you haven’t already done so, please complete the action items that we posted for you in our first announcement (you can see it in the “Getting Started” post on the website or under the Week 1 tab on Gauchospace. - We specifically recommend creating an email filter for CSW8 messages to make sure that you see the announcements and emails from us in your primary inbox.

If you ever have any questions, please, first consult the course syllabus and the Frequently Asked Questions (FAQ) section. A lot of course structure, helpful hints, and expectations are also outlined for you on that page.

Your success in this course will largely depend on how carefully you read and follow the instructions.

Looking ahead in Week 2

As part of following the instructions, this week, we were using f-strings and the if __name__ == "__main__" block (for the main program) without diving deeper into how they work. The goal was just to use these concepts by following the provided pattern, which is an important skill.

In zyBooks’ Week 3 sections (Section 3.10 String formatting and 3.11 Alternative string formatting), you will get more details on and practice with the f-strings.

If you are eager to learn more about functions, then you can jump ahead to Week 5 in zyBooks. The easy-to-start sections include:

  • 5.1 (the basics),
  • 5.4 (reasons for defining functions),
  • 5.5 (writing math functions),
  • 5.8 (common errors),
  • 5.9 (scope - local vs. global variables). Section 5.11 discusses the if __name__ == "__main__" block.

Week 5 is also when we will begin to work with Gradescope - since we are not using it yet, don’t worry about it.

In closing, here’s something fun that you might explore if you are a fan of manga: Manga Out of the Box, a new offering from Google Arts and Culture. You can even draw your own manga character on that website with the help from Machine Learning (ML). If you try it out, post your character on Piazza (start a thread “Manga Character” if it’s not there yet).

We wish you a nice weekend!

Prof. K and the mentors

Getting Started

Jan 9 · 1 min read ⏳

Hello world! 🖖

Before the first day of class

Next steps

  • Fill out the Welcome Survey linked on Gauchospace.
  • Start reading Week 1 and Week 2 chapters on zyBooks
  • Attend the synchronous class
  • Create an accont for the course forum (Piazza) and the Gradescope site.