IRC log of #novawebdev for Tuesday, 2023-05-23

*** shmohamud has quit (Ping timeout: 480 seconds)01:40
*** shmohamud has quit (Ping timeout: 480 seconds)03:42
*** shmohamud has quit (Ping timeout: 480 seconds)07:44
*** shmohamud has quit (Ping timeout: 480 seconds)09:46
shmohamudgood day scooper and fkoikoi13:32
scooperGood morning Shmohamud13:32
shmohamudhow're you scooper?13:33
scooperI m just from reading your second email, how are you feeling now???13:33
shmohamudmuch better13:33
scooperI m fine13:33
scooperOk thank God13:33
fkoikoiGood morning shmohamud13:33
shmohamudwonderful13:33
shmohamudshall we get started early or hold off for 20m?13:34
scooperIf you are feeling much better than we can start shomamud13:35
shmohamudsounds goo!13:36
shmohamudgood!13:36
shmohamudSo, have you both finished your homework from Saturday?13:36
fkoikoiyes, i try doing it13:37
shmohamudlet's see it13:37
scooper+1 I did it13:38
shmohamudawesome13:38
scooperbut in two ways one is working and the other is give me representation of reversed python...13:39
shmohamudlet's see both! interesting13:40
scooperdef myFunction(backward):13:40
scooper    reversing = backward [::-1]13:40
scooper    return reversing13:40
scooperprint(myFunction("apple"))13:40
scooperdef reversingLetter(letterValue):13:40
fkoikoidef my_function(add_three):13:40
fkoikoi    print(add_three + 3 )13:40
fkoikoimy_function (15)13:40
fkoikoimy_function (14)13:40
scooper    reversing = reversed(letterValue)13:40
scooper    return reversing13:40
scooperprint(reversingLetter("Spencer"))13:40
shmohamudfkoikoi, that looks great. Can you rename the function to be add_three and change the parameter name to "num"?13:41
shmohamudscooper, which one is working?13:41
scooperThe first is working13:41
shmohamudlet me try..13:41
shmohamudgreat job!13:43
shmohamudthe second one should work too, because python has a built-in reverse function I think13:44
shmohamudWhat if you change the "reversed" to "reverse" without the "d" and try that one?13:44
scooperIt will render error13:45
scooperNameError reverse is not defined13:45
fkoikoidef add_three(num):13:45
fkoikoi    print(num + 3 )13:45
fkoikoiadd_three (15)13:45
fkoikoiadd_three (13:45
scooperBut reversed is valid in python13:45
scooper<reversed object at 0x7f5d5f89f460>13:46
shmohamudfkoikoi great job!13:47
scooperthe structure is correct once you encounter message let this <reversed object at 0x7f5d5f89f460>13:47
fkoikoiThanks shmohamud13:47
scooperBut it like I m missing something13:47
shmohamudnaming variables should tell us what the code is doing, so it's important to take some time and name everything properly so we can read it easily later13:47
shmohamudScooper, for now I think the reverse that you did is the best, because slicing it that way is the fastest and the web is telling me it's the best way13:48
shmohamudI'm not sure why reversed isn't working unfortunately.13:48
shmohamudx = x + 213:49
shmohamudprint(x)13:49
scooperThanks shmohamud but I will share with Jeff what you think about it???13:49
shmohamudwho can tell me what the variable, constant, operator and  function are in the above two lines?13:49
shmohamudOk scooper, good idea!13:50
scooperLet me explain13:50
scoopershould I??13:50
shmohamudyes please13:50
scooperthe variable x is performing an Arithemtic operation13:51
scooperin python13:51
scooperbut it will only print out the value if the second x after the assignment operator has a numeric value13:52
shmohamudis x performing the operation or are we the author performing it?13:52
scooperthe first x in the equation is the variable13:53
shmohamudgood, continue please13:53
scooperthat is saving the addition that will take place between the two value13:53
scooperunfortunately the second x does have a numeric value13:53
scooperso adding 2 to it will render an error in python13:54
shmohamudcorrect13:54
shmohamudwhat if we gave the first line x = 5. Continue to explain what the operator, constant and function are13:55
scooperplease construct it let me see what you mean13:55
scooperyou mean something like this13:55
shmohamudI mean x = x + 213:56
shmohamudand print(x)13:56
shmohamudthere is an operator, constant and function in the lines. Can you point out which is which?13:56
scooperis the second x having a numeric value??13:56
shmohamudyes, assume that to be true13:56
scooperthan the output will be 713:57
shmohamudok, but to my question, do you know the names of the pieces?13:57
scooperno13:57
scooperhaven heard of that in python13:57
shmohamudthat's totally cool, so here's the slide deck that I'm working on13:57
shmohamudhttps://www.py4e.com/lessons/memory13:58
shmohamudif you click slides, I want both of you to go through them13:58
shmohamudso for now, I'll explain the answers13:58
shmohamudas you said, the first looks like an algebra equation, but in programming we call it an assignment statement13:59
fkoikoiokay13:59
shmohamudwe're assigning a value to the x in this case, then we re-assign the x to be x + 213:59
shmohamudArithmetic operators14:00
shmohamudAssignment operators14:00
shmohamudComparison operators14:00
shmohamudLogical operators14:00
shmohamudIdentity operators14:00
shmohamudMembership operators14:00
shmohamudBitwise operators14:00
shmohamudthe operator "operates" on values and variables. Operators are the normal math operators plus a few more: 14:00
shmohamudThese are all the operator types in python. Can you guess which operator the "+" falls under?14:01
scooperyes14:01
scooperArithmetic operator14:02
shmohamudbingo!14:02
shmohamudnice, it's arithmetic so it's an aritmetic operator14:02
scooperit is use for two thing in python14:02
shmohamudOk, so I noticed for homework you both wrote a function called my_function14:02
shmohamudwhat two things scooper?14:02
scooperjoining string together14:03
scooperand adding number14:03
shmohamudbingo again, it's used for "concatenation" and addition14:03
shmohamudthanks for sharing that. so now I want to go to the homework because I noticed you both did something similar14:04
shmohamudNaming functions as "my_function" is okay for beginners, but we want to upgrade you guys to pros, right? Pros name their functions with purpose and utility in mind14:04
scoopersure14:05
shmohamudSo, a function is usually created for a purpose. Whether it's adding things together, printing something out, checking if something is true, etc.14:05
shmohamudThe key is to name the function based on its purpose, what it's being used for14:06
shmohamudThe reason is because when you want to edit the code later, it's easier to understand what's happening. Even more important, it's easy for other developers to understand what's going on!14:06
shmohamudDoes this make sense so far?14:07
scooperyes shmohamud14:07
shmohamudfkoikoi?14:07
scooperwhat you mean is also significant for variable name to014:07
scooper*mentioned14:08
fkoikoiyes but i still need a little explanation after I read what you send14:08
shmohamudyes, definitely14:08
shmohamudok fkoikoi14:08
shmohamudAlso, I forgot to ask the last two questions from earlier. Can anyone tell me what the constant and the function are in the lines below?14:08
shmohamudx = x + 214:08
shmohamudprint(x)14:08
scooperAccording to Think Python for everybody giving your function or variable a meaningful name help to eredicate too much comment in your program14:09
scooperprint is the function14:09
shmohamudIt's useful for that too!14:09
shmohamudYes! Print is the function. What's the constant?14:10
scoopernot too sure but let me guess the first variable x 14:10
shmohamudyes14:11
shmohamudthe constant?14:13
scooperare  you still waiting for more respond???14:14
shmohamudyes14:14
shmohamudthe last piece is what is the constant there?14:14
scooperI done know what is a constant in python???14:14
scooperknowing the meaning will help14:15
shmohamudthat's fine! A constant in the above is the number 214:15
shmohamudconstants do not change14:15
scooperok14:15
shmohamudnumbers, letters and strings are constants because they're fixed, their values do not change14:15
shmohamudDo you guys know about reserved words?14:16
scooperyes14:16
shmohamudcan you name 3 for me?14:16
scooperyes14:16
shmohamudplease do14:17
scooperfor, while, 14:17
scooperif14:17
scooperelse, elif14:17
shmohamudnicely done!14:17
shmohamudso, these are examples of reserved words, you can't name your variables or functions using reserved words14:17
shmohamudcan you both set the variable x to a value14:18
scooperyes14:18
shmohamudthen set it to another value in a later staement?14:18
shmohamudplease do so14:18
scooperx = 514:19
scooperx = x+114:19
shmohamudperfect14:19
shmohamudwe can change the value of variables in later statements14:19
shmohamudin python, there are a few rules for naming variables14:20
shmohamud1.) They must start with a letter or underscore14:20
shmohamud2.) Must consist of letters, numbers and underscores14:20
shmohamud3.) Case sensitive14:21
shmohamudso, can you both give me an example of a bad variable name?14:21
scooperyes14:21
scooper@age = "what is your age?"14:21
shmohamudgreat example scooper14:22
scooper123 = "What is your name"14:22
shmohamudfkoikoi?14:22
shmohamudPerfect scooper14:22
fkoikoiyes14:22
shmohamudplease give an example of a bad variable name14:23
fkoikoihg- = "give me"14:24
shmohamudnice!14:24
shmohamudwell done14:24
fkoikoiokay14:25
shmohamudSo, guys. We have not too much time left. I would love to know, is there anything you're studying on your own now that has you a bit confused?14:25
scooperThanks shomhamud for me I done have question right because I m reading the Book for now I look forward to doing so by next week because of concept I haven grab yet in Introduction to Java Programing14:27
shmohamudOk Spencer, how about fkoikoi?14:27
scooperBut if the need be I can ask you????14:28
fkoikoiyes 14:28
shmohamudSpencer, of course!14:28
shmohamudI still have 30m I can do with you now if you guys have the energy. What do you think if we go over an hour today?14:29
scooperWe talk about dot notation the late time right???14:29
shmohamudScooper I have one major advice for you: stick to one language at a time :D 14:29
shmohamudHehehehe14:30
scoopershmohamud14:30
scooperI have not choice right now14:30
shmohamudYes scooper. 14:30
scooperThe school 14:30
fkoikoiI am trying to see if I can write a program that rompt for a score between 0.0 and 1.0 14:30
shmohamudOh! I forgot haha.14:30
scooperis one bring these thing in14:30
shmohamudLet's do it together, what do you think?14:30
fkoikoibut I will sure you my work when i'm done14:30
shmohamudOk so let's see14:31
scooperHope you understand14:31
shmohamudFkoikoi, you want to write a program that prompts a user for a score between 0 and 10?14:31
shmohamudScooper, I understand, I'm just teasing you and realize that you have no choice now. That's a great reason to study two languages at once14:32
fkoikoi0.0 and 1.014:32
shmohamudSo, what's your question about dot notation?14:32
shmohamudFkoikoi, got it. Maybe me and Scooper can help?14:32
shmohamudOr do you want to try on your own first, then come to us?14:32
fkoikoiI saw this exercise in the book just now and I am trying to see if I can do it14:32
fkoikoiyes, I want to try on my own first14:33
scooperIs dot notation only use on a method in python14:33
shmohamudI love that idea, that's how we learn the most, trying alone and only asking for help when we've tried14:33
shmohamudgood question, let me see scooper14:33
shmohamudyou mean do other languages use it or is it used to access more than just methods in python?14:34
shmohamudscooper can you give me 5m to pour some coffee?14:34
scooperI mean in Python???14:34
shmohamudOk, got it14:34
scooperYes can you change with me too14:34
shmohamudcan I pour some coffee and meet you back in 5m?14:34
shmohamudwhat do you mean can I change?14:35
scooperI mean can I drink some coffee with you14:35
shmohamudhahahahahaha14:35
fkoikoime too shmohamud14:36
shmohamudSpencer, I hope to drink coffee with you one day, but I'm afraid that day is not quite today hehehehe14:36
shmohamudI will be back in 5m guys, ok?14:36
shmohamudlol ok fkoikoi14:36
shmohamudi'll pour the drink for all three of us, and we can share it in spirit14:36
shmohamudok, I'll be right back guys, gonna pour this coffee14:37
fkoikoihahahah14:37
fkoikoiokay14:37
shmohamudok I'm back14:42
shmohamudso, dot notation. The question is, can we use it to access more than methods?14:43
fkoikoialright14:43
shmohamud#We create an instance of our Person Class to create an object. 14:44
shmohamudrandomPerson = Person( "Marshall Mathers", 49)14:44
shmohamud#Checking attributes through dot notation14:44
shmohamudprint( "Name of the person: " + randomPerson.name) 14:44
shmohamudprint( "Age of the person: " + str(randomPerson.age) + "years" )14:44
shmohamud#Accessing the attributes through dot notation14:44
shmohamudrandomPerson.sayHello()14:44
shmohamudrandomPerson.sayName()14:44
shmohamuddo you see the above Scooper?14:44
shmohamudthis is good for you too fkoikoi so please pay attention14:45
fkoikoialright14:45
shmohamudscooper?14:47
*** scooper has quit (Quit: Leaving)14:47
shmohamudscooper?14:49
scooperyes 14:49
shmohamudwelcome back14:49
shmohamudnote this code block:14:50
shmohamud#We create an instance of our Person Class to create an object. 14:50
shmohamudrandomPerson = Person( "Marshall Mathers", 49)14:50
shmohamud#Checking attributes through dot notation14:50
scoopersorry for the disconnection14:50
shmohamudprint( "Name of the person: " + randomPerson.name) 14:50
shmohamudprint( "Age of the person: " + str(randomPerson.age) + "years" )14:50
shmohamud#Accessing the attributes through dot notation14:50
shmohamudrandomPerson.sayHello()14:50
shmohamudrandomPerson.sayName()14:50
shmohamudno need to apologize, I know conditions are tough at the school14:50
shmohamudI'm just happy you're bac14:50
shmohamudSo, do you see the above code snippet14:50
scooperyes shmohamud14:51
shmohamudwe're creating a python class14:51
shmohamudcreating an instance of a python class, called Person. Do you see that?14:51
scooperyes14:51
shmohamudgood14:51
shmohamuddo you see how it has two attributes, name and age?14:52
scooperyes14:52
shmohamudOk, so in Python (and many other languages) we can access the attributes and methods of class using dot notation.14:53
shmohamudAs we can see in the snippet, if it's an attribute, we don't need to call it. We just use the dot. Is that clear?14:53
fkoikoi+114:54
scooperVery clear but will need more practice for the concept to sink14:54
scoopershmohamud14:55
shmohamudMost definitely, all of this will take time to sink. But always remember, there is no substitute for hard work and effort on your own time14:55
scooperyou posted a link earlier14:55
shmohamudyes?14:55
shmohamudYes I posted this: https://www.py4e.com/lessons/memory14:56
scoopercan you post it again and secondly what should we do with it???14:56
shmohamudI would like you to click on the section that says "slides": Pythonlearn-02-Expressions.pptx14:56
shmohamudand go through each slide carefully, read thoroughly, and try to understand what's being communicated14:57
shmohamudMy coffee gave me extra energy, do you guys want to reconnect in 10m and do another 30m or is this good for the day?14:57
scooperThanks shmohamud let rest for today.....14:58
scooperand also make maximum use of the link in your absent14:59
shmohamudThat sounds good scooper :)14:59
shmohamudAny last questions for today, before I log off?14:59
scooperMy battery is going down that why....14:59
shmohamudi understand, hopefully we'll fix that soon..14:59
scooperThanks shmohamud.....15:00
shmohamudyou're welcome, have a great rest of your day guys :)15:00
*** scooper has quit (Quit: Leaving)15:00
fkoikoialright15:01
*** shmohamud has quit (Remote host closed the connection)15:01
*** fkoikoi has quit (Quit: Leaving)15:01
*** shmohamud has quit (Ping timeout: 480 seconds)15:09
*** shmohamud has quit (Remote host closed the connection)15:42
*** shmohamud has quit (Remote host closed the connection)15:53
*** shmohamud has quit (Ping timeout: 480 seconds)16:05
*** shmohamud has quit (Remote host closed the connection)17:19
*** shmohamud has quit (Remote host closed the connection)17:26
*** shmohamud has quit (Remote host closed the connection)18:23
*** thehedgeh0g has quit (Remote host closed the connection)18:28
*** shmohamud has quit (Remote host closed the connection)18:37
*** shmohamud has quit (Remote host closed the connection)18:38
*** shmohamud has quit (Remote host closed the connection)21:15

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!