----BEGIN CLASS---- [14:10] #startclass [14:11] ! [14:11] next [14:11] how do we control the 1st number? [14:11] skat-sd, good question [14:11] so range actually take three parameters [14:12] first parameter is the number form which you want to initiate the range [14:12] second number is the number till which that range should count excluding the number [14:13] and third is the step [14:13] sayan, rtnpro fhackdroid we had documentation https://ircbot.readthedocs.io/en/latest/ [14:13] add: fhackdroid [14:13] masters [14:13] .masters [14:13] kushal: Error: "masters" is not a valid command. [14:13] ohh, like this: for i in range(1,10): print(i). Got it [14:13] skat-sd, yes [14:13] thanks, fhackdroid [14:14] skarpy, not only that but you can try something like range(1, 10, 2) [14:14] fhackdroid - in 2s? [14:14] jasonbraganza, yes [14:14] got it [14:14] try it :) [14:14] Fhackdroid: ok [14:15] hope you guys are clear with range ? [14:15] yes ? [14:15] Yes. [14:15] yes [14:15] yes [14:15] Yes [14:15] yes [14:15] yes [14:15] cool so lets do a simple problem ? [14:15] yes [14:15] Yes [14:15] yes [14:15] yes [14:16] done [14:16] yes [14:16] yes [14:17] done [14:17] The problem is called "Scooby Doo" Print numbers from 1 to 100 and for every number which is multiple of 3 print Scooby , for number multiple of 7 print Doo and for 3 and 7 print Scooby Doo [14:18] is the question clear ? ^ [14:18] yes [14:19] paste your solution on fpaste and post a link here :) [14:19] If the number is 3 then it should print Scooby instead of 3, right? [14:20] if the number is multiple of 3 [14:20] it should print scooby instead of 3 [14:20] fhackdroid, we were using azure notebooks for Python sessions, should we use that? [14:20] bhavin192, YES [14:20] bhavin192, anything works :) [14:22] https://paste.fedoraproject.org/paste/aFPVg6lW7WVwfVyKDooUig [14:22] done [14:23] Done [14:23] https://notebooks.azure.com/n/Sj7eturEzLc/notebooks/summertraining.ipynb [14:23] https://notebooks.azure.com/n/EUkAHEpHLQg/notebooks/summertraining.ipynb [14:24] https://paste.fedoraproject.org/paste/XV0sizsb9Y8tGR717Xy-uA [14:24] nice :) [14:25] https://paste.fedoraproject.org/paste/qY5ddDstmHm6E4t1JbBotQ/deactivate/lMBmNEda6iFIwyLl6tSTKeJ0SIxrspd0jOTOhYEcR2hEhLWJXzG2kKaruPEmS1af [14:25] fhackdroid, the output looks amazing! [14:25] RIcharD_, i don't think so you got it right :) [14:25] https://notebooks.azure.com/n/Eg3NDOBW9To/notebooks/summertraining.ipynb [14:25] fhackdroid, but it worked :( [14:26] https://repl.it/KADY/0 [14:26] so can someone review RIcharD_ code : https://paste.fedoraproject.org/paste/XV0sizsb9Y8tGR717Xy-uA [14:26] https://paste.fedoraproject.org/paste/9weN6mGftiXv6jwE6Di1LQ [14:26] https://notebooks.azure.com/n/MQB5oeSxQz0/nbconvert/html/summertraining.ipynb [14:26] RIcharD_, try for number 21 ;) [14:26] fhackdroid, it just prints scooby :( [14:27] RIcharD_, you will never get Scooby Doo [14:27] This one is correct https://notebooks.azure.com/bhavin192/libraries/dgplug/html/summertraining.ipynb [14:27] s/correct/correct link [14:27] RIcharD_, so there is something wrong with it right ? [14:27] bhavin192, I figured out :) [14:27] https://notebooks.azure.com/abhinavshirur/libraries/dgplug/html/summertraining.ipynb [14:28] last 12 min logs anyone ? got disconnected [14:29] check this out : https://paste.fedoraproject.org/paste/e8MiGFiv87AAIEv24l7mwA/ [14:29] https://notebooks.azure.com/championshuttler/libraries/dgplug1/html/scoobydoo.ipynb [14:30] sitlanigaurav[m], you forgot to print the rest of the numbers [14:30] https://paste.fedoraproject.org/paste/3HevsJs4WBRffPZDTY8YaQ Corrected code here. fhackdroid :) [14:30] https://notebooks.azure.com/Balaji2198/libraries/python/html/ScoobyDoo.ipynb [14:31] devesh_verma: oh right [14:31] championshuttler, good try but that is wrong RIcharD_ wanna review his code ? [14:31] RlcharD_ check your range [14:31] RIcharD_ has not taken the third taken care of the third condition which is if the no. is divisible by both 3 and 7 [14:31] balaji, good work [14:31] done. please check - https://notebooks.azure.com/run/jasonbraganza/dgplug?dest=/notebooks/summertraining.ipynb [14:32] atul916, check the new link. https://paste.fedoraproject.org/paste/3HevsJs4WBRffPZDTY8YaQ [14:32] RIcharD_, still missing something' [14:32] fhackdroid, thanks [14:32] jasonbraganza - sorry wrong link [14:32] ! [14:32] next [14:32] fhackdroid: i updated the code , review it once again please [14:32] jasonbraganza, check the range [14:32] https://pastebin.com/1TssVgm8 , i got this [14:33] https://notebooks.azure.com/jasonbraganza/libraries/dgplug/html/summertraining.ipynb [14:33] fhackdroid, did balaji not miss Scooby Doo [14:33] https://notebooks.azure.com/n/NY0abiC5v4M/notebooks/summertraining.ipynb [14:33] jasonbraganza, check your range [14:33] fhackdroid, range(0,101)? [14:34] devesh_verma, right I guess I saw someone elses code [14:34] https://notebooks.azure.com/n/Eg3NDOBW9To/notebooks/summertraining.ipynb [14:34] RIcharD_, what is the first number it will take ? [14:35] sprunge.us/XUGL [14:35] fhackdroid, 0 :/ [14:35] fhackdroid: https://paste.fedoraproject.org/paste/a1ePx1QzvpT2UlgY8t0d-A/ [14:35] knrai, nice work [14:35] fhackdroid, got it. You said to print from 1 to 100 [14:35] fhackdroid - crap. had not saved the file. fixed [14:35] https://notebooks.azure.com/akshayg96/libraries/dgplug/html/summertraining.ipynb [14:36] Pooja_ check your indentation. The following print statement should be after a few spaces or a tab [14:36] how about my code? [14:36] fhackdroid, devesh_verma kindly check now [14:36] neer, no need of continue there [14:36] akshayg96, not the expected output [14:36] is thatcorrect? [14:37] https://notebooks.azure.com/n/NY0abiC5v4M/notebooks/summertraining.ipynb [14:37] atul916, link ? [14:37] knrai, fhackdroid> if the number is multiple of 3 it should print scooby instead of 3 [14:37] i gave the link above [14:38] okay [14:38] https://repl.it/KADY/0 [14:38] soumam007, pm [14:38] https://paste.fedoraproject.org/paste/~pyrI9URjsqU0YQwfRDMsw [14:38] sitlanigaurav[m], nope you are missing something check for 21 [14:38] san-D, range [14:39] balaji, can you share your URL once again [14:39] fhackdroid : its printing scooby and doo all the way :( [14:39] https://paste.fedoraproject.org/paste/JyUCzTVEE5hJTphdwyXqHQ [14:39] atul916, nope not right , check for 21 [14:39] abhinavshirur: corrected [14:39] san-D, I liked the condition if first if :D [14:39] skarpy, think about what are you missing! [14:39] * in first if [14:39] fhackdroid: review https://notebooks.azure.com/n/Sj7eturEzLc/notebooks/summertraining.ipynb [14:40] okay everyone listen up [14:40] fhackdroid: I haven't missed but printed s and d and both again [14:40] https://paste.fedoraproject.org/paste/8bPkOFgFHHrhAdCLPQ3r-A [14:40] I want your attention here [14:40] fhackdroid: https://notebooks.azure.com/n/A0TVv10zWEg/notebooks/summertraining.ipynb [14:40] say yes if you guys are paying attention [14:40] yes [14:40] es [14:40] yes [14:40] *yes [14:40] Yes [14:41] yes [14:41] yes [14:41] yes [14:41] Yes [14:41] yes [14:41] yes [14:41] Yes [14:41] okay what I am going to say is not related to python but programming [14:41] you guys are doing a hit and try [14:42] if this works or it doesn't [14:42] that is not how you should think [14:42] even before you start writing code [14:42] the solution should be clear in your mind [14:42] think before you write [14:43] give a read to the problem [14:43] there is very important skill which is analyzing [14:43] https://paste.fedoraproject.org/paste/4DJ1LzYIGbkZ6OyQYTPw6A [14:43] think about the problem, see what are the condition [14:43] think about the edge cases [14:43] https://notebooks.azure.com/kshitiz/libraries/dgplug/html/Scooby-Doo.ipynb [14:44] where it can break [14:44] learning a technology is like knowing the tool but even before using the tool you should know what you are using the tool for. [14:45] Else it will be like a spanner in monkey's hand the only thing it can cause is a lot of things to break, Given that monkey is not experimental. [14:45] https://paste.fedoraproject.org/paste/JyUCzTVEE5hJTphdwyXqHQ [14:46] are you guys getting what I am trying to say ? [14:46] yes fhackdroid [14:46] Yes [14:46] yes [14:46] yes [14:46] yes [14:46] yes [14:46] Yes, fhackdroid [14:46] yes [14:46] yes [14:46] Yes. [14:46] sorry got disconnected can anyone give logs of last 8 min [14:46] yes [14:47] so lets think logical here [14:47] how many of you got the solution ? [14:47] me [14:47] yes [14:47] atul916: check pm [14:47] me [14:47] me [14:48] me [14:48] Me [14:48] me [14:48] yes [14:48] how many of you used the "and" operator ? [14:48] i did [14:48] Me [14:48] i [14:48] I did. [14:48] I used and [14:48] me [14:48] me [14:48] I used [14:48] me [14:48] Me [14:48] and i did [14:48] I used and [14:49] lets make it a little more fun [14:49] do the same but this time you are not allowed to use the and operator [14:49] is the question clear ? [14:49] san-D already had the solution [14:49] I used [14:49] i’d just be copying :) [14:50] Yes [14:50] https://notebooks.azure.com/n/Eg3NDOBW9To/notebooks/summertraining.ipynb [14:50] jasonbraganza, you shouldn't have told that :P [14:50] bhavin192 did that iirc :P [14:50] abhinavshirur, :-/ [14:51] okay good work people. [14:51] so if you see the solution without and [14:52] http://sprunge.us/EfjA [14:52] sorry :-/ [14:52] if you see this problem it is a very basic problem [14:52] but not a lot of you got it in the first go [14:53] fhackdroid: We can use nested if else [14:53] that happened because you were not thinking clearly [14:53] this problem actually have a name [14:53] https://paste.fedoraproject.org/paste/YI5TngslL089PC1ZEE2MpQ [14:53] does any of you know that ? [14:54] nope [14:54] ! [14:54] what is that name? [14:54] and please don’t say PEBKAC [14:55] jasonbraganza: what is PEBKAC? [14:56] championshuttler: google. [14:56] got it :) problem exists between keyboard and chair [14:56] nobody knows what this problem is called ? [14:56] cool let me give you something to search for [14:56] this problem is called the fizz buzz problem [14:57] this problem is called the fizz buzz problem [14:57] Oooh ! I solved the same on Hackerearth [14:58] yeah fhackdroid got it [14:58] :) dont know why they give such a typical name [14:58] Fizz Buzz Test [14:59] https://stackoverflow.com/questions/9461446/c-programming-the-fizzbuzz-program [14:59] fhackdroid - is that what we just did? [14:59] It's working for & too instead of and. Is this correct or not? [15:00] anuGupta, & is bitwise and not logical and [15:00] Yup but it gave the correct answer so asked [15:00] ikshitij, yes [15:00] any questions till now ? [15:00] jasonbraganza, yes that is what you did :) [15:00] i always thought FizzBuzz was something complicated :P [15:01] ! [15:01] jasonbraganza, well you uncomplicated the complicated [15:01] next [15:01] unrelated to the clas question [15:01] next [15:01] how legal is it to use the youtube-dl module to download music lists? asking because samridhia is using the module as an example and I’m worried for her. should she change her blog post? [15:01] which distributed services you know about/use/heard ? e.g. SVN is distributed [15:01] It's working for & too instead of and. Is this correct or not? [15:02] Why is it giving correct output [15:02] pie3, class is going on [15:02] anuGupta, You should figure it out why it is working. What is the result of 1&0? [15:02] jasonbraganza, AFAIK it is not legal [15:02] how to jump into class [15:03] jasonbraganza, are there any legal issues with modules too? [15:03] Oh yes thanks ashwanig [15:03] jasonbraganza, she should read more about copyright [15:03] samridhia: legal issues are with dowloading content without permission i think [15:03] anuGupta, https://stackoverflow.com/questions/22646463/difference-between-and-boolean-vs-bitwise-in-python-why-difference-i [15:03] jasonbraganza, samridhia, let's discuss it after class [15:04] samridhia, not the module, but *what* you download I think [15:04] Ok fhackdroid [15:04] bhavin192, ok i will now read everything about copyright. [15:04] hope that answers your question [15:05] jasonbraganza: downloading content from YouTube is illegal, doesn't matter you use x module or y module or you are FBI officer :) [15:05] okay guys so do you guys know about the data structure called list in python ? [15:05] fhackdroid, Yes [15:05] Yes, I know [15:05] yes [15:05] yes [15:05] No [15:05] no [15:05] yes [15:05] yes [15:05] Yes [15:05] yes [15:05] yes [15:06] so in your python shell wrote fruits = ["apple", "papaya", "banana"] [15:06] s/wrote/write [15:06] *write [15:06] tell me when done ? [15:06] done [15:07] done [15:07] done [15:07] done [15:07] done [15:07] done [15:07] done [15:07] done [15:07] done [15:07] done [15:07] done [15:07] done [15:07] done [15:08] Yes [15:09] try fruits[0] [15:10] done [15:10] it prints apple :) [15:10] apple [15:10] apple [15:10] apple [15:10] apple [15:10] apple [15:10] apple [15:11] now try len(fruits) [15:11] 3 [15:11] 3 [15:11] 3 [15:11] 3 [15:11] 3 [15:11] 3 [15:11] 3 [15:11] 3 [15:11] 3 [15:12] 3 [15:12] 3 [15:12] 3 [15:12] 3 [15:13] awesome now you know how to extract an element form the list and you know how to find the length [15:13] can you guys try a printing each element in the list ? [15:13] yes [15:14] yes [15:14] done [15:14] any questions regarding the problem ? [15:14] done [15:14] done with print(fruits[0]) [15:14] done [15:15] post your solutions here [15:15] for i in (fruits): [15:15] ... print (i) [15:15] jasonbraganza: Error: ".." is not a valid command. [15:16] ! [15:16] https://paste.fedoraproject.org/paste/Xz0ZiJMvV3Ci3dXwQnnKzw [15:16] print(fruits) [15:16] simply fruits will also give the list but in brackets [15:16] https://www.irccloud.com/pastebin/NThyk5k2 [15:16] jasonbraganza, why the brackets around fruits ? [15:16] done [15:17] jasonbraganza, variable name [15:17] for i in range(len(fruits)): [15:17] fhackdroid - mistake! sorry [15:17] atul9162, can you iterate over the list using a for loop and print it [15:17] print (fruits[i]) [15:17] yes [15:17] done [15:17] https://notebooks.azure.com/championshuttler/libraries/dgplug1/html/scoobydoo.ipynb [15:17] https://notebooks.azure.com/n/Sj7eturEzLc/notebooks/summertraining.ipynb [15:17] done fhackdroid [15:17] :) [15:18] for i in fruits: [15:18] print(i) [15:18] championshuttler, try the same with for loop [15:19] https://repl.it/KADY/1 [15:19] ashwanig - for fruit_salad_ingredient in fruits: print (fruit_salad_ingredient) [15:19] https://notebooks.azure.com/kshitiz/libraries/dgplug/html/summertraining.ipynb last line [15:19] fhackdroid: ok :) [15:19] ikshitij, good try :) [15:20] so you guys should look into https://notebooks.azure.com/kshitiz/libraries/dgplug/html/summertraining.ipynb [15:20] and https://www.irccloud.com/pastebin/NThyk5k2 [15:21] these are two ways to iterate through the list [15:21] https://notebooks.azure.com/skat-sd/libraries/dgplug/html/summertraining.ipynb [15:21] understood [15:21] the second link is more readable than the first one [15:22] is anything wrong wih my method? [15:22] atul9162, nope its perfect [15:22] How to print on the same line? [15:23] ok, thanks [15:24] https://repl.it/KADY/2 [15:24] have a look at this ^ [15:24] ! [15:25] readability counts [15:25] next [15:25] same [15:25] how do we print them in the same line? [15:25] anuGupta, http://lmgtfy.com/?q=how+to+print+in+the+same+line+in+python [15:26] ashwanig: :D [15:26] print(i, end='') [15:26] skat-sd, ^ [15:26] anuGupta ^ [15:26] yes, thanks [15:26] anuGupta: use 'end = ''"' [15:26] okay your code is an art [15:26] take it that way [15:27] try to use meaningful variable names [15:27] the more the readability the better it is [15:27] https://notebooks.azure.com/kshitiz/libraries/dgplug/html/summertraining.ipynb anuGupta [15:28] okay so ready for one more question [15:28] shoot [15:29] jasonbraganza: Ready with weapon and Armor ? :P [15:30] ikshitij: he is ready with machine gun :P [15:30] Given a list basket = ["apple", "banana", "pineapple", "mango"] pick out the fruits whoes name starts with a vowel [15:31] any questions till now ? [15:31] Print those or store in another list ? [15:31] print the once starting with a vowel [15:32] now remember the quality of code matters with this one [15:32] so think twice before naming your variables [15:32] any more questions regarding the session ? [15:33] fhackdroid - please do more? [15:33] done [15:33] jasonbraganza, ? [15:33] https://notebooks.azure.com/n/Sj7eturEzLc/notebooks/summertraining.ipynb [15:33] fhackdroid sessions :) [15:33] https://repl.it/KADY/3 [15:34] fhackdroid: https://notebooks.azure.com/kshitiz/libraries/dgplug/html/summertraining.ipynb [15:34] asraisingh, your code has errors [15:34] https://paste.fedoraproject.org/paste/pe4~ztsUXB2v76MT0VkjwQ [15:34] fhackdroid: error solved. [15:35] ashwanig, you can improve it , you already used in operator why to shy in using it [15:36] jasonbraganza, hahah thanks i will take that as a compliment :) [15:36] https://notebooks.azure.com/n/ogZH3FMbmNQ/notebooks/summertraining.ipynb [15:36] fhackdroid: check mine https://notebooks.azure.com/kshitiz/libraries/dgplug/html/summertraining.ipynb [15:36] samridhia, correct but you can improve on readability [15:37] what about mine? [15:37] fhackdroid, ok working on it. [15:37] ikshitij, now that is quality , good work :D [15:38] okay people so it is time for me to wind up :) [15:38] fhackdroid: :) [15:38] fhackdroid: https://notebooks.azure.com/n/Eg3NDOBW9To/notebooks/summertraining.ipynb [15:38] https://paste.fedoraproject.org/paste/8XFuzcz2JZEQGGtv6SX6uw [15:38] hope you learnt something new, hope I was able to add value. [15:39] thanks for bearing with me and my mistakes [15:39] fhackdroid, I did. Thanks for the session :) [15:39] thanks for this nice session fhackdroid :) [15:39] fhackdroid, thanks! [15:39] Hope you guys keep practicing and keep learning we can discuss few things after the session [15:39] thnaks fhackdroid. [15:40] so final roll call [15:40] Jason Braganza [15:40] Ashwani Kumar Gupta [15:40] Abhishek Singh [15:40] Kshitij [15:40] Priyanka Sharma [15:40] Mayank gupta [15:40] Samridhi Agarwal [15:40] Anu kumari Gupta [15:40] Saikat Dey [15:40] Krishnanand Rai [15:40] Devesh Verma [15:40] Shivam Singhal [15:40] Abhinav Shirur [15:40] Bhavin Gandhi [15:40] Mohit ----END CLASS----