*** 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 | |
shmohamud | good day scooper and fkoikoi | 13:32 |
---|---|---|
scooper | Good morning Shmohamud | 13:32 |
shmohamud | how're you scooper? | 13:33 |
scooper | I m just from reading your second email, how are you feeling now??? | 13:33 |
shmohamud | much better | 13:33 |
scooper | I m fine | 13:33 |
scooper | Ok thank God | 13:33 |
fkoikoi | Good morning shmohamud | 13:33 |
shmohamud | wonderful | 13:33 |
shmohamud | shall we get started early or hold off for 20m? | 13:34 |
scooper | If you are feeling much better than we can start shomamud | 13:35 |
shmohamud | sounds goo! | 13:36 |
shmohamud | good! | 13:36 |
shmohamud | So, have you both finished your homework from Saturday? | 13:36 |
fkoikoi | yes, i try doing it | 13:37 |
shmohamud | let's see it | 13:37 |
scooper | +1 I did it | 13:38 |
shmohamud | awesome | 13:38 |
scooper | but in two ways one is working and the other is give me representation of reversed python... | 13:39 |
shmohamud | let's see both! interesting | 13:40 |
scooper | def myFunction(backward): | 13:40 |
scooper | reversing = backward [::-1] | 13:40 |
scooper | return reversing | 13:40 |
scooper | print(myFunction("apple")) | 13:40 |
scooper | def reversingLetter(letterValue): | 13:40 |
fkoikoi | def my_function(add_three): | 13:40 |
fkoikoi | print(add_three + 3 ) | 13:40 |
fkoikoi | my_function (15) | 13:40 |
fkoikoi | my_function (14) | 13:40 |
scooper | reversing = reversed(letterValue) | 13:40 |
scooper | return reversing | 13:40 |
scooper | print(reversingLetter("Spencer")) | 13:40 |
shmohamud | fkoikoi, that looks great. Can you rename the function to be add_three and change the parameter name to "num"? | 13:41 |
shmohamud | scooper, which one is working? | 13:41 |
scooper | The first is working | 13:41 |
shmohamud | let me try.. | 13:41 |
shmohamud | great job! | 13:43 |
shmohamud | the second one should work too, because python has a built-in reverse function I think | 13:44 |
shmohamud | What if you change the "reversed" to "reverse" without the "d" and try that one? | 13:44 |
scooper | It will render error | 13:45 |
scooper | NameError reverse is not defined | 13:45 |
fkoikoi | def add_three(num): | 13:45 |
fkoikoi | print(num + 3 ) | 13:45 |
fkoikoi | add_three (15) | 13:45 |
fkoikoi | add_three ( | 13:45 |
scooper | But reversed is valid in python | 13:45 |
scooper | <reversed object at 0x7f5d5f89f460> | 13:46 |
shmohamud | fkoikoi great job! | 13:47 |
scooper | the structure is correct once you encounter message let this <reversed object at 0x7f5d5f89f460> | 13:47 |
fkoikoi | Thanks shmohamud | 13:47 |
scooper | But it like I m missing something | 13:47 |
shmohamud | naming 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 later | 13:47 |
shmohamud | Scooper, 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 way | 13:48 |
shmohamud | I'm not sure why reversed isn't working unfortunately. | 13:48 |
shmohamud | x = x + 2 | 13:49 |
shmohamud | print(x) | 13:49 |
scooper | Thanks shmohamud but I will share with Jeff what you think about it??? | 13:49 |
shmohamud | who can tell me what the variable, constant, operator and function are in the above two lines? | 13:49 |
shmohamud | Ok scooper, good idea! | 13:50 |
scooper | Let me explain | 13:50 |
scooper | should I?? | 13:50 |
shmohamud | yes please | 13:50 |
scooper | the variable x is performing an Arithemtic operation | 13:51 |
scooper | in python | 13:51 |
scooper | but it will only print out the value if the second x after the assignment operator has a numeric value | 13:52 |
shmohamud | is x performing the operation or are we the author performing it? | 13:52 |
scooper | the first x in the equation is the variable | 13:53 |
shmohamud | good, continue please | 13:53 |
scooper | that is saving the addition that will take place between the two value | 13:53 |
scooper | unfortunately the second x does have a numeric value | 13:53 |
scooper | so adding 2 to it will render an error in python | 13:54 |
shmohamud | correct | 13:54 |
shmohamud | what if we gave the first line x = 5. Continue to explain what the operator, constant and function are | 13:55 |
scooper | please construct it let me see what you mean | 13:55 |
scooper | you mean something like this | 13:55 |
shmohamud | I mean x = x + 2 | 13:56 |
shmohamud | and print(x) | 13:56 |
shmohamud | there is an operator, constant and function in the lines. Can you point out which is which? | 13:56 |
scooper | is the second x having a numeric value?? | 13:56 |
shmohamud | yes, assume that to be true | 13:56 |
scooper | than the output will be 7 | 13:57 |
shmohamud | ok, but to my question, do you know the names of the pieces? | 13:57 |
scooper | no | 13:57 |
scooper | haven heard of that in python | 13:57 |
shmohamud | that's totally cool, so here's the slide deck that I'm working on | 13:57 |
shmohamud | https://www.py4e.com/lessons/memory | 13:58 |
shmohamud | if you click slides, I want both of you to go through them | 13:58 |
shmohamud | so for now, I'll explain the answers | 13:58 |
shmohamud | as you said, the first looks like an algebra equation, but in programming we call it an assignment statement | 13:59 |
fkoikoi | okay | 13:59 |
shmohamud | we're assigning a value to the x in this case, then we re-assign the x to be x + 2 | 13:59 |
shmohamud | Arithmetic operators | 14:00 |
shmohamud | Assignment operators | 14:00 |
shmohamud | Comparison operators | 14:00 |
shmohamud | Logical operators | 14:00 |
shmohamud | Identity operators | 14:00 |
shmohamud | Membership operators | 14:00 |
shmohamud | Bitwise operators | 14:00 |
shmohamud | the operator "operates" on values and variables. Operators are the normal math operators plus a few more: | 14:00 |
shmohamud | These are all the operator types in python. Can you guess which operator the "+" falls under? | 14:01 |
scooper | yes | 14:01 |
scooper | Arithmetic operator | 14:02 |
shmohamud | bingo! | 14:02 |
shmohamud | nice, it's arithmetic so it's an aritmetic operator | 14:02 |
scooper | it is use for two thing in python | 14:02 |
shmohamud | Ok, so I noticed for homework you both wrote a function called my_function | 14:02 |
shmohamud | what two things scooper? | 14:02 |
scooper | joining string together | 14:03 |
scooper | and adding number | 14:03 |
shmohamud | bingo again, it's used for "concatenation" and addition | 14:03 |
shmohamud | thanks for sharing that. so now I want to go to the homework because I noticed you both did something similar | 14:04 |
shmohamud | Naming 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 mind | 14:04 |
scooper | sure | 14:05 |
shmohamud | So, 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 |
shmohamud | The key is to name the function based on its purpose, what it's being used for | 14:06 |
shmohamud | The 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 |
shmohamud | Does this make sense so far? | 14:07 |
scooper | yes shmohamud | 14:07 |
shmohamud | fkoikoi? | 14:07 |
scooper | what you mean is also significant for variable name to0 | 14:07 |
scooper | *mentioned | 14:08 |
fkoikoi | yes but i still need a little explanation after I read what you send | 14:08 |
shmohamud | yes, definitely | 14:08 |
shmohamud | ok fkoikoi | 14:08 |
shmohamud | Also, 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 |
shmohamud | x = x + 2 | 14:08 |
shmohamud | print(x) | 14:08 |
scooper | According to Think Python for everybody giving your function or variable a meaningful name help to eredicate too much comment in your program | 14:09 |
scooper | print is the function | 14:09 |
shmohamud | It's useful for that too! | 14:09 |
shmohamud | Yes! Print is the function. What's the constant? | 14:10 |
scooper | not too sure but let me guess the first variable x | 14:10 |
shmohamud | yes | 14:11 |
shmohamud | the constant? | 14:13 |
scooper | are you still waiting for more respond??? | 14:14 |
shmohamud | yes | 14:14 |
shmohamud | the last piece is what is the constant there? | 14:14 |
scooper | I done know what is a constant in python??? | 14:14 |
scooper | knowing the meaning will help | 14:15 |
shmohamud | that's fine! A constant in the above is the number 2 | 14:15 |
shmohamud | constants do not change | 14:15 |
scooper | ok | 14:15 |
shmohamud | numbers, letters and strings are constants because they're fixed, their values do not change | 14:15 |
shmohamud | Do you guys know about reserved words? | 14:16 |
scooper | yes | 14:16 |
shmohamud | can you name 3 for me? | 14:16 |
scooper | yes | 14:16 |
shmohamud | please do | 14:17 |
scooper | for, while, | 14:17 |
scooper | if | 14:17 |
scooper | else, elif | 14:17 |
shmohamud | nicely done! | 14:17 |
shmohamud | so, these are examples of reserved words, you can't name your variables or functions using reserved words | 14:17 |
shmohamud | can you both set the variable x to a value | 14:18 |
scooper | yes | 14:18 |
shmohamud | then set it to another value in a later staement? | 14:18 |
shmohamud | please do so | 14:18 |
scooper | x = 5 | 14:19 |
scooper | x = x+1 | 14:19 |
shmohamud | perfect | 14:19 |
shmohamud | we can change the value of variables in later statements | 14:19 |
shmohamud | in python, there are a few rules for naming variables | 14:20 |
shmohamud | 1.) They must start with a letter or underscore | 14:20 |
shmohamud | 2.) Must consist of letters, numbers and underscores | 14:20 |
shmohamud | 3.) Case sensitive | 14:21 |
shmohamud | so, can you both give me an example of a bad variable name? | 14:21 |
scooper | yes | 14:21 |
scooper | @age = "what is your age?" | 14:21 |
shmohamud | great example scooper | 14:22 |
scooper | 123 = "What is your name" | 14:22 |
shmohamud | fkoikoi? | 14:22 |
shmohamud | Perfect scooper | 14:22 |
fkoikoi | yes | 14:22 |
shmohamud | please give an example of a bad variable name | 14:23 |
fkoikoi | hg- = "give me" | 14:24 |
shmohamud | nice! | 14:24 |
shmohamud | well done | 14:24 |
fkoikoi | okay | 14:25 |
shmohamud | So, 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 |
scooper | Thanks 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 Programing | 14:27 |
shmohamud | Ok Spencer, how about fkoikoi? | 14:27 |
scooper | But if the need be I can ask you???? | 14:28 |
fkoikoi | yes | 14:28 |
shmohamud | Spencer, of course! | 14:28 |
shmohamud | I 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 |
scooper | We talk about dot notation the late time right??? | 14:29 |
shmohamud | Scooper I have one major advice for you: stick to one language at a time :D | 14:29 |
shmohamud | Hehehehe | 14:30 |
scooper | shmohamud | 14:30 |
scooper | I have not choice right now | 14:30 |
shmohamud | Yes scooper. | 14:30 |
scooper | The school | 14:30 |
fkoikoi | I am trying to see if I can write a program that rompt for a score between 0.0 and 1.0 | 14:30 |
shmohamud | Oh! I forgot haha. | 14:30 |
scooper | is one bring these thing in | 14:30 |
shmohamud | Let's do it together, what do you think? | 14:30 |
fkoikoi | but I will sure you my work when i'm done | 14:30 |
shmohamud | Ok so let's see | 14:31 |
scooper | Hope you understand | 14:31 |
shmohamud | Fkoikoi, you want to write a program that prompts a user for a score between 0 and 10? | 14:31 |
shmohamud | Scooper, 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 once | 14:32 |
fkoikoi | 0.0 and 1.0 | 14:32 |
shmohamud | So, what's your question about dot notation? | 14:32 |
shmohamud | Fkoikoi, got it. Maybe me and Scooper can help? | 14:32 |
shmohamud | Or do you want to try on your own first, then come to us? | 14:32 |
fkoikoi | I saw this exercise in the book just now and I am trying to see if I can do it | 14:32 |
fkoikoi | yes, I want to try on my own first | 14:33 |
scooper | Is dot notation only use on a method in python | 14:33 |
shmohamud | I love that idea, that's how we learn the most, trying alone and only asking for help when we've tried | 14:33 |
shmohamud | good question, let me see scooper | 14:33 |
shmohamud | you mean do other languages use it or is it used to access more than just methods in python? | 14:34 |
shmohamud | scooper can you give me 5m to pour some coffee? | 14:34 |
scooper | I mean in Python??? | 14:34 |
shmohamud | Ok, got it | 14:34 |
scooper | Yes can you change with me too | 14:34 |
shmohamud | can I pour some coffee and meet you back in 5m? | 14:34 |
shmohamud | what do you mean can I change? | 14:35 |
scooper | I mean can I drink some coffee with you | 14:35 |
shmohamud | hahahahahaha | 14:35 |
fkoikoi | me too shmohamud | 14:36 |
shmohamud | Spencer, I hope to drink coffee with you one day, but I'm afraid that day is not quite today hehehehe | 14:36 |
shmohamud | I will be back in 5m guys, ok? | 14:36 |
shmohamud | lol ok fkoikoi | 14:36 |
shmohamud | i'll pour the drink for all three of us, and we can share it in spirit | 14:36 |
shmohamud | ok, I'll be right back guys, gonna pour this coffee | 14:37 |
fkoikoi | hahahah | 14:37 |
fkoikoi | okay | 14:37 |
shmohamud | ok I'm back | 14:42 |
shmohamud | so, dot notation. The question is, can we use it to access more than methods? | 14:43 |
fkoikoi | alright | 14:43 |
shmohamud | #We create an instance of our Person Class to create an object. | 14:44 |
shmohamud | randomPerson = Person( "Marshall Mathers", 49) | 14:44 |
shmohamud | #Checking attributes through dot notation | 14:44 |
shmohamud | print( "Name of the person: " + randomPerson.name) | 14:44 |
shmohamud | print( "Age of the person: " + str(randomPerson.age) + "years" ) | 14:44 |
shmohamud | #Accessing the attributes through dot notation | 14:44 |
shmohamud | randomPerson.sayHello() | 14:44 |
shmohamud | randomPerson.sayName() | 14:44 |
shmohamud | do you see the above Scooper? | 14:44 |
shmohamud | this is good for you too fkoikoi so please pay attention | 14:45 |
fkoikoi | alright | 14:45 |
shmohamud | scooper? | 14:47 |
*** scooper has quit (Quit: Leaving) | 14:47 | |
shmohamud | scooper? | 14:49 |
scooper | yes | 14:49 |
shmohamud | welcome back | 14:49 |
shmohamud | note this code block: | 14:50 |
shmohamud | #We create an instance of our Person Class to create an object. | 14:50 |
shmohamud | randomPerson = Person( "Marshall Mathers", 49) | 14:50 |
shmohamud | #Checking attributes through dot notation | 14:50 |
scooper | sorry for the disconnection | 14:50 |
shmohamud | print( "Name of the person: " + randomPerson.name) | 14:50 |
shmohamud | print( "Age of the person: " + str(randomPerson.age) + "years" ) | 14:50 |
shmohamud | #Accessing the attributes through dot notation | 14:50 |
shmohamud | randomPerson.sayHello() | 14:50 |
shmohamud | randomPerson.sayName() | 14:50 |
shmohamud | no need to apologize, I know conditions are tough at the school | 14:50 |
shmohamud | I'm just happy you're bac | 14:50 |
shmohamud | So, do you see the above code snippet | 14:50 |
scooper | yes shmohamud | 14:51 |
shmohamud | we're creating a python class | 14:51 |
shmohamud | creating an instance of a python class, called Person. Do you see that? | 14:51 |
scooper | yes | 14:51 |
shmohamud | good | 14:51 |
shmohamud | do you see how it has two attributes, name and age? | 14:52 |
scooper | yes | 14:52 |
shmohamud | Ok, so in Python (and many other languages) we can access the attributes and methods of class using dot notation. | 14:53 |
shmohamud | As 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 | +1 | 14:54 |
scooper | Very clear but will need more practice for the concept to sink | 14:54 |
scooper | shmohamud | 14:55 |
shmohamud | Most definitely, all of this will take time to sink. But always remember, there is no substitute for hard work and effort on your own time | 14:55 |
scooper | you posted a link earlier | 14:55 |
shmohamud | yes? | 14:55 |
shmohamud | Yes I posted this: https://www.py4e.com/lessons/memory | 14:56 |
scooper | can you post it again and secondly what should we do with it??? | 14:56 |
shmohamud | I would like you to click on the section that says "slides": Pythonlearn-02-Expressions.pptx | 14:56 |
shmohamud | and go through each slide carefully, read thoroughly, and try to understand what's being communicated | 14:57 |
shmohamud | My 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 |
scooper | Thanks shmohamud let rest for today..... | 14:58 |
scooper | and also make maximum use of the link in your absent | 14:59 |
shmohamud | That sounds good scooper :) | 14:59 |
shmohamud | Any last questions for today, before I log off? | 14:59 |
scooper | My battery is going down that why.... | 14:59 |
shmohamud | i understand, hopefully we'll fix that soon.. | 14:59 |
scooper | Thanks shmohamud..... | 15:00 |
shmohamud | you're welcome, have a great rest of your day guys :) | 15:00 |
*** scooper has quit (Quit: Leaving) | 15:00 | |
fkoikoi | alright | 15: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/!