IRC log of #novawebdev for Wednesday, 2023-12-20

*** 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
shmohamudHi Scooper21:44
scooperGood Good afternoon Sahnun21:44
shmohamudsorry for the delay getting on, finished work 20m ago21:44
scooperhow are you doing and how was work today???21:45
scoopergot you21:45
scooperI would patient21:45
scooperI should be patient21:45
shmohamudI'm doing well, work was good21:45
shmohamudHow are you doing?21:45
scooperI'm fine.....21:45
shmohamudDo you know exactly what day you're taking the PCEP?21:46
scooperNo to my knowledge21:46
shmohamudYou're taking it in January right?21:47
scooperyes21:47
shmohamudOk, gotcha21:47
scooperBut I think it will be January ending....21:47
shmohamudYou should find out the exact day so you can prepare with a clear day in mind21:47
scooperI have clear prepared a clear day in my already....21:47
shmohamudHow could you have a clear day in mind when you don't know what day you're taking it?21:48
scooperthat is, I hoping strongly it will be February 1st21:48
scooperBut I will ask Jeff21:49
shmohamudThat's too late, you have to take in January21:49
scooperOk I will ask Jeff for the exact day21:49
shmohamudOk, sounds good21:50
shmohamudI'm looking for good questions, give me a moment. If you have questions now feel free to ask me21:52
shmohamudArrange 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
shmohamudu there?21:56
scooperyes21:56
shmohamudkk take your time21:56
scooperI m21:56
scooperis the question asking for something like this21:58
scooperif 42 > 42:21:58
scooperif 42 > 42:21:59
scooper    print("yes")21:59
scooperelse:21:59
scooper    print("no")21:59
shmohamudclose, you have to use all the tokens, including threshold21:59
shmohamudre-read the question carefully and I'm sure you will get it.21:59
scooperif 42 > 1:22:01
scooper    print("yes")22:01
scooperelse:22:01
scooper    print("no")22:01
shmohamudIt says you have to use 42, threshold, :, and > to form the conditional.22:01
shmohamudWhere's threshold?22:02
shmohamudalso it doesn't say anything about printing22:02
scooperhmmm22:02
scooperso the thing here is that22:02
scooperlooking at the threshold22:03
scooperin your question is 4222:03
scooperso is 42 comparing 42 since you are talking about threhold here22:03
shmohamudit says "when the threshold variable is greater than 42"22:04
shmohamudJust translate that into code22:04
scooperif 42 is the threhold22:06
shmohamud42 and threshold are two different pieces22:06
shmohamudDon't read too much into the name of the variable, it could've been called "nothing"22:06
shmohamudJust use 42, threshold, :, and > to form a conditional which executes if threshold is greater than 42.22:07
scooperI m still confuse here....is threhold serving variable that has a value in it??22:08
shmohamudthreshold is a variable22:09
scooperIf it's a value what value is hold22:09
shmohamudthat's not required to answer the question22:09
scoopersince it's been use to compare 4222:09
shmohamudIt's asking you to form a valid conditional statement22:09
shmohamudNo need to know whether or not it executes.22:10
shmohamudDoes that make sense?22:10
scooperif 42 > threhold :22:10
scooperis that what you mean??22:10
shmohamud"guarantees that a certain statement is executed when the threshold variable is greater than 42."22:10
shmohamudClose, but do you see what's wrong?22:11
scooperhmmm still lost here Sahnun22:11
shmohamudYou're very close, what's confusing you?22:12
shmohamudI'm confident you can get this one.22:12
scooperIs there another question coming???22:13
scooperOr we still on the first question??22:13
shmohamudWe're on the same question22:14
shmohamudHow can you rewrite your answer "if 42 > threshold :" 22:14
shmohamudSo that it executes when "threshold" is greater than "42" ?22:14
scooperSo the problem here is that if I write this code like this: if 42 > threhold:22:17
scooper    print("this")22:17
scooperelse:22:17
scooper    print("that")22:17
scooperit will not execute22:17
shmohamudScooper, the question doesn't ask whether or not it will execute.22:18
shmohamudIt'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
shmohamudDoes 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
scooperThe question does Shnaun22:19
shmohamudIt's asking that it's guaranteed to execute *when* threshold is greater than 4222:20
shmohamudThreshold could be less than 42, in which case it will *not* execute22:20
shmohamudyou there?22:23
scooperyes22:23
scooperI M here22:23
shmohamudIs what I'm saying making sense?22:23
scooperYes at is22:24
shmohamudso do you want to give the answer one more try or should I share the answer now?22:24
scooperBut the question seen sample but tricky22:24
scooperno let me try again22:24
scooperif 42 > 43 or 44:22:25
scoopercan we say that22:25
shmohamudThe question says specifically to use 42, threshold, : and >22:26
shmohamudIf threshold is greater than 42 it should execute. Just put that into code.22:26
scooperif threshold > 42:22:27
shmohamudPerfect!22:27
shmohamudNow do you see what the question was asing?22:27
scooperIs that what you talking about22:27
shmohamudyes22:27
scooperyes22:27
scooperbut for point of semantic22:28
scooperthe program is not valid22:28
scooperbecause threhold is not defined and it's not holding a numerical value22:29
scooperso I got confuse on that22:29
shmohamudYou have to assume that threshold holds a value in the question22:30
shmohamudThere's no keyword called threshold in Python22:30
shmohamudthreshold is not an operator22:30
shmohamudthreshold is not a syntax element22:30
scooperThat is what I m saying22:30
shmohamudSo, you have to assume it's a variable with a value.22:31
shmohamudYou have to be prepared for questions like this on the PCEP.22:31
scooperThe Sahnun should make it most explicit22:31
scooperok got you22:31
shmohamudList the following arithmetic operations in order of their precedence, with the highest precedence on top.22:32
shmohamudMultiplication22:32
shmohamudAddition22:32
shmohamudExponetiation22:32
scooper**, *, +22:32
scooperAre you there22:33
shmohamudYep22:34
shmohamudThat's perfect, good job22:34
shmohamud Define binary cod22:35
shmohamud Define binary code.22:35
scooperBinary code in programming are 0 and 122:35
shmohamudA bit sequence which encodes machine instructions.22:36
shmohamudSelect 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
shmohamudyou there?22:42
scooperHope this work22:42
scoopernumq = int(input("Enter any number"))22:42
scooperprint(numq)22:42
shmohamudClose! But you didn't use the exact options given in the question22:43
shmohamudnumq = int(input("Enter the number of questions: "))22:44
scooperI m attesting again22:44
scoopercan you reserve the question in a difference sentence please22:45
shmohamudWhat do you mean? You got it right22:46
shmohamudThere was only a tiny issue where you didn't use the exact string given in the question22:47
scooperThough you said I didn't follow the instruction22:47
scoopernumq = int(input("Enter the number of questions"))22:48
scooperprint(numq)22:48
scooperis that what you mean??22:48
shmohamudyes22:49
shmohamudexpression = -1 ** 4 + 2 * 4 // 522:51
shmohamudif expression < 0:22:51
shmohamud    print('@')22:51
shmohamudelif expression > 2:22:51
shmohamud    print('@@')22:51
shmohamudelse:22:51
shmohamud    print('@@@')22:51
shmohamudQ09: What is the expected output of the above code?22:51
scooperthe elif statement22:54
shmohamudwhat does the expression evaluate to?22:55
scoopersorry22:55
scooperelse22:55
scooper022:56
shmohamudNot 022:56
scooperthe expression hold the value of : 022:57
shmohamudwhat does -1 ** 4 equal?22:57
scooper-122:57
shmohamud-1 * -1 * -1 * -122:58
shmohamud-1 * -1 equals 122:58
shmohamud-1 * 1 equals -122:58
shmohamud-1 * -1 = 122:58
shmohamudpositive 122:58
shmohamudAre you following that?23:01
scooperI m23:01
shmohamudOk, what does 2 * 4 // 5 evaluate to?23:01
scooperSahnun23:01
scooper123:02
shmohamudexactly23:02
shmohamudso the correct answer is?23:02
scooperfor the entire program??23:03
shmohamudThe original question, what will be printed out?23:04
scooperI said zero earlier 023:04
shmohamudexpression = -1 ** 4 + 2 * 4 // 523:05
shmohamudif expression < 0:23:05
shmohamud    print('@')23:05
shmohamudelif expression > 2:23:05
shmohamud    print('@@')23:05
shmohamudelse:23:05
shmohamud    print('@@@')23:05
scooperelse23:05
shmohamudcorrect23:05
shmohamudbecause it evaluates to 223:05
scooperBecause because zero is not less or greater than the first and second conditions23:06
shmohamudYes but 0 is not the correct answer, it was a coincidence that it gave the right answer23:07
shmohamudthe correct evaluation is 2 and therefore it hits the else statement23:07
shmohamudFill in the blanks with val > 0, val < 0, or val == 0 in23:07
shmohamudval = 7 - 6 * 323:07
shmohamudif __________:23:07
shmohamud    print('#')23:07
shmohamudelif _________:23:07
shmohamud    print('##')23:07
shmohamudelse:23:07
shmohamud    print('###')23:07
shmohamudso that it prints ###.23:07
shmohamudyou there?23:12
scooperyes23:12
scooperval = 7 - 6 * 323:13
scooperif val > 0:23:13
scooper    print("#")23:13
scooperelif val < 0:23:13
scooper    print("###")23:13
scooperelif val == 0:23:13
scooper    print("###")23:13
scooperelse:23:13
scooper    print("###")23:13
shmohamudyou have an extra elif in there23:14
scooperyes I know23:14
shmohamudYou're only supposed to use two of the conditions above23:14
shmohamudAnd one of them should have "##" 23:14
scooperval = 7 - 6 * 323:15
scooperif val > 0:23:15
scooper    print("#")23:15
scooperelif val < 0:23:15
scooper    print("###")23:15
scooperelse:23:15
scooper    print("###")23:15
shmohamudthe second one should have "##" not "###"23:16
scooperval = 7 - 6 * 323:16
scooperif val > 0:23:16
scooper    print("#")23:16
scooperelif val < 0:23:16
scooper    print("##")23:16
scooperelse:23:16
scooper    print("###")23:16
shmohamudWhat does that print?23:16
scooperresult for val??23:17
shmohamudNo, what does the program print?23:17
shmohamudThe goal is to print "###" does it successfully print that?23:17
scooperyes23:17
shmohamudWhat does val equal?23:17
scooperbecause the output is not greater zero23:19
scoopernone it less than zero23:19
shmohamudWhat's the value of val?23:19
scooper-11 according to the program23:19
shmohamudOk, so what gets printed based on what you filled the blanks with?23:20
scooperthe else block23:20
shmohamudif val is -1123:21
shmohamudthen val < 0 evaluates to true, so what gets printed?23:21
scooperit mean if the first and second value is not true.... then print the else block23:21
shmohamudYes, but is the second condition true or false?23:22
shmohamudelif valu < 023:22
shmohamudelif val < 023:22
scooperfalse -11 is not23:22
scoopergreater then zero23:23
shmohamudbut the elif has val < 0, which is true or false?23:25
shmohamudbut the elif has val < 0, which is true or false? 23:27
scooper1-11 is less than zero23:28
scooper1True23:28
scooper1Sahnun23:28
scooper1it's 11:30pm on my end now........23:29
shmohamudso, how can you adjust your answer to make it print "###"?23:29
shmohamudok after this question23:29
shmohamudwe are finished23:30
scooper1No I m still here23:30
scooper1by using the greater sign in the first and second condition23:31
scooper1val = 7 - 6 * 323:31
scooper1if val > 0:23:31
scooper1    print("#")23:31
scooper1elif val > 0:23:31
scooper1    print("##")23:31
scooper1else:23:31
scooper1    print("###")23:31
shmohamudAlmost scooper, you can't use the same condition twicd.23:32
*** scooper has quit (Ping timeout: 480 seconds)23:32
scooper1let use ==23:32
shmohamudFill in the blanks with val > 0, val < 0, or val == 0 in23:32
scooper1val = 7 - 6 * 323:33
scooper1if val > 0:23:33
scooper1    print("#")23:33
scooper1elif val == 0:23:33
scooper1    print("##")23:33
scooper1else:23:33
scooper1    print("###")23:33
shmohamudPerfect23:33
shmohamudDo you see why this is the correct answer?23:33
scooper1yes23:33
shmohamudGood. Do you have any questions for me before I let you go?23:34
scooper1yes23:34
shmohamudlet's hear it23:35
scooper1In Python programming when using the comparison operation the value on the left remain the constant value that is be compared right example23:36
scooper15 > 2:23:37
scooper15<323:37
scooper15 == 523:37
scooper1Do you understand my question??23:38
shmohamudNot sure23:38
shmohamud5 and 2 are constants, not variables. 23:39
shmohamud5 > 2 is true23:39
shmohamud5 < 3 is false23:39
shmohamud5 == 5 is true23:39
shmohamudWhat's your question?23:39
scooper1no you not getting me23:39
scooper1let num1 = 5, num2 223:40
scooper1if I m  comparing them23:40
scooper1I will say num1 > num223:40
scooper1Sahnun23:41
shmohamudwhat is your question exactly?23:41
scooper1let me email you my question I m sleepy23:42
scooper1please...23:42
shmohamudsounds good23:42
scooper1ok23:42
shmohamudgood day today, a lot was learned. 23:42
scooper1ACTION leaving now 23:42
shmohamudWe will continue tomorrow. Get a full night of sleep23: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/!