*** scooper has quit (Remote host closed the connection) | 12:30 | |
scooper | good morning Aaron | 12:32 |
---|---|---|
scooper | Good morning shmohamud | 12:47 |
scooper | how was your night??? | 12:47 |
shmohamud | good day scooper | 12:49 |
shmohamud | my night was relaxing, how about your evening? | 12:49 |
scooper | not bad... | 12:50 |
shmohamud | cool :) | 12:50 |
shmohamud | how was learning about list methods? | 12:51 |
scooper | find but count nearly confuse me, but I grab what it was doing later.... | 12:51 |
scooper | *fine | 12:51 |
shmohamud | I thought you were looking into insert and reverse, you went further? | 12:52 |
scooper | I did reverse, sort and count | 12:52 |
shmohamud | ah, okay cool | 12:52 |
shmohamud | nice job doing extra | 12:53 |
scooper | but if choose insert too it's not a problem I can still do it | 12:53 |
shmohamud | fkoikoi good day | 12:53 |
shmohamud | that's fine scooper, I asked you to choose two and it sounds like you did three so we're all good! If you want you can explain insert too, though. | 12:54 |
fkoikoi | good morning shmohamud | 12:54 |
shmohamud | Happy Tuesday guys | 12:54 |
shmohamud | So, let's dive in! Fkoikoi, did you complete the homework? | 12:55 |
scooper | Same from our end shmohamud | 12:55 |
fkoikoi | yes, i did | 12:56 |
shmohamud | please share the results | 12:57 |
shmohamud | next, we will have scooper teach us about some list methods | 12:57 |
scooper | OK | 12:58 |
scooper | Thanks for giving me that opportunity | 12:58 |
shmohamud | It's a great way for all of us to learn. You're welcome. | 12:58 |
shmohamud | fkoikoi? | 13:01 |
fkoikoi | yes | 13:01 |
shmohamud | can you please share the homework answers with us? | 13:01 |
fkoikoi | test_list = [9,41,12,3,74,15] | 13:03 |
fkoikoi | print(test_list[0:2]) | 13:03 |
fkoikoi | test_list = [9,41,12,3,74,15] | 13:03 |
fkoikoi | print(test_list[0:3]) | 13:03 |
fkoikoi | test_list = [9,41,12,3,74,15] | 13:03 |
fkoikoi | print(test_list[3:-1]) | 13:03 |
shmohamud | scooper, does it answer this: and take slices of [9, 41], [9, 41, 12], [3,74], and [3, 74,15] | 13:05 |
shmohamud | ? | 13:05 |
scooper | The last question has an error | 13:06 |
scooper | Firstly what is she printing?? | 13:06 |
shmohamud | [9, 41] | 13:07 |
shmohamud | [9, 41, 12] | 13:07 |
shmohamud | [3, 74] | 13:07 |
shmohamud | She's printing this ^^ | 13:07 |
shmohamud | it's missing one answer, [3, 74, 15] | 13:08 |
scooper | the first line is correct | 13:08 |
scooper | second is correct too | 13:09 |
shmohamud | yup | 13:09 |
scooper | the last is not correct | 13:09 |
shmohamud | are you sure scooper? I ran it on my machine and it gave me the correct output.. | 13:09 |
scooper | yes | 13:10 |
scooper | 3:5 | 13:10 |
scooper | to get 3 and 74 she need to use this 3:5 | 13:10 |
shmohamud | can she use a negative index? | 13:11 |
shmohamud | you're correct, 3:5 works, but as often is the case in programming, there is more than one way to do it! | 13:11 |
scooper | yes | 13:11 |
scooper | negative will start checking from the last value | 13:11 |
shmohamud | yes | 13:12 |
scooper | but it's advisable to use mix value | 13:12 |
scooper | it might complicate thing something.... | 13:12 |
shmohamud | I think you're right, it's advisable to avoid negative indices because it's less readable. Readability is important. However, it still works and answers the original question. | 13:13 |
fkoikoi | so I should use this instead | 13:14 |
fkoikoi | test_list = [9,41,12,3,74,15] | 13:14 |
fkoikoi | print(test_list[0:2]) | 13:14 |
fkoikoi | test_list = [9,41,12,3,74,15] | 13:14 |
fkoikoi | print(test_list[0:3]) | 13:14 |
fkoikoi | test_list = [9,41,12,3,74,15] | 13:14 |
fkoikoi | print(test_list[3:-1]) | 13:14 |
fkoikoi | test_list = [9,41,12,3,74,15] | 13:14 |
fkoikoi | print(test_list[3:6]) | 13:14 |
shmohamud | great job fkoikoi, A+ on the homework | 13:15 |
shmohamud | Ok scooper, ready to teach us about list methods? | 13:16 |
scooper | yes Programmer | 13:16 |
scooper | superheroes = ["thor", "batman", ["superman", "wonder woman"], ["spider man", "haulk"]] | 13:16 |
scooper | print(superheroes[3][0]) | 13:16 |
scooper | new_list = list(range(4)) | 13:16 |
scooper | print(list) | 13:16 |
scooper | value = ["Spencer","Freena","Shmohamud","Jeff"] | 13:16 |
scooper | newvalue = len(value) | 13:16 |
scooper | print(newvalue) | 13:16 |
scooper | value = ["Spencer", "Freena", "Shmohamud","Jeff"] | 13:16 |
scooper | newvalue = len(value) | 13:16 |
jelkner | That made my day, as soon I login, I see A+ on homework! ;-) | 13:16 |
scooper | #print(type(newvalue)) | 13:16 |
scooper | print(type(len(value))) | 13:16 |
scooper | list_a = [1,2,3] | 13:16 |
scooper | list_b = [4,5,6] | 13:16 |
scooper | list_a.extend(list_b) | 13:16 |
scooper | print(newlist) | 13:16 |
scooper | list_a = [1,2,3] | 13:16 |
scooper | list_b = [4,5,6] | 13:16 |
scooper | list_a.extend(list_b) | 13:16 |
scooper | print(list_a) | 13:16 |
scooper | list_a = [1,2,3,4] | 13:17 |
scooper | list_b = [4,5,6,7] | 13:17 |
scooper | #joinit = list_a + list_b | 13:17 |
*** fkoikoi has quit (Remote host closed the connection) | 13:17 | |
scooper | #print(joinit) | 13:17 |
scooper | print(f"{list_a} + {list_b}") | 13:17 |
scooper | test_list = [9,41,12,3,74,15] | 13:17 |
scooper | print(test_list[4:]) | 13:17 |
scooper | fruit = ["apple", "banana","cherry"] | 13:17 |
scooper | fruit.insert(2, "orange") | 13:17 |
scooper | print(fruit) | 13:17 |
scooper | fruit.reverse() | 13:17 |
scooper | print(fruit) | 13:17 |
scooper | fruit.sort() | 13:17 |
scooper | print(fruit) | 13:17 |
scooper | append() Adds an element at the end of the list | 13:17 |
scooper | clear() Removes all the elements from the list | 13:17 |
scooper | copy() Returns a copy of the list | 13:17 |
scooper | count() Returns the number of elements with the specified value | 13:17 |
scooper | extend() Add the elements of a list ( or any iteration), to the end of the current | 13:17 |
scooper | arrangingNumber = [0,9,8,7,11,13,15,14,12,19,16,20,6,5,4,3,2,1,3,3,4,4,5,5,5,5,5] | 13:17 |
scooper | print(arrangingNumber,"\n") | 13:17 |
scooper | arrangingNumber.sort() | 13:17 |
scooper | print(arrangingNumber, "\n") | 13:17 |
scooper | arrangingNumber.reverse() | 13:17 |
scooper | print(arrangingNumber, "\n") | 13:17 |
scooper | print(arrangingNumber.count(5)) | 13:17 |
scooper | #Describe how you would develop object-oriented features of Java for the Quiz program developed in the Programming Assignments. In particular, describe how the program could use each of the following: class variables, instance variables, inheritance, polymorphism, abstract classes, "this", "super", interfaces, and event listeners. | 13:17 |
scooper | I m sorry | 13:18 |
scooper | arrangingNumber = [0,9,8,7,11,13,15,14,12,19,16,20,6,5,4,3,2,1,3,3,4,4,5,5,5,5,5] | 13:18 |
scooper | print(arrangingNumber,"\n") | 13:18 |
scooper | arrangingNumber.sort() | 13:18 |
scooper | print(arrangingNumber, "\n") | 13:18 |
scooper | arrangingNumber.reverse() | 13:18 |
scooper | print(arrangingNumber, "\n") | 13:18 |
scooper | print(arrangingNumber.count(5)) | 13:18 |
scooper | I m presenting a three of list method in Python today | 13:18 |
scooper | I m presenting on three of list method in Python today | 13:18 |
scooper | which include: reverse, count and sort | 13:18 |
scooper | I you still there shmohamud?? | 13:18 |
shmohamud | Yes | 13:19 |
shmohamud | that was a lot of text! Let'd dive in | 13:19 |
scooper | Firstly I will begin with the challenging one I was face with: count | 13:19 |
scooper | count is a Python method that is use to check the amount of repeating item in a list | 13:20 |
shmohamud | fkoikoi be sure to pay attention | 13:20 |
scooper | example: "a","b", "c", "a", "a", "a", "a" | 13:21 |
fkoikoi | okay | 13:21 |
shmohamud | scooper is that a list or are they floating strings? | 13:22 |
scooper | that is not a list | 13:22 |
scooper | just illustrating something | 13:22 |
shmohamud | Ah, ok | 13:22 |
scooper | but I m bring a list in soon | 13:22 |
shmohamud | +1 | 13:23 |
scooper | if I use the python list method like this numberofletter = ["a","a","a","c", "d","e"] numberofletter.count("a") print(numberofletter) | 13:24 |
scooper | this example will print an integer value of 3.... | 13:24 |
scooper | telling the end user that the letter a appear three time in a program | 13:24 |
shmohamud | would that print integer value or the original list? | 13:24 |
scooper | integer value | 13:25 |
shmohamud | print(numberofletter.count("a")) | 13:25 |
shmohamud | is that what you implied in the code above? | 13:25 |
tmickelson | hello fkoikoi, scooper, and shmohamud | 13:26 |
shmohamud | morning tmickelson | 13:26 |
shmohamud | scooper please continue, I will let you finish before nitpicking at the details :) | 13:26 |
fkoikoi | hi tmickelson | 13:26 |
scooper | letter = ["a","a", "a","b", "c", "d"] | 13:28 |
scooper | print(letter.count("a")) | 13:28 |
scooper | if you this code on you computer you will get an integer value of three | 13:28 |
scooper | *run | 13:28 |
shmohamud | got it, looks great. You're doing great please continue | 13:28 |
scooper | next is reverse in Python | 13:28 |
scooper | reverse is a list method in python that print out information reverse/backward position | 13:29 |
scooper | example will | 13:30 |
scooper | reversingLetter = ["a","b","c","d","e","f","g","h"] | 13:31 |
scooper | reversingLetter.reverse() | 13:31 |
scooper | print(reversingLetter) | 13:31 |
scooper | reverse method will change the arrangement of this variable called reversingLetter | 13:32 |
scooper | instead of it being a,b,c,d... during the final output it will display ['h', 'g', 'f', 'e', 'd', 'c', 'b', 'a'] | 13:33 |
shmohamud | looks great! | 13:33 |
shmohamud | well done, scooper. Are you going to demo insert as well? | 13:33 |
scooper | No problem I will give it a try | 13:33 |
scooper | next is sort | 13:34 |
shmohamud | fkoikoi please ask any questions you have, too. I'm going to be right back, 2 minutes, restroom break. | 13:34 |
fkoikoi | +1 | 13:34 |
*** shmohamud has quit (Remote host closed the connection) | 13:38 | |
shmohamud | back | 13:38 |
shmohamud | Ok, ready when you are scooper | 13:39 |
scooper | I m waiting for fkoikor question before I proceed | 13:39 |
shmohamud | fkoikoi - any questions? | 13:39 |
fkoikoi | I don't have any questions for now | 13:39 |
scooper | ok | 13:40 |
scooper | next is sort | 13:40 |
scooper | sort in python is a list method arrange items that are in a list in order | 13:41 |
scooper | that order could be alphebetically or numerical order | 13:41 |
scooper | example will be | 13:41 |
scooper | arrangingNumber = [0,9,8,7,11,13,15,14,12,19,16,20,6,5,4,3,2,1,3,3,4,4,5,5,5,5,5] | 13:43 |
scooper | arrangingNumber.sort() | 13:43 |
scooper | print(arrangingNumber) | 13:43 |
scooper | looking at this variable called arrangingNumber it has value starting with o and end with 5 | 13:43 |
*** fkoikoi has quit (Remote host closed the connection) | 13:44 | |
scooper | When the sort method is apply to this variable the finally output will change by arranging itself in order beginning with the lower number to the highest number | 13:45 |
scooper | Before I climax | 13:45 |
scooper | let us take to consideration two method in python | 13:46 |
scooper | len and count | 13:46 |
scooper | They are almost serve the same purpose but I absolutely different | 13:47 |
scooper | They almost serve the same purpose but I absolutely different | 13:47 |
fkoikoi | scooper | 13:48 |
scooper | +1 | 13:48 |
fkoikoi | what is the function of the letter "n"? | 13:48 |
scooper | anytime you see a value with a opening and closing quote it is a string | 13:49 |
scooper | before I ask | 13:50 |
scooper | where did you find the letter "n" from in the program?? | 13:50 |
fkoikoi | in the print statement | 13:50 |
scooper | can you please paste it here | 13:51 |
fkoikoi | print(arrangingNumber, "\n") | 13:51 |
scooper | oh | 13:51 |
scooper | the "\n" represent a new line in python | 13:52 |
scooper | I m telling my program to print each output on a new line to give the user space so that they can read clearly | 13:53 |
scooper | is that understood?? | 13:53 |
jelkner | URL for the book: https://openbookproject.net/books/bpp4awd/ | 13:53 |
scooper | Thanks Jeff | 13:53 |
jelkner | Git repo: https://codeberg.org/OpenBookProject/bpp4awd | 13:54 |
scooper | any question before I climax??? | 13:54 |
fkoikoi | thanks spencer | 13:54 |
shmohamud | no questions, so far so good. | 13:54 |
scooper | next is insert | 13:54 |
jelkner | Bell rings, jelkner signs off for now... | 13:59 |
scooper | arrangingLetter = ["Spencer","Jeff","Freena"] | 13:59 |
scooper | print(arrangingLetter) | 13:59 |
scooper | arrangingLetter.insert(1, "Shmohamud") | 13:59 |
scooper | print(arrangingLetter) | 13:59 |
*** jelkner has quit (Quit: Leaving) | 13:59 | |
scooper | ok Jeff | 13:59 |
scooper | insert is a list method in python | 13:59 |
scooper | that is use to inject an item in a list base on it index position | 14:00 |
scooper | So if you run the program I just paste in here | 14:01 |
scooper | it a first output it will print: Spencer, Jeff and Freena | 14:01 |
scooper | during the second run after the method insert has been invoke on the variable: arrangingLetter the index position of Jeff which is one | 14:02 |
*** tmickelson has quit (Read error: Connection reset by peer) | 14:02 | |
*** fkoikoi has quit (Remote host closed the connection) | 14:03 | |
scooper | will be replace with Shmohamud during the second output and the program will display: Spencer,Shmohamud, Jeff and Freena | 14:03 |
scooper | why this happen is because | 14:03 |
scooper | is because Jeff index position in the previous list was one | 14:04 |
scooper | any question | 14:04 |
shmohamud | awesome explanation so far. | 14:05 |
shmohamud | no questions from me | 14:05 |
scooper | If no question for me I have a question here shmohamud | 14:06 |
shmohamud | yes | 14:06 |
scooper | we use index number with insert to add another item to our list right?? | 14:07 |
shmohamud | yes, just as you explained it replaces whatever was at that index and pushes the original back one | 14:08 |
scooper | If so why insert do accept more them one argument as an index number and value | 14:09 |
scooper | example | 14:09 |
scooper | arrangingLetter = ["Spencer","Jeff","Freena"] | 14:09 |
scooper | print(arrangingLetter) | 14:09 |
scooper | arrangingLetter.insert(1,2, "Shmohamud", "Cooper") | 14:09 |
scooper | print(arrangingLetter) | 14:09 |
shmohamud | this error gets thrown when I try that: TypeError: insert expected 2 arguments, got 4 | 14:11 |
scooper | That is what I m talking about?? | 14:12 |
shmohamud | insert accepts two arguments, the first is the position to insert, the second is the element | 14:12 |
scooper | that mean insert don't support two argument and two element at once right??? | 14:13 |
shmohamud | exactly | 14:13 |
shmohamud | it only accepts two arguments, position and element | 14:13 |
shmohamud | ok guys, I think we've had a good session today. Any questions before we give homework and call it a day? | 14:14 |
scooper | Thanks I was making mistakes on purpose to some future problem just in case I encounter this in the near future | 14:14 |
shmohamud | +1 | 14:15 |
fkoikoi | thanks scooper for such a brilliant presentation | 14:18 |
shmohamud | ok, if there are no questions, the homework is the create a python dictionary with 3 key-value pairs. Then, write a for loop that prints out all the values in the dict. | 14:18 |
fkoikoi | is it for me or spencer? | 14:19 |
shmohamud | for both of you. fkoikoi, you can use the internet to research dicts, right? | 14:19 |
fkoikoi | +1 | 14:19 |
shmohamud | Good. Both of you should do the same assignment, but I expect different dicts from each of you. Feel free to collaborate | 14:20 |
shmohamud | Any questions before we log off for the day? | 14:20 |
fkoikoi | I don't have any question | 14:21 |
shmohamud | scooper: ? | 14:22 |
scooper | I m coming | 14:22 |
scooper | When List is important in program??? | 14:22 |
shmohamud | it's important all the time. Imagine you're working on a web application. The user has a list of tweets ["tweet1", "tweet2", "tweet3", "tweet4"] | 14:23 |
shmohamud | we would loop through the list of tweets and display them in order on the homepage | 14:23 |
shmohamud | Or if we're doing data science and we're given a list of grades. How do we find the average? We loop through the list adding together all the grades and divide by the length of the list. | 14:24 |
shmohamud | The two most common data structures in programming are lists and dicts. You will make a request to a database, and then you'll get back a data structure shaped like a list [] or a dict {} almost every time | 14:25 |
shmohamud | does that make sense? | 14:25 |
scooper | getting it gradually | 14:25 |
shmohamud | Do you use Google Chrome scooper? | 14:26 |
shmohamud | For internet browsing | 14:26 |
scooper | +1 | 14:26 |
shmohamud | Do you know how to access developer tools? | 14:26 |
scooper | both firebox and Chrome on a regulars basis | 14:26 |
scooper | +1 | 14:26 |
shmohamud | Can you open developer tools, then click the "Network" tab? | 14:26 |
scooper | ok | 14:27 |
shmohamud | Is network tab open? | 14:27 |
scooper | I m there | 14:28 |
shmohamud | Do you see where it says "Fetch/XHR"? | 14:28 |
*** fkoikoi has quit (Remote host closed the connection) | 14:28 | |
shmohamud | under filters | 14:28 |
scooper | +1 | 14:28 |
shmohamud | click on that | 14:28 |
shmohamud | this is all the requests to servers that your machine is making while you browse the internet | 14:29 |
scooper | I just did | 14:29 |
shmohamud | Can you go to Facebook or Twitter? | 14:29 |
scooper | ok | 14:29 |
shmohamud | Do you see any Fetch/XHR Requests in the list? | 14:29 |
scooper | I m seeing | 14:29 |
shmohamud | Now, click on one of them | 14:30 |
scooper | 20ms, 40ms, 60ms, 80ms 10ms | 14:30 |
scooper | 100ms | 14:30 |
shmohamud | Ok, now click on one. Do you see the preview tab? | 14:30 |
scooper | You mean Fetch/XHR | 14:32 |
*** fkoikoi has quit (Remote host closed the connection) | 14:32 | |
shmohamud | Yes | 14:32 |
scooper | If I click | 14:33 |
scooper | 20ms | 14:33 |
scooper | it didn't change | 14:33 |
scooper | but rather remind the same | 14:33 |
shmohamud | do you see the preview tab? | 14:34 |
scooper | But after Fetch/XHR I m seeing: JS, CSSS IMAGE MEDIA, ETC | 14:34 |
shmohamud | that's ok | 14:34 |
shmohamud | I want to show you the data structures that are being sent to your machine. However, you have to click "Preview" or "Response" to see the details. Do you see "Preview" or "Response" tabs? | 14:35 |
shmohamud | fkoikoi, if possible please open Google Developer Tools as well. And try to find the "Preview" tab to see the Lists and Dicts that are being sent to your machine. | 14:36 |
scooper | In the Network session | 14:36 |
scooper | no | 14:36 |
shmohamud | Fkoikoi - go to the "Network" tab first and then click "Fetch/XHR" | 14:37 |
shmohamud | scooper, can you try reloading the page you're using devtools on? | 14:37 |
scooper | Shmohamud | 14:38 |
shmohamud | do you see a list or requests under the "name" section? | 14:38 |
shmohamud | list of requests* | 14:38 |
scooper | I m being called by supe can we cut it a day today | 14:38 |
shmohamud | Yes, we can. | 14:39 |
scooper | please | 14:39 |
shmohamud | Explore devtools for homework too :) see you tomorrow | 14:39 |
*** fkoikoi has quit (Remote host closed the connection) | 14:39 | |
fkoikoi | Spencer went to the sup office | 14:41 |
*** fkoikoi has quit (Remote host closed the connection) | 14:41 | |
*** scooper has quit (Remote host closed the connection) | 14:42 | |
*** shmohamud has quit (Remote host closed the connection) | 14:43 | |
*** fkoikoi_ has quit (None) | 14:44 | |
*** fkoikoi has quit (None) | 14:44 | |
*** sysadmin has quit (Ping timeout: 480 seconds) | 15:02 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 15:05 | |
*** sysadmin_ has quit (Quit: Leaving) | 15:16 | |
*** shmohamud has quit (Remote host closed the connection) | 16:13 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!