IRC log of #novawebdev for Monday, 2023-06-05

shmohamudgood day fkoikoi13:00
*** fkoikoi has quit (Ping timeout: 480 seconds)13:04
fkoikoi_Good morning shmohamud13:05
shmohamudhow're you?13:05
fkoikoi_I'm fine and you13:05
shmohamudMuch better, felling good13:06
shmohamudIs scooper joining us today?13:06
fkoikoi_yes 13:07
fkoikoi_he will soon be with us13:07
shmohamudok, to start, can you write me a dict with the keys being names and the values being favorite colors?13:08
shmohamudJust three key-value pairs13:08
fkoikoi_okay13:09
shmohamudgood day scoope13:12
shmohamudscooper*13:12
scooperGood morning shmohamud13:13
shmohamudcan 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
scooperno shmohamud13:14
scooperunfortunately I did read and practice on tuple due to my exam13:14
shmohamudfkoi, is that a dict or is it a list of typles?13:15
scooperBut I m done with the exam now..... I promise to deliver by tomorrow13:15
shmohamudThat's fine scooper, we'll go through together13:15
scooperok13:15
shmohamudscooper, can you write us a dict with the keys being names and the values being favorite colors?13:15
scooperyes13:15
shmohamudfkoikoi let's pay attention here, good attempt but keep in mind I was looking for a dict, a very particular data structure13:16
scooperdict_colors = {"Spencer": "White", "Shmohamud":"Red", "Freena":"Green"}13:19
scooperprint(dict_colors)13:19
fkoikoi_Favorite_colors ={"Bill": "Blue", "Charles": "red", "soleh": "pink"}13:19
fkoikoi_print(Favorite_colors)13:19
shmohamudgreat job, both of you. 13:19
shmohamudwhen you start with brackets - [ ] - that means it's a List type13:20
shmohamudwhen starting with - { } - that means it's a Dict type13:20
shmohamudSpencer, can you explain one difference between List and Dicts?13:21
scooperyes13:21
scooperDictionary use keys and value13:21
scooperwhy list use index number13:21
shmohamudyes13:22
scooperdictionary are always declare by curly bracket13:22
scooperwhy list are declare by parenthesis13:22
shmohamudYep, again.13:22
shmohamudList are declared with "brackets"13:22
scoopersorry13:22
scooperbracket13:22
scooperor13:22
shmohamuddicts are by curly "braces"13:22
scooperyou can use the in built function to declare dictionary or list by doing this13:23
shmohamudcan you give an example scooper, before we move to tuples?13:24
shmohamudan example of using built-in function to declare a list scooper13:26
fkoikoi_shmohamud 13:26
jelknerHello fkoikoi_ scooper and shmohamud 13:26
shmohamudHi Jeff :)13:26
fkoikoi_spencer is facing problem with the internet. it just went off and I am using my phone13:27
jelknershmohamud, when are you leaving for Staunton?13:27
fkoikoi_Good Morning Jeff13:27
jelknerthanks fkoikoi_ 13:27
shmohamudJelkner, I'm leaving Friday13:27
shmohamudOk fkoikoi, will scooper be back soon?13:28
jelknerany chance you could join us here at ACC on Thursday from 6:30 to 7:30 pm?13:28
shmohamudI can, yes13:28
jelknerGreat!13:28
jelknerWe are having a NOVA Web Development "Summer Sprint" planning meeting13:28
jelknerAdrian will be here13:28
fkoikoi_I can't really tell but he is working on it13:28
jelkneras will the 5 July PRIME interns13:29
shmohamudSounds good13:29
jelknerI'm working on a new blog post now13:29
jelknerthat will contain a look back and look ahead13:29
shmohamudabout Nova Web Dev?13:30
jelkner+113:30
shmohamudcool, looking forward to giving it a read. Feel free to send it over for proofreading too13:30
jelknerbut it will include the role of the MCSS project and Social Justice Computing13:31
jelkner+113:31
shmohamud+113:31
jelknerI'll ask you to look it over before Thursday13:31
jelknerthanks, my friend!13:31
shmohamudyou're welcome :)13:31
*** scooper has quit (Ping timeout: 480 seconds)13:31
shmohamudSpencer, is that you?13:31
sysadminyes13:32
shmohamudwelcome back13:32
scooperthanks13:32
shmohamudso, can you use a built-in function to declare a list for us, before we move on to Tuples?13:32
scooperyes13:32
shmohamudlet's see it13:33
scoopershmohamud_record = list [1,2,3,4,5,6]13:37
scooperprint(shmohamud_record)13:37
scooperis this what you are talking about????13:37
shmohamudclose, I was looking for you to use the "list" built-in function which you did use, however it's supposed to be in double parentheses13:38
shmohamudlike this: shmohamud_record = list((1, 2, 3))13:38
scoopershmohamud_record = list((1,2,3,4,5,6))13:39
scooperprint(shmohamud_record)13:39
scooperyou are right13:39
scooperI forget and use single parenthesis13:39
shmohamudexactly, good job.13:39
scooperdue to that I got syntax error13:39
shmohamudAh, yup, good to know the different types of errors. Syntax is an important one, tells you the interpreter doesn't understand 13:40
shmohamudOk, so, let's begin with Tuples13:40
shmohamudTuples are like Lists13:41
shmohamudTuples are another kind of sequence that functions much like a list - they have elements which are indexed starting at 013:42
shmohamudAn example of a tuple is: x = ("Glenn", "Sally", "Joseph")13:42
shmohamudwhat would print x[2] return - any thoughts?13:42
scooperyes13:43
shmohamudlet's hear it13:43
scooper"Joseph"13:43
shmohamudexactly13:43
shmohamudjust like Lists, tuples are 0-indexed13:43
shmohamudy = (1, 9, 2)13:44
shmohamuddo either of you know a built-in function to print the max in the tuple?13:44
scooperfrom my end no13:44
fkoikoi_-113:45
scooperlet me try13:45
scooperI think we will use the in built function13:45
scoopermax13:45
shmohamudit's a built-in function.13:45
shmohamudYes! That's the on13:45
shmohamudgreat job. So, can you write a line of code that prints the max of the tuple y?13:45
scooperlet me try13:46
scoopery = (1,9,2)13:47
scooperprint(max(y))13:47
shmohamudexactly! Scooper, you're one fire today.13:47
shmohamudon fire*13:47
scooperthanks programmer13:47
shmohamudfkoikoi, can you loop through and print each element in the typle?13:47
shmohamudit's very similar to looping through a list13:47
fkoikoi_let me try13:48
shmohamudok, scooper please think about it and help if she gets stuck13:48
scoopery = (1,9,2)13:48
scooperfor value in y:13:48
scooper    print(value)13:48
shmohamudscooper, I said *if she gets stuck*!13:48
scooperOOH13:48
shmohamudThis was a learning momemnt!13:49
scooperI m sorry13:49
shmohamudLol, it's all good.13:49
shmohamudFkoikoi is that the direction you were going?13:49
fkoikoi_yes13:50
shmohamudok, good13:50
fkoikoi_y = (1,9,2)13:50
fkoikoi_for x in y:13:50
fkoikoi_    print(max(y))13:50
shmohamudthat 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_sorry13:51
shmohamudyou're fine, this is good, it means we're learning! :D13:51
fkoikoi_that was the first exercise i did when i was trying to answer the question13:52
fkoikoi_y = (1,9,2)13:52
fkoikoi_for x in y:13:52
fkoikoi_    print(value)13:52
shmohamudscooper, do you see any issue with that code snippet?13:52
scooperyes13:52
shmohamudplease help us13:52
scooperwhere is the iteration variable??? freena13:52
fkoikoi_y = (1,9,2)13:53
fkoikoi_for x in y:13:53
fkoikoi_    print(x)13:53
scooperthanks13:53
shmohamudthere we go, beautiful13:53
shmohamudnext challenge, can someone change the first value in y to be 13 instead?13:53
jelkneri can see shmohamud has this situation well in hand, so i'll log off now13:54
jelknercheck back tomorrow...13:54
jelknerACTION logs off13:54
*** jelkner has quit (Quit: Leaving)13:54
scooperShould I?? or I should wait13:54
fkoikoi_you mean this13:54
shmohamudplease try and let me know if there's any errors along the way13:54
fkoikoi_y = (13,9,2)13:55
fkoikoi_print(y)13:55
shmohamudClose freena, I was hoping you do it programmatically, not by creating a new tuple13:55
scooperThe question mean you should iterate fkoikoi13:55
fkoikoi_okay13:55
shmohamudno no, no need to iterate. I was wondering if you could mutate the tuple the same way we mutate lists?13:55
scooperooh13:56
shmohamudany errors?13:59
sysadmin_sorry my user name refuse to change14:00
shmohamudlol all good 14:00
sysadmin_So I m in as sysadmin14:00
shmohamudOk programmer14:01
sysadmin_hahaha14:01
sysadmin_one day I will accept by name14:01
shmohamudhahaha14:01
sysadmin_when I growth fully in this journey14:01
sysadmin_*that name14:01
shmohamudyou're already programming right? You earned the name14:01
shmohamudProgrammer14:01
sysadmin_yes Shmohamud14:01
shmohamudany updates on mutating the tuple?14:02
sysadmin_you mean changing the index change right??14:04
shmohamudright, the same way we mutate lists by using the index14:04
sysadmin_let me give it a try14:04
shmohamudfkoikoi_ any updates?14:05
shmohamudAfter 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
shmohamudnew question: what happens if we do y[2] = 21?14:07
fkoikoi_I am receiving error message14:08
shmohamudThat's what I was expecting. What does it say?14:08
sysadmin_y = tuple((13,9,2))14:09
sysadmin_y [0] = 1414:09
sysadmin_print(y)14:09
sysadmin_syntax error14:09
fkoikoi_TypeError: 'tuple' object does not support item assignment14:09
sysadmin_tuple don't support object assignment14:10
shmohamudexactly. Tuples are immutable! Once you create it, it's like a String, you can't mutate it14:10
shmohamudStrings and Tuples are both immutable14:10
shmohamudAlright guys, any questions before we call it a day?14:10
sysadmin_yes14:10
shmohamudno?14:11
sysadmin_I m coming shmohamud14:11
sysadmin_with a question14:11
shmohamudok14:12
shmohamudim going to use the restroom, will be right back14:12
sysadmin_ok14: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 assignment14:15
shmohamudok, sounds good14:15
shmohamudany last questions before I log off?14:15
shmohamudalright well great job today guys14:16
shmohamudSee you tomorrow14:16
fkoikoi_no14:16
sysadmin_Thanks shmohamud14:16
shmohamudyou're welcome scooper14:17
shmohamudyou guys are doing great, keep working hard and we'll reach our goal soon.14:17
sysadmin_freena14:17
fkoikoi_thanks shmohamud14:17
fkoikoi_yes14:17
shmohamudsee you tomorrow14:17
*** shmohamud has quit (Remote host closed the connection)14:17
sysadmin_respond to my private message14: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/!