shmohamud | good day fkoikoi | 13:00 |
---|---|---|
*** fkoikoi has quit (Ping timeout: 480 seconds) | 13:04 | |
fkoikoi_ | Good morning shmohamud | 13:05 |
shmohamud | how're you? | 13:05 |
fkoikoi_ | I'm fine and you | 13:05 |
shmohamud | Much better, felling good | 13:06 |
shmohamud | Is scooper joining us today? | 13:06 |
fkoikoi_ | yes | 13:07 |
fkoikoi_ | he will soon be with us | 13:07 |
shmohamud | ok, to start, can you write me a dict with the keys being names and the values being favorite colors? | 13:08 |
shmohamud | Just three key-value pairs | 13:08 |
fkoikoi_ | okay | 13:09 |
shmohamud | good day scoope | 13:12 |
shmohamud | scooper* | 13:12 |
scooper | Good morning shmohamud | 13:13 |
shmohamud | can you write me a tuple of comrade names, four of them? | 13:13 |
fkoikoi_ | Favorite_colors =[('Bill', 'Blue'), ('Charles', 'red'), ('soleh', 'pink')] | 13:14 |
fkoikoi_ | print(Favorite_colors) | 13:14 |
scooper | no shmohamud | 13:14 |
scooper | unfortunately I did read and practice on tuple due to my exam | 13:14 |
shmohamud | fkoi, is that a dict or is it a list of typles? | 13:15 |
scooper | But I m done with the exam now..... I promise to deliver by tomorrow | 13:15 |
shmohamud | That's fine scooper, we'll go through together | 13:15 |
scooper | ok | 13:15 |
shmohamud | scooper, can you write us a dict with the keys being names and the values being favorite colors? | 13:15 |
scooper | yes | 13:15 |
shmohamud | fkoikoi let's pay attention here, good attempt but keep in mind I was looking for a dict, a very particular data structure | 13:16 |
scooper | dict_colors = {"Spencer": "White", "Shmohamud":"Red", "Freena":"Green"} | 13:19 |
scooper | print(dict_colors) | 13:19 |
fkoikoi_ | Favorite_colors ={"Bill": "Blue", "Charles": "red", "soleh": "pink"} | 13:19 |
fkoikoi_ | print(Favorite_colors) | 13:19 |
shmohamud | great job, both of you. | 13:19 |
shmohamud | when you start with brackets - [ ] - that means it's a List type | 13:20 |
shmohamud | when starting with - { } - that means it's a Dict type | 13:20 |
shmohamud | Spencer, can you explain one difference between List and Dicts? | 13:21 |
scooper | yes | 13:21 |
scooper | Dictionary use keys and value | 13:21 |
scooper | why list use index number | 13:21 |
shmohamud | yes | 13:22 |
scooper | dictionary are always declare by curly bracket | 13:22 |
scooper | why list are declare by parenthesis | 13:22 |
shmohamud | Yep, again. | 13:22 |
shmohamud | List are declared with "brackets" | 13:22 |
scooper | sorry | 13:22 |
scooper | bracket | 13:22 |
scooper | or | 13:22 |
shmohamud | dicts are by curly "braces" | 13:22 |
scooper | you can use the in built function to declare dictionary or list by doing this | 13:23 |
shmohamud | can you give an example scooper, before we move to tuples? | 13:24 |
shmohamud | an example of using built-in function to declare a list scooper | 13:26 |
fkoikoi_ | shmohamud | 13:26 |
jelkner | Hello fkoikoi_ scooper and shmohamud | 13:26 |
shmohamud | Hi Jeff :) | 13:26 |
fkoikoi_ | spencer is facing problem with the internet. it just went off and I am using my phone | 13:27 |
jelkner | shmohamud, when are you leaving for Staunton? | 13:27 |
fkoikoi_ | Good Morning Jeff | 13:27 |
jelkner | thanks fkoikoi_ | 13:27 |
shmohamud | Jelkner, I'm leaving Friday | 13:27 |
shmohamud | Ok fkoikoi, will scooper be back soon? | 13:28 |
jelkner | any chance you could join us here at ACC on Thursday from 6:30 to 7:30 pm? | 13:28 |
shmohamud | I can, yes | 13:28 |
jelkner | Great! | 13:28 |
jelkner | We are having a NOVA Web Development "Summer Sprint" planning meeting | 13:28 |
jelkner | Adrian will be here | 13:28 |
fkoikoi_ | I can't really tell but he is working on it | 13:28 |
jelkner | as will the 5 July PRIME interns | 13:29 |
shmohamud | Sounds good | 13:29 |
jelkner | I'm working on a new blog post now | 13:29 |
jelkner | that will contain a look back and look ahead | 13:29 |
shmohamud | about Nova Web Dev? | 13:30 |
jelkner | +1 | 13:30 |
shmohamud | cool, looking forward to giving it a read. Feel free to send it over for proofreading too | 13:30 |
jelkner | but it will include the role of the MCSS project and Social Justice Computing | 13:31 |
jelkner | +1 | 13:31 |
shmohamud | +1 | 13:31 |
jelkner | I'll ask you to look it over before Thursday | 13:31 |
jelkner | thanks, my friend! | 13:31 |
shmohamud | you're welcome :) | 13:31 |
*** scooper has quit (Ping timeout: 480 seconds) | 13:31 | |
shmohamud | Spencer, is that you? | 13:31 |
sysadmin | yes | 13:32 |
shmohamud | welcome back | 13:32 |
scooper | thanks | 13:32 |
shmohamud | so, can you use a built-in function to declare a list for us, before we move on to Tuples? | 13:32 |
scooper | yes | 13:32 |
shmohamud | let's see it | 13:33 |
scooper | shmohamud_record = list [1,2,3,4,5,6] | 13:37 |
scooper | print(shmohamud_record) | 13:37 |
scooper | is this what you are talking about???? | 13:37 |
shmohamud | close, I was looking for you to use the "list" built-in function which you did use, however it's supposed to be in double parentheses | 13:38 |
shmohamud | like this: shmohamud_record = list((1, 2, 3)) | 13:38 |
scooper | shmohamud_record = list((1,2,3,4,5,6)) | 13:39 |
scooper | print(shmohamud_record) | 13:39 |
scooper | you are right | 13:39 |
scooper | I forget and use single parenthesis | 13:39 |
shmohamud | exactly, good job. | 13:39 |
scooper | due to that I got syntax error | 13:39 |
shmohamud | Ah, yup, good to know the different types of errors. Syntax is an important one, tells you the interpreter doesn't understand | 13:40 |
shmohamud | Ok, so, let's begin with Tuples | 13:40 |
shmohamud | Tuples are like Lists | 13:41 |
shmohamud | Tuples are another kind of sequence that functions much like a list - they have elements which are indexed starting at 0 | 13:42 |
shmohamud | An example of a tuple is: x = ("Glenn", "Sally", "Joseph") | 13:42 |
shmohamud | what would print x[2] return - any thoughts? | 13:42 |
scooper | yes | 13:43 |
shmohamud | let's hear it | 13:43 |
scooper | "Joseph" | 13:43 |
shmohamud | exactly | 13:43 |
shmohamud | just like Lists, tuples are 0-indexed | 13:43 |
shmohamud | y = (1, 9, 2) | 13:44 |
shmohamud | do either of you know a built-in function to print the max in the tuple? | 13:44 |
scooper | from my end no | 13:44 |
fkoikoi_ | -1 | 13:45 |
scooper | let me try | 13:45 |
scooper | I think we will use the in built function | 13:45 |
scooper | max | 13:45 |
shmohamud | it's a built-in function. | 13:45 |
shmohamud | Yes! That's the on | 13:45 |
shmohamud | great job. So, can you write a line of code that prints the max of the tuple y? | 13:45 |
scooper | let me try | 13:46 |
scooper | y = (1,9,2) | 13:47 |
scooper | print(max(y)) | 13:47 |
shmohamud | exactly! Scooper, you're one fire today. | 13:47 |
shmohamud | on fire* | 13:47 |
scooper | thanks programmer | 13:47 |
shmohamud | fkoikoi, can you loop through and print each element in the typle? | 13:47 |
shmohamud | it's very similar to looping through a list | 13:47 |
fkoikoi_ | let me try | 13:48 |
shmohamud | ok, scooper please think about it and help if she gets stuck | 13:48 |
scooper | y = (1,9,2) | 13:48 |
scooper | for value in y: | 13:48 |
scooper | print(value) | 13:48 |
shmohamud | scooper, I said *if she gets stuck*! | 13:48 |
scooper | OOH | 13:48 |
shmohamud | This was a learning momemnt! | 13:49 |
scooper | I m sorry | 13:49 |
shmohamud | Lol, it's all good. | 13:49 |
shmohamud | Fkoikoi is that the direction you were going? | 13:49 |
fkoikoi_ | yes | 13:50 |
shmohamud | ok, good | 13:50 |
fkoikoi_ | y = (1,9,2) | 13:50 |
fkoikoi_ | for x in y: | 13:50 |
fkoikoi_ | print(max(y)) | 13:50 |
shmohamud | that would print 9 every time. Can you modify your answer so it prints every element in the tuple? | 13:51 |
fkoikoi_ | yes | 13:51 |
fkoikoi_ | sorry | 13:51 |
shmohamud | you're fine, this is good, it means we're learning! :D | 13:51 |
fkoikoi_ | that was the first exercise i did when i was trying to answer the question | 13:52 |
fkoikoi_ | y = (1,9,2) | 13:52 |
fkoikoi_ | for x in y: | 13:52 |
fkoikoi_ | print(value) | 13:52 |
shmohamud | scooper, do you see any issue with that code snippet? | 13:52 |
scooper | yes | 13:52 |
shmohamud | please help us | 13:52 |
scooper | where is the iteration variable??? freena | 13:52 |
fkoikoi_ | y = (1,9,2) | 13:53 |
fkoikoi_ | for x in y: | 13:53 |
fkoikoi_ | print(x) | 13:53 |
scooper | thanks | 13:53 |
shmohamud | there we go, beautiful | 13:53 |
shmohamud | next challenge, can someone change the first value in y to be 13 instead? | 13:53 |
jelkner | i can see shmohamud has this situation well in hand, so i'll log off now | 13:54 |
jelkner | check back tomorrow... | 13:54 |
jelkner | ACTION logs off | 13:54 |
*** jelkner has quit (Quit: Leaving) | 13:54 | |
scooper | Should I?? or I should wait | 13:54 |
fkoikoi_ | you mean this | 13:54 |
shmohamud | please try and let me know if there's any errors along the way | 13:54 |
fkoikoi_ | y = (13,9,2) | 13:55 |
fkoikoi_ | print(y) | 13:55 |
shmohamud | Close freena, I was hoping you do it programmatically, not by creating a new tuple | 13:55 |
scooper | The question mean you should iterate fkoikoi | 13:55 |
fkoikoi_ | okay | 13:55 |
shmohamud | no no, no need to iterate. I was wondering if you could mutate the tuple the same way we mutate lists? | 13:55 |
scooper | ooh | 13:56 |
shmohamud | any errors? | 13:59 |
sysadmin_ | sorry my user name refuse to change | 14:00 |
shmohamud | lol all good | 14:00 |
sysadmin_ | So I m in as sysadmin | 14:00 |
shmohamud | Ok programmer | 14:01 |
sysadmin_ | hahaha | 14:01 |
sysadmin_ | one day I will accept by name | 14:01 |
shmohamud | hahaha | 14:01 |
sysadmin_ | when I growth fully in this journey | 14:01 |
sysadmin_ | *that name | 14:01 |
shmohamud | you're already programming right? You earned the name | 14:01 |
shmohamud | Programmer | 14:01 |
sysadmin_ | yes Shmohamud | 14:01 |
shmohamud | any updates on mutating the tuple? | 14:02 |
sysadmin_ | you mean changing the index change right?? | 14:04 |
shmohamud | right, the same way we mutate lists by using the index | 14:04 |
sysadmin_ | let me give it a try | 14:04 |
shmohamud | fkoikoi_ any updates? | 14:05 |
shmohamud | After this I have to log off for the day. I have an interview in less than an hour. | 14:05 |
*** scooper has quit (Ping timeout: 480 seconds) | 14:05 | |
shmohamud | new question: what happens if we do y[2] = 21? | 14:07 |
fkoikoi_ | I am receiving error message | 14:08 |
shmohamud | That's what I was expecting. What does it say? | 14:08 |
sysadmin_ | y = tuple((13,9,2)) | 14:09 |
sysadmin_ | y [0] = 14 | 14:09 |
sysadmin_ | print(y) | 14:09 |
sysadmin_ | syntax error | 14:09 |
fkoikoi_ | TypeError: 'tuple' object does not support item assignment | 14:09 |
sysadmin_ | tuple don't support object assignment | 14:10 |
shmohamud | exactly. Tuples are immutable! Once you create it, it's like a String, you can't mutate it | 14:10 |
shmohamud | Strings and Tuples are both immutable | 14:10 |
shmohamud | Alright guys, any questions before we call it a day? | 14:10 |
sysadmin_ | yes | 14:10 |
shmohamud | no? | 14:11 |
sysadmin_ | I m coming shmohamud | 14:11 |
sysadmin_ | with a question | 14:11 |
shmohamud | ok | 14:12 |
shmohamud | im going to use the restroom, will be right back | 14:12 |
sysadmin_ | ok | 14:12 |
sysadmin_ | It's ok for now no need to ask the question I want to ask... I just experiment what I wanted to know but it's still saying the same thing.... tuple does'nt support item assignment | 14:15 |
shmohamud | ok, sounds good | 14:15 |
shmohamud | any last questions before I log off? | 14:15 |
shmohamud | alright well great job today guys | 14:16 |
shmohamud | See you tomorrow | 14:16 |
fkoikoi_ | no | 14:16 |
sysadmin_ | Thanks shmohamud | 14:16 |
shmohamud | you're welcome scooper | 14:17 |
shmohamud | you guys are doing great, keep working hard and we'll reach our goal soon. | 14:17 |
sysadmin_ | freena | 14:17 |
fkoikoi_ | thanks shmohamud | 14:17 |
fkoikoi_ | yes | 14:17 |
shmohamud | see you tomorrow | 14:17 |
*** shmohamud has quit (Remote host closed the connection) | 14:17 | |
sysadmin_ | respond to my private message | 14:18 |
*** sysadmin_ has quit (Quit: Leaving) | 14:21 | |
*** fkoikoi_ has quit (Quit: Leaving) | 14:21 | |
*** shmohamud has quit (Remote host closed the connection) | 14:26 | |
*** shmohamud has quit (Remote host closed the connection) | 14:28 | |
*** shmohamud has quit (Remote host closed the connection) | 14:48 | |
*** shmohamud has quit (Remote host closed the connection) | 14:53 | |
*** shmohamud has quit (Remote host closed the connection) | 15:34 | |
*** shmohamud has quit (Remote host closed the connection) | 16:40 | |
*** shmohamud has quit (Read error: Connection reset by peer) | 16:49 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 17:05 | |
*** shmohamud has quit (Remote host closed the connection) | 17:10 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 17:19 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 17:32 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 17:53 | |
*** shmohamud has quit (Remote host closed the connection) | 18:03 | |
*** shmohamud has quit (Remote host closed the connection) | 18:08 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 18:18 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 19:21 | |
*** shmohamud has quit (Remote host closed the connection) | 20:48 | |
*** shmohamud has quit (Remote host closed the connection) | 21:15 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 21:35 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 22:31 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 23:02 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!