*** shmohamud has quit (Remote host closed the connection) | 02:57 | |
*** shmohamud has quit (Ping timeout: 480 seconds) | 03:07 | |
*** mulbah has quit (Remote host closed the connection) | 13:11 | |
*** mulbah07_ has quit (Ping timeout: 480 seconds) | 13:21 | |
*** tboimah has quit (Read error: Connection reset by peer) | 16:59 | |
shmohamud | Hi Scooper | 21:44 |
---|---|---|
scooper | Good Good afternoon Sahnun | 21:44 |
shmohamud | sorry for the delay getting on, finished work 20m ago | 21:44 |
scooper | how are you doing and how was work today??? | 21:45 |
scooper | got you | 21:45 |
scooper | I would patient | 21:45 |
scooper | I should be patient | 21:45 |
shmohamud | I'm doing well, work was good | 21:45 |
shmohamud | How are you doing? | 21:45 |
scooper | I'm fine..... | 21:45 |
shmohamud | Do you know exactly what day you're taking the PCEP? | 21:46 |
scooper | No to my knowledge | 21:46 |
shmohamud | You're taking it in January right? | 21:47 |
scooper | yes | 21:47 |
shmohamud | Ok, gotcha | 21:47 |
scooper | But I think it will be January ending.... | 21:47 |
shmohamud | You should find out the exact day so you can prepare with a clear day in mind | 21:47 |
scooper | I have clear prepared a clear day in my already.... | 21:47 |
shmohamud | How could you have a clear day in mind when you don't know what day you're taking it? | 21:48 |
scooper | that is, I hoping strongly it will be February 1st | 21:48 |
scooper | But I will ask Jeff | 21:49 |
shmohamud | That's too late, you have to take in January | 21:49 |
scooper | Ok I will ask Jeff for the exact day | 21:49 |
shmohamud | Ok, sounds good | 21:50 |
shmohamud | I'm looking for good questions, give me a moment. If you have questions now feel free to ask me | 21:52 |
shmohamud | Arrange the tokens 42, threshold, :, > and if to form a conditional instruction which guarantees that a certain statement is executed when the threshold variable is greater than 42. | 21:54 |
shmohamud | u there? | 21:56 |
scooper | yes | 21:56 |
shmohamud | kk take your time | 21:56 |
scooper | I m | 21:56 |
scooper | is the question asking for something like this | 21:58 |
scooper | if 42 > 42: | 21:58 |
scooper | if 42 > 42: | 21:59 |
scooper | print("yes") | 21:59 |
scooper | else: | 21:59 |
scooper | print("no") | 21:59 |
shmohamud | close, you have to use all the tokens, including threshold | 21:59 |
shmohamud | re-read the question carefully and I'm sure you will get it. | 21:59 |
scooper | if 42 > 1: | 22:01 |
scooper | print("yes") | 22:01 |
scooper | else: | 22:01 |
scooper | print("no") | 22:01 |
shmohamud | It says you have to use 42, threshold, :, and > to form the conditional. | 22:01 |
shmohamud | Where's threshold? | 22:02 |
shmohamud | also it doesn't say anything about printing | 22:02 |
scooper | hmmm | 22:02 |
scooper | so the thing here is that | 22:02 |
scooper | looking at the threshold | 22:03 |
scooper | in your question is 42 | 22:03 |
scooper | so is 42 comparing 42 since you are talking about threhold here | 22:03 |
shmohamud | it says "when the threshold variable is greater than 42" | 22:04 |
shmohamud | Just translate that into code | 22:04 |
scooper | if 42 is the threhold | 22:06 |
shmohamud | 42 and threshold are two different pieces | 22:06 |
shmohamud | Don't read too much into the name of the variable, it could've been called "nothing" | 22:06 |
shmohamud | Just use 42, threshold, :, and > to form a conditional which executes if threshold is greater than 42. | 22:07 |
scooper | I m still confuse here....is threhold serving variable that has a value in it?? | 22:08 |
shmohamud | threshold is a variable | 22:09 |
scooper | If it's a value what value is hold | 22:09 |
shmohamud | that's not required to answer the question | 22:09 |
scooper | since it's been use to compare 42 | 22:09 |
shmohamud | It's asking you to form a valid conditional statement | 22:09 |
shmohamud | No need to know whether or not it executes. | 22:10 |
shmohamud | Does that make sense? | 22:10 |
scooper | if 42 > threhold : | 22:10 |
scooper | is that what you mean?? | 22:10 |
shmohamud | "guarantees that a certain statement is executed when the threshold variable is greater than 42." | 22:10 |
shmohamud | Close, but do you see what's wrong? | 22:11 |
scooper | hmmm still lost here Sahnun | 22:11 |
shmohamud | You're very close, what's confusing you? | 22:12 |
shmohamud | I'm confident you can get this one. | 22:12 |
scooper | Is there another question coming??? | 22:13 |
scooper | Or we still on the first question?? | 22:13 |
shmohamud | We're on the same question | 22:14 |
shmohamud | How can you rewrite your answer "if 42 > threshold :" | 22:14 |
shmohamud | So that it executes when "threshold" is greater than "42" ? | 22:14 |
scooper | So the problem here is that if I write this code like this: if 42 > threhold: | 22:17 |
scooper | print("this") | 22:17 |
scooper | else: | 22:17 |
scooper | print("that") | 22:17 |
scooper | it will not execute | 22:17 |
shmohamud | Scooper, the question doesn't ask whether or not it will execute. | 22:18 |
shmohamud | It's simply asking you to arrange the tokens to form a conditional where it *would* execute if threshold is greater than 42. It just wants you to write the conditional. | 22:18 |
shmohamud | Does that make sense? | 22:18 |
scooper | Arrange the tokens 42, threshold, :, > and if to form a conditional instruction which guarantees that a certain statement is executed when the threshold variable is greater than 42. | 22:19 |
scooper | The question does Shnaun | 22:19 |
shmohamud | It's asking that it's guaranteed to execute *when* threshold is greater than 42 | 22:20 |
shmohamud | Threshold could be less than 42, in which case it will *not* execute | 22:20 |
shmohamud | you there? | 22:23 |
scooper | yes | 22:23 |
scooper | I M here | 22:23 |
shmohamud | Is what I'm saying making sense? | 22:23 |
scooper | Yes at is | 22:24 |
shmohamud | so do you want to give the answer one more try or should I share the answer now? | 22:24 |
scooper | But the question seen sample but tricky | 22:24 |
scooper | no let me try again | 22:24 |
scooper | if 42 > 43 or 44: | 22:25 |
scooper | can we say that | 22:25 |
shmohamud | The question says specifically to use 42, threshold, : and > | 22:26 |
shmohamud | If threshold is greater than 42 it should execute. Just put that into code. | 22:26 |
scooper | if threshold > 42: | 22:27 |
shmohamud | Perfect! | 22:27 |
shmohamud | Now do you see what the question was asing? | 22:27 |
scooper | Is that what you talking about | 22:27 |
shmohamud | yes | 22:27 |
scooper | yes | 22:27 |
scooper | but for point of semantic | 22:28 |
scooper | the program is not valid | 22:28 |
scooper | because threhold is not defined and it's not holding a numerical value | 22:29 |
scooper | so I got confuse on that | 22:29 |
shmohamud | You have to assume that threshold holds a value in the question | 22:30 |
shmohamud | There's no keyword called threshold in Python | 22:30 |
shmohamud | threshold is not an operator | 22:30 |
shmohamud | threshold is not a syntax element | 22:30 |
scooper | That is what I m saying | 22:30 |
shmohamud | So, you have to assume it's a variable with a value. | 22:31 |
shmohamud | You have to be prepared for questions like this on the PCEP. | 22:31 |
scooper | The Sahnun should make it most explicit | 22:31 |
scooper | ok got you | 22:31 |
shmohamud | List the following arithmetic operations in order of their precedence, with the highest precedence on top. | 22:32 |
shmohamud | Multiplication | 22:32 |
shmohamud | Addition | 22:32 |
shmohamud | Exponetiation | 22:32 |
scooper | **, *, + | 22:32 |
scooper | Are you there | 22:33 |
shmohamud | Yep | 22:34 |
shmohamud | That's perfect, good job | 22:34 |
shmohamud | Define binary cod | 22:35 |
shmohamud | Define binary code. | 22:35 |
scooper | Binary code in programming are 0 and 1 | 22:35 |
shmohamud | A bit sequence which encodes machine instructions. | 22:36 |
shmohamud | Select from among ), float(, (, "Enter the number of questions: ", print, =, int(, input(, ==, and arrange them to complete an assignment statement that asks the user for an integer value and assigns it to the numqs variable. | 22:37 |
shmohamud | you there? | 22:42 |
scooper | Hope this work | 22:42 |
scooper | numq = int(input("Enter any number")) | 22:42 |
scooper | print(numq) | 22:42 |
shmohamud | Close! But you didn't use the exact options given in the question | 22:43 |
shmohamud | numq = int(input("Enter the number of questions: ")) | 22:44 |
scooper | I m attesting again | 22:44 |
scooper | can you reserve the question in a difference sentence please | 22:45 |
shmohamud | What do you mean? You got it right | 22:46 |
shmohamud | There was only a tiny issue where you didn't use the exact string given in the question | 22:47 |
scooper | Though you said I didn't follow the instruction | 22:47 |
scooper | numq = int(input("Enter the number of questions")) | 22:48 |
scooper | print(numq) | 22:48 |
scooper | is that what you mean?? | 22:48 |
shmohamud | yes | 22:49 |
shmohamud | expression = -1 ** 4 + 2 * 4 // 5 | 22:51 |
shmohamud | if expression < 0: | 22:51 |
shmohamud | print('@') | 22:51 |
shmohamud | elif expression > 2: | 22:51 |
shmohamud | print('@@') | 22:51 |
shmohamud | else: | 22:51 |
shmohamud | print('@@@') | 22:51 |
shmohamud | Q09: What is the expected output of the above code? | 22:51 |
scooper | the elif statement | 22:54 |
shmohamud | what does the expression evaluate to? | 22:55 |
scooper | sorry | 22:55 |
scooper | else | 22:55 |
scooper | 0 | 22:56 |
shmohamud | Not 0 | 22:56 |
scooper | the expression hold the value of : 0 | 22:57 |
shmohamud | what does -1 ** 4 equal? | 22:57 |
scooper | -1 | 22:57 |
shmohamud | -1 * -1 * -1 * -1 | 22:58 |
shmohamud | -1 * -1 equals 1 | 22:58 |
shmohamud | -1 * 1 equals -1 | 22:58 |
shmohamud | -1 * -1 = 1 | 22:58 |
shmohamud | positive 1 | 22:58 |
shmohamud | Are you following that? | 23:01 |
scooper | I m | 23:01 |
shmohamud | Ok, what does 2 * 4 // 5 evaluate to? | 23:01 |
scooper | Sahnun | 23:01 |
scooper | 1 | 23:02 |
shmohamud | exactly | 23:02 |
shmohamud | so the correct answer is? | 23:02 |
scooper | for the entire program?? | 23:03 |
shmohamud | The original question, what will be printed out? | 23:04 |
scooper | I said zero earlier 0 | 23:04 |
shmohamud | expression = -1 ** 4 + 2 * 4 // 5 | 23:05 |
shmohamud | if expression < 0: | 23:05 |
shmohamud | print('@') | 23:05 |
shmohamud | elif expression > 2: | 23:05 |
shmohamud | print('@@') | 23:05 |
shmohamud | else: | 23:05 |
shmohamud | print('@@@') | 23:05 |
scooper | else | 23:05 |
shmohamud | correct | 23:05 |
shmohamud | because it evaluates to 2 | 23:05 |
scooper | Because because zero is not less or greater than the first and second conditions | 23:06 |
shmohamud | Yes but 0 is not the correct answer, it was a coincidence that it gave the right answer | 23:07 |
shmohamud | the correct evaluation is 2 and therefore it hits the else statement | 23:07 |
shmohamud | Fill in the blanks with val > 0, val < 0, or val == 0 in | 23:07 |
shmohamud | val = 7 - 6 * 3 | 23:07 |
shmohamud | if __________: | 23:07 |
shmohamud | print('#') | 23:07 |
shmohamud | elif _________: | 23:07 |
shmohamud | print('##') | 23:07 |
shmohamud | else: | 23:07 |
shmohamud | print('###') | 23:07 |
shmohamud | so that it prints ###. | 23:07 |
shmohamud | you there? | 23:12 |
scooper | yes | 23:12 |
scooper | val = 7 - 6 * 3 | 23:13 |
scooper | if val > 0: | 23:13 |
scooper | print("#") | 23:13 |
scooper | elif val < 0: | 23:13 |
scooper | print("###") | 23:13 |
scooper | elif val == 0: | 23:13 |
scooper | print("###") | 23:13 |
scooper | else: | 23:13 |
scooper | print("###") | 23:13 |
shmohamud | you have an extra elif in there | 23:14 |
scooper | yes I know | 23:14 |
shmohamud | You're only supposed to use two of the conditions above | 23:14 |
shmohamud | And one of them should have "##" | 23:14 |
scooper | val = 7 - 6 * 3 | 23:15 |
scooper | if val > 0: | 23:15 |
scooper | print("#") | 23:15 |
scooper | elif val < 0: | 23:15 |
scooper | print("###") | 23:15 |
scooper | else: | 23:15 |
scooper | print("###") | 23:15 |
shmohamud | the second one should have "##" not "###" | 23:16 |
scooper | val = 7 - 6 * 3 | 23:16 |
scooper | if val > 0: | 23:16 |
scooper | print("#") | 23:16 |
scooper | elif val < 0: | 23:16 |
scooper | print("##") | 23:16 |
scooper | else: | 23:16 |
scooper | print("###") | 23:16 |
shmohamud | What does that print? | 23:16 |
scooper | result for val?? | 23:17 |
shmohamud | No, what does the program print? | 23:17 |
shmohamud | The goal is to print "###" does it successfully print that? | 23:17 |
scooper | yes | 23:17 |
shmohamud | What does val equal? | 23:17 |
scooper | because the output is not greater zero | 23:19 |
scooper | none it less than zero | 23:19 |
shmohamud | What's the value of val? | 23:19 |
scooper | -11 according to the program | 23:19 |
shmohamud | Ok, so what gets printed based on what you filled the blanks with? | 23:20 |
scooper | the else block | 23:20 |
shmohamud | if val is -11 | 23:21 |
shmohamud | then val < 0 evaluates to true, so what gets printed? | 23:21 |
scooper | it mean if the first and second value is not true.... then print the else block | 23:21 |
shmohamud | Yes, but is the second condition true or false? | 23:22 |
shmohamud | elif valu < 0 | 23:22 |
shmohamud | elif val < 0 | 23:22 |
scooper | false -11 is not | 23:22 |
scooper | greater then zero | 23:23 |
shmohamud | but the elif has val < 0, which is true or false? | 23:25 |
shmohamud | but the elif has val < 0, which is true or false? | 23:27 |
scooper1 | -11 is less than zero | 23:28 |
scooper1 | True | 23:28 |
scooper1 | Sahnun | 23:28 |
scooper1 | it's 11:30pm on my end now........ | 23:29 |
shmohamud | so, how can you adjust your answer to make it print "###"? | 23:29 |
shmohamud | ok after this question | 23:29 |
shmohamud | we are finished | 23:30 |
scooper1 | No I m still here | 23:30 |
scooper1 | by using the greater sign in the first and second condition | 23:31 |
scooper1 | val = 7 - 6 * 3 | 23:31 |
scooper1 | if val > 0: | 23:31 |
scooper1 | print("#") | 23:31 |
scooper1 | elif val > 0: | 23:31 |
scooper1 | print("##") | 23:31 |
scooper1 | else: | 23:31 |
scooper1 | print("###") | 23:31 |
shmohamud | Almost scooper, you can't use the same condition twicd. | 23:32 |
*** scooper has quit (Ping timeout: 480 seconds) | 23:32 | |
scooper1 | let use == | 23:32 |
shmohamud | Fill in the blanks with val > 0, val < 0, or val == 0 in | 23:32 |
scooper1 | val = 7 - 6 * 3 | 23:33 |
scooper1 | if val > 0: | 23:33 |
scooper1 | print("#") | 23:33 |
scooper1 | elif val == 0: | 23:33 |
scooper1 | print("##") | 23:33 |
scooper1 | else: | 23:33 |
scooper1 | print("###") | 23:33 |
shmohamud | Perfect | 23:33 |
shmohamud | Do you see why this is the correct answer? | 23:33 |
scooper1 | yes | 23:33 |
shmohamud | Good. Do you have any questions for me before I let you go? | 23:34 |
scooper1 | yes | 23:34 |
shmohamud | let's hear it | 23:35 |
scooper1 | In Python programming when using the comparison operation the value on the left remain the constant value that is be compared right example | 23:36 |
scooper1 | 5 > 2: | 23:37 |
scooper1 | 5<3 | 23:37 |
scooper1 | 5 == 5 | 23:37 |
scooper1 | Do you understand my question?? | 23:38 |
shmohamud | Not sure | 23:38 |
shmohamud | 5 and 2 are constants, not variables. | 23:39 |
shmohamud | 5 > 2 is true | 23:39 |
shmohamud | 5 < 3 is false | 23:39 |
shmohamud | 5 == 5 is true | 23:39 |
shmohamud | What's your question? | 23:39 |
scooper1 | no you not getting me | 23:39 |
scooper1 | let num1 = 5, num2 2 | 23:40 |
scooper1 | if I m comparing them | 23:40 |
scooper1 | I will say num1 > num2 | 23:40 |
scooper1 | Sahnun | 23:41 |
shmohamud | what is your question exactly? | 23:41 |
scooper1 | let me email you my question I m sleepy | 23:42 |
scooper1 | please... | 23:42 |
shmohamud | sounds good | 23:42 |
scooper1 | ok | 23:42 |
shmohamud | good day today, a lot was learned. | 23:42 |
scooper1 | ACTION leaving now | 23:42 |
shmohamud | We will continue tomorrow. Get a full night of sleep | 23:42 |
*** scooper1 has quit (Quit: Leaving) | 23:43 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!