1 of 17

CSE 163

Control Structures & Strings

Arpan Kapoor�Summer 2026��💭Icebreaker (discuss with neighbors):

What’s the last movie or TV show you watched or are currently watching? Add to our Slido!

slido.com

#2348882

2 of 17

Agenda

  • Overview
  • Course structure
  • Assessments and Grading
  • Introduction to course tools
    • Course website
    • Ed
    • Gradescope
  • Content!
    • Python Basics
    • Control Structures
    • Strings

Slido Q&A will be open all class

3 of 17

Overview

What is this class?

  1. More advanced programming concepts than in CSE 122 or CSE 160 including how to write bigger programs with multiple classes and modules.�
  2. How to work with different types of data: tabular, text, images, geo-spatial, etc.�
  3. Ecosystem of data science tools including Jupyter Notebook and various data science libraries including scikit-image, scikit-learn, and pandas data frames.�
  4. Basic concepts related to code complexity, efficiency of different types of data structures, and memory management.

  • Foundations of data literacy and technical communication for critical and conscientious data science.

slido.com

#2348882

4 of 17

Overview

Who is taking this class?

This class is designed to have students from

  • 122: Know control structures, file I/O, arrays in Java
    • Will spend first weeks learning 122 in Python fast!
    • Practice is KEY!�
  • 160: Know control structures, file I/O, data structures in Python
    • First week will be review while everyone learns Python�
  • 123 or Beyond: Seen more advanced programming in Java
    • Class material should be complementary to what you would have learned in 123

slido.com

#2348882

5 of 17

Who am I?

Instructor: Arpan Kapoor

  • From Des Moines, IA, moved to Washington in 2019
  • B.S. in ECE from UW, current M.S. student in EE
  • Outside of class, enjoy watching movies, building/collecting Lego, and playing video games!

Teaching Assistants: 4 Amazing TAs!

  • Available in section, office hours, and discussion board!
  • Invaluable sources of information and help in this course!

Me!

slido.com

#2348882

6 of 17

CSE 163 TAs!

6

Katie Gower

(AA/AB)

Melissa Reyes-Ramirez (AB/AC)

Patrick Yu

(AC)

Sheamin Kim

(AA)

slido.com

#2348882

7 of 17

Lesson Review Due

Attend:

Class Lecture

Mon

Tue

Attend:

Class Lecture

Wed

Attend:

Quiz Section

Thur

Prog. Prac. Released/DueSection Check-in Released

  • We don’t record attendance in lecture/section, but attending these sessions is expected

Lesson Review Due

Relax!

Fri

Lesson Review Due

Section Check-in Due

Homework Released/Due

Attend:

Class Lecture

8 of 17

Pacing

We are releasing the lessons and assessments as we move throughout the quarter

As a general note: Interacting compassionately and empathetically is key!

Community is built by all of us! We need you to participate in the active classroom environment. This means

  • Attend class sessions and quiz sections when you can
  • Participate in discussions on Ed Discussion and chat
  • Reach out to your peers and the course staff when you need help!

9 of 17

Final Project

  • Culmination of all the things you learned in this class.
  • Open ended project where you find and use real-world datasets to answer an interesting question.
  • Broken into various checkpoints throughout quarter:
    • Pick a research question and your datasets
    • Give preliminary findings about the data
    • Gather results and write final report

slido.com

#2348882

10 of 17

Course Resources

  • Course website: https://cs.uw.edu/163
    • Everything you need is linked from here!
    • Check the home page schedule for all links for that day
  • Ed: https://edstem.org/us/courses/99614/discussion
    • For discussion board and announcements
  • Gradescope: https://www.gradescope.com/courses/1303321
    • For grades and assignment tracking

slido.com

#2348882

11 of 17

Ways to Execute Code (Main-Method Pattern)

  • More applicable to Python scripts (.py files) than Jupyter Notebooks.

Version 1

Version 2

print('Hello World!')

def main():

print('Hello World!')

if __name__ == '__main__':

main()

slido.com

#2348882

12 of 17

Types and Expressions

  • Types in Python
    • int: integers
    • float: decimal-point numbers
    • bool: True or False (Boolean values)
  • Expressions : values and operations that evaluate to a value (int, float, bool, etc.)

a = 4.0

b = 3 * 2 + 4 ** 2

x = True

y = 9 < 4

slido.com

#2348882

13 of 17

Loops and Conditionals

  • Two types of loops:
    • for: runs for a fixed number of iterations
    • while: runs while a certain condition remains True
  • Conditionals:
    • Can change behavior of your function depending on certain conditions
    • Only one behavior is chosen from the branches

n = 5

if n < 10:

print(‘A’)

elif n < 20:

print(‘B’)

else:

print(‘C’)

slido.com

#2348882

14 of 17

Anatomy of a Function

14

def function_name(parameter, ...):

#Function code

return value

def keyword

Function name

Optional

parameters

Function code

colon

Indentation

Return statment

slido.com

#2348882

15 of 17

Strings

  • Strings
    • Text data that has indices for characters
    • Has functions to transform (and return new) strings!
    • String slicing

slido.com

#2348882

16 of 17

String Methods vs. len

Call functions on strings using syntax

This is not true for len (or other built-in Python functions)

Can you think of other built-in Python functions?

len(s)

s.function(params)

slido.com

#2348882

17 of 17

Lesson Highlights

  • Most of this lesson should have been mostly familiar
    • variables, conditionals, loops, functions, etc.
  • New Python syntax things may be the “newest” thing you’ve encountered
    • Colons after function and loop definitions
    • No brackets, semicolons, or variable type definitions

Main method pattern!

  • Syntax is different (which is okay!)
    • Can’t explain entire grammar. Learn by looking at fragments and playing with code.
    • Gets better with practice! Try things and see how they change the code.
    • Indentation is important!

def main():

print('Hello world!')

if __name__ == '__main__':

main()

slido.com

#2348882