Logo

COMPSCI 119 - Shared screen with speaker view
Joseph McCaffery
06:14
Note: Import math
Jessica Mekeel
09:05
does it print with ‘ ‘ around the characters?
Joseph Pasquale
10:12
no
Joseph Pasquale
10:48
However apostrophes/single quotes are used to declare characters, another data type
Joseph Pasquale
11:39
TIL
Hunter Schinabeck
15:05
(2,18,3)?
Robby Gatzke
15:10
(2/18/3)
Maria Pitel
15:14
Range(2,18,3)
Robby Gatzke
15:19
,*
Joseph Recchia
17:52
Can you make a list using floats?
Aiesha Ayub
18:01
Why is the second method preferred again?
Robby Gatzke
18:19
for patterns in lists
Joseph Pasquale
19:21
Change 18 with 1800, and you quickly see why it takes longer to do the above. You’d have to write every third number from 2 to 1800. Much easier to just write range(2, 1800, 3)
Aiesha Ayub
19:59
oh okay ty!
John Lauro
22:29
1-5
Joseph McCaffery
22:34
0-5
Robby Gatzke
22:57
what if you change x in the for loop to something random like aardvark, would you still get 4 then 9, then -5, and so on
Cody McCreanor
24:01
why is it 0-5 if there are 6 items?
Robby Gatzke
24:13
starts at 0
Jessica Mekeel
24:14
it begins the count at 0
Joseph McCaffery
24:19
0,1,2,3,4,5 is 6 items
Joseph Pasquale
24:22
You’d have to change every instance of X to “aardvark”. Variable name is arbitrary. But you need to be able to refer to the same item
Joseph Pasquale
24:34
@Robby
Robby Gatzke
24:42
thx
Cody McCreanor
24:52
oh okay thank you
Nicole Fantoni
25:54
So what does the print part do again?
Joseph Pasquale
26:20
Prints the index in the list, as well as the element at that index
Aiesha Ayub
29:02
yes
Joseph McCaffery
32:17
Do you need to reset counters value?
Joseph McCaffery
32:28
no it pulls from the list
Joseph McCaffery
32:33
answered my own question
Robby Gatzke
34:24
why use a counter then?
Joseph Recchia
34:28
What’s the difference between for and while in this context
Haylee Wagner
34:40
what are the empty brackets for?
Robby Gatzke
34:42
can you do double for loops?
Emily Bevacqua
35:31
The empty brackets creates the list
Haylee Wagner
35:52
oh okay thank you
Joseph McCaffery
35:59
@Haylee we need to define L, so the empty brackets defines it, and declares it is a list. That way we can add more lists to it.
Emily Bevacqua
38:24
Do we have an exact date for the first midterm yet?
Joseph Pasquale
39:29
Starts at 1, ends at 10, increments by 1
Joseph McCaffery
40:00
the for loop will go through each sequence sequentially
Joseph McCaffery
40:10
each item*
Emmett Hamilton
40:48
would you have to add the counter if you only did range(1,11)
Joseph Pasquale
41:38
When you don’t specify the third number, it will go up by 1 by default
Cameron Almeida
41:50
The first method involves creating the list using counter while the second method uses the for loop to pre create the list?
Cameron Almeida
42:40
Yes
Cameron Almeida
42:41
Thank yoou
Robby Gatzke
42:57
yup
Jean Saint-Felix
43:02
why is there no indentation with print?
Jean Saint-Felix
44:04
ohh, thank you
Julia Leroux
46:00
Do you need the colons after the for loop
Julia Leroux
46:16
In the list comprehension
Julia Leroux
46:42
Okay thank you
Addy
47:06
so what exactly is the list comprehension doing, I don’t quite get it. Is it simply a condensed version of the functions above?
Addy
48:02
Can you explain what its individual parts are doing, and relate it to the other statements because I am lost…
Addy
48:32
yea the for and while loop make sense
Addy
50:03
so it just square roots everything for counter in range of 1,11,1
Jean Saint-Felix
51:21
So, u just add the payload before the for loop?
Joseph McCaffery
51:47
all 0's
Robby Gatzke
51:49
0,0,0,0,0,0,
Giovanni Quintal
51:49
0 ten times?
Emily Bevacqua
51:50
Ten 0?
Joseph McCaffery
51:55
10 of them
Addy
51:55
10
Aiesha Ayub
52:50
What if you did range (N), would it be range (11)? Meaning you would print 1-11?
Hunter Schinabeck
52:58
thanks prof
Aiesha Ayub
53:20
Okay ty
Julia Leroux
53:20
Can you explain why we get 10 zeros instead of 9
Maria Pitel
53:24
Thank you!
Giovanni Quintal
53:29
thank you have a good day
Julia Leroux
53:43
Okay thank you
Isabella MacNaughton
53:44
Thank you prof!
Caroline Sonnett
53:48
Thanks!
Victoria Chan
53:50
Thank you!
Kai Rojo
53:51
Thank you, have a great day!
Grace Ingledue
53:52
Thank you!
Zack Colleran
53:52
Thank you!
Jessica Mekeel
53:53
thank you!
Robby Gatzke
53:56
thanks