Lecture 2 Zoom Q&A


10:02:16 From (anonymous) : It is 40
10:02:18 From (anonymous) :D
10:20:09 From (anonymous) : how does the while loop know we want the body to run if the expression is true?
10:20:25 From (anonymous) : is is the default that if is true, it will run?
10:23:02 From (anonymous) : The design of a while loop in Python states that it will run its body as long as its condition evaluates to true
10:23:50 From (anonymous) : So for when it’s false, how does it know what’s the next step? How do you separate the steps?
10:26:56 From (anonymous) : Yeah, that helped. Thx!
10:27:46 From (anonymous) : This is not the code associated with my go-rgb?
10:28:04 From (anonymous) : Thank you
10:28:31 From (anonymous) : I know this is unrelated, but could you explain what bt = Bit(filename) is defining? I am only familiar with R so this is new…
10:29:02 From (anonymous) : Is there a difference between while and if expressions?
10:29:17 From (anonymous) : Awesome thank you
10:31:06 From (anonymous) : The only difference between while and if is that while can execute its body multiple times as long as its condition remains true, but if can only execute it once.
10:31:24 From (anonymous) : Got it, thank you!
10:32:45 From (anonymous) : Where do y’all see “if it is that…” I thought it would just start with “bit…” to do once
10:32:47 From (anonymous) : Does putting a space instead of an underscore after while indicate that it is a loop
10:32:51 From (anonymous) : Referencing chat
10:36:43 From (anonymous) : So bit.{some_command} certainly does it only once, but sometimes you want to execute it conditionally, so you put the command as a body in an if statement
10:36:59 From (anonymous) : So bit.{do_something} always execute once
10:37:16 From (anonymous) : But

if {condition}:
 bit.{do_something}
10:37:26 From (anonymous) : Might or might not execute depending on the condition
10:38:58 From (anonymous) : Space separates token, while underscore connects some name you define for a single token
10:39:47 From (anonymous) :)
10:48:04 From (anonymous) : Is it similar to NA?
10:54:59 From (anonymous) : Thank you!
10:55:05 From (anonymous) : thank you!
10:59:41 From (anonymous) : Thank you!\