CSE 163
Introduction to Python
Suh Young Choi
🎶 Listening to: Unwed Sailor
💬 Discuss with Neighbors: Do you have a favorite animal?
Join Slido here!
Or enter
#4156356
at slido.com
Agenda
2
Questions during Class
Feel free to raise your hand during class to ask questions! Questions are an important part of the learning process.
If we miss your question in class, feel free to ask after class or post on Ed so we can answer later!
3
Slido Q&A will be open during lecture today ☺
Course Website
4
Lessons and Pre-Class Work
5
What questions do you have?
6
Slido Q&A will be open during lecture today ☺
“
Types and Casting
We introduced the following variable types in today’s lesson:
7
Expressions:
a = 4.0
b = 3 * 2 + 4 ** 2
x = True
y = 9 < 4
Casting:
Loops and Conditionals
The two loops in today’s lesson:
8
Conditionals:
n = 5
if n < 10:
print(‘A’)
elif n < 20:
print(‘B’)
else:
print(‘C’)
Recap: �Anatomy of a Function
function header
9
parameters
function body
return statement
function call
Lesson Lowdown
Most of lesson should have been mostly familiar (variables, if statements, etc.). Some new Python-specific things.
10
Main method pattern!
Syntax looks different!
def main():
print('Hello world!')
if __name__ == '__main__':
main()
Hello World!
11
print('Hello World!')
Attempt 1
def main():
print('Hello World!')
if __name__ == '__main__':
main()
Attempt 2
Group Work:
Best Practices
When you first working with this group:
Tips:
12
Before Next Time
Next Time
13