[15:05:08] [## Class Started at Mon Aug 8 15:05:08 2016 ##] [15:05:08] startclass [15:05:12] Roll Call [15:05:13] Rhitik Bhatt [15:05:17] hemanth [15:05:17] Akshay Shipurkar [15:05:23] Rahul Bhattacharjee [15:05:23] sandeep kumar choudhary [15:05:31] Tabrez khan [15:05:34] mspreddy [15:05:35] Abhishek GUpta [15:05:35] Mamoon Manzoor [15:05:50] surendhar [15:05:52] jogender kota [15:05:52] Aman Kumar [15:06:04] Rohan Hazra [15:06:54] Okay [15:06:56] Buvanesh Kumar [15:07:02] Seems like we lost a few names :) [15:07:16] Anyway, anyone remembers what was the last session we had? [15:07:17] Anushil Kumar [15:07:43] You had given us a task [15:07:51] security topic i think [15:08:53] We did a practice exercise on what nick was mentioned the most by each nick. [15:08:59] kushal: 'Who talked to whom how many times on channel' this task [15:09:14] abhishekg5, Okay [15:09:17] good [15:09:32] What was the last chapter we discussed from the book? [15:10:03] Ashwani Pandey [15:10:05] roll call Abhishek Rai [15:11:28] strings? [15:11:37] Did we discuss functions? [15:11:38] kushal: it would be great if i can know the book we are following, i haven't been here for the past 2-3 weeks. :) [15:11:48] Strings I believe. Can someone else confirm this ? [15:11:53] thisisashwani, now it is your fault not to follow the logs. [15:12:02] http://pymbook.readthedocs.io/en/latest/ [15:12:04] thisisashwani, we published the logs. [15:12:28] Roll Call : Kshitij [15:12:42] roll call: Prashant Jamkhande [15:12:57] Roll Call: Abhishek Shrivastava [15:13:08] No kushal we did not discuss functions. [15:13:13] kushal: i am going through the logs only right now, but if i can get the link for book right now, it would be easy for me today! [15:13:20] Roll Call: Aniketh Girish [15:13:33] skarale is now known as skarale_leaving [15:13:34] kushal I don't remember you discussed functions ! [15:13:40] kushal, buvanesh_kumar: thanks! :) [15:13:41] Roll call: An\antha krishnan PTA [15:13:48] Functions we wrote. But have not discussed. [15:13:55] Okay [15:13:59] so that is [15:14:57] https://shellshare.net/r/summertraining [15:16:08] So there are times when we need to do similar action in different parts of our code. [15:16:14] We do this using functions. [15:16:40] Let us see the shell, if you have question as here by typin ! [15:16:44] * typing [15:17:30] Sorry but I joined late, could you paste the link to shell again? [15:17:39] roll call: Priyanka Sharma [15:17:45] Roll Call : Krishna Biradar [15:17:50] tgtanya, https://shellshare.net/r/summertraining [15:17:52] tgtanya: https://shellshare.net/r/summertraining [15:18:32] hey guys I apologize but I am a bit out of the loop here. What is today's training for? [15:19:10] As you can see we start the definition with def [15:19:17] and then the function name [15:19:28] in this case functionname is the name :) [15:19:38] It does not take any argument/parameter [15:19:56] and inside the function, I am just printing Hello [15:20:16] So let me call the function [15:20:32] roll call: Akhilesh Dhaundiyal [15:20:34] ChaKu_: We are doing python functions right now. https://shellshare.net/r/summertraining [15:20:51] roll call: Shantanu Acharya [15:20:59] roll call: Anupama Mandal [15:21:02] Cool! [15:21:10] roll call: Chaitanya Kukde [15:21:17] Is there any questions still now? [15:22:59] fine [15:23:11] no [15:23:27] No [15:24:29] ! [15:24:34] next [15:24:37] next [15:24:51] instead of return we can write print also in add function() ? [15:25:04] Aizen, yes, let me show you the difference [15:26:39] SpEcHiDe: Roll Call: Shrimadhav U K [15:26:39] Means we use return statement to actually return something from a function which we may use later [15:26:48] Aizen, is that useful? [15:26:50] ok [15:26:54] yuip :) [15:27:09] So remember that part. [15:27:18] When to print, and when to return things from a function. [15:27:26] ! [15:27:27] that means both have the same functionality [15:27:36] Aizen, no [15:27:42] ? [15:27:47] Aizen, add2 adds a and b, and then prints it [15:27:53] yes .. [15:27:54] but we don't get back the result [15:28:16] means there is no way for program to find out the answer, so that it can not be used later. [15:28:21] which is true for add [15:28:24] next [15:28:33] ok .. [15:28:36] Aizen: if you want the value in another variable, you'll have to use return not print [15:28:49] is there any value stored in y at present? [15:28:57] Aizen: when we use return we can save that value in any variable but in case of print we cannot do so [15:29:17] tgtanya: no [15:29:22] tgtanya, No :) [15:29:22] Roll Call: Mriyam Tamuli [15:29:38] tgtanya, can you see it? [15:29:52] So the print command does not return a 1 or 0 depending on success? [15:30:09] tgtanya, print function shows the the value on the STDOUT [15:30:15] it does not return anything. [15:30:26] okay [15:30:27] tgtanya, you will have to write a return statement for return [15:30:56] ! [15:31:00] tgtanya, now tell me what will be returned if I call cheat(212, 3223) [15:31:01] ? [15:31:03] next [15:31:06] Roll Call : Saurav Saha [15:31:28] Roll call Madhuri Muley [15:31:41] Sorry for being late, cause the last time I saw the topic of the channel, it was mentioned that the session is at 7pm [15:31:43] Why did type(y) showed error of "nonetype" even though its not a string ? [15:31:55] SRvSaha, yes, and I don't know why, I am sorry for it. [15:31:57] roll call : Akash Mishra [15:32:09] kushal: 1 [15:32:15] tgtanya, Yes, correct. [15:32:23] aniketh_, it never showed error. [15:32:32] aniketh_, it showed the correct type of y [15:32:34] which is None [15:32:56] Kushal: 1 [15:33:04] https://www.irccloud.com/pastebin/C0fCt6S5/ [15:33:18] that is the error that I got [15:33:37] kushal, sorry I read as an error my mistake. [15:34:17] Ananthu: indentation problem in your code [15:34:27] sandeepk, correct. [15:34:35] next [15:34:35] indentation [15:34:38] kushal: :-) [15:35:03] Can I continue? [15:35:08] yes [15:35:10] Ananthu: give four space and don't mix spaces and tab. [15:35:28] Okay [15:35:32] default value. [15:35:33] ! [15:35:45] Many times we want to have a default value for an argument. [15:36:07] Means if it is not passed to the function call, we will have a default value. [15:36:13] Let us do it now. [15:37:42] Now any questions on that example? [15:38:02] For the people joining late, https://shellshare.net/r/summertraining [15:38:19] ! [15:38:30] ! [15:38:30] next [15:38:38] what is the difference between tab and space [15:38:40] How it adds two values [15:38:57] we didn't mention + [15:39:10] or any additional statements [15:39:15] buvanesh_kumar, we did [15:39:22] buvanesh_kumar, check code properly [15:39:23] >>> def add3(a, b=10): [15:39:23] ... return a + b [15:39:33] buvanesh_kumar, ^^ see, a + there. [15:39:45] oh from the top. got it thanks [15:39:49] Kushal that means if we will pass value of b then it will replace previous value (10) [15:40:14] Yes [15:40:18] If we won't ! It will b as defined in function ! [15:40:47] yes [15:40:58] ! [15:41:02] roll call : deepanshu kapoor [15:42:03] Ananthu: have look on this --> http://www.secnetix.de/olli/Python/block_indentation.hawk [15:42:10] next [15:42:24] asked. got answer. thanks [15:42:25] next [15:42:26] next [15:42:52] can we set the value for b=10 permanently for the function [15:43:01] Roll Call: Avik Mukherjee [15:43:33] hell_o is now known as acetakwas [15:43:37] aniketh_, means? [15:44:02] aniketh_, like this? [15:44:05] aniketh_, add10? [15:44:18] Roll call : Poonam Jadhav [15:45:09] Kushal, Yes. [15:45:20] :) [15:45:22] next [15:46:01] but it should not accept any values while in function call [15:46:05] Now everyone, write me a function which is return True if the argument to the function can be divided by 2, or else return False. [15:46:24] def by_two(number): [15:46:31] Now if i define a value for a and call the function. it will add the a and b values ? [15:46:36] batul I understood. Thank you. [15:46:37] ^^ do not show me here, just tell done here. [15:46:49] buvanesh_kumar, try and see [15:47:02] ! [15:47:08] kushal I think he is asking we can set value of b permanently for the function ? like Here when we are passing a value of b to function. It's replace value of b ! [15:47:40] But what if we want to set b = 10 permanently ! [15:48:15] in the first line write, b = 10 :) [15:48:32] without smiley [15:48:35] next [15:48:39] did you discussed the last problem? I joined late :( can i find it in the log later? [15:48:44] haha [15:48:49] ! [15:48:50] avik, No [15:49:03] avik, we started fresh from the function chapter. [15:49:05] next [15:49:11] kushal, inside the function right ? [15:49:14] oh ok [15:49:16] aniketh_, yes [15:49:31] I am getting anonymous error [15:49:32] kushal , okay [15:49:42] can you please see that => https://paste.fedoraproject.org/404352/ [15:50:26] buvanesh_kumar: give the argument [15:50:28] buvanesh_kumar, Please pass argument to add10 [15:50:32] buvanesh_kumar, yes, you have to call the function with the argument [15:50:34] add10(a) [15:50:46] >>>print(add10()) [15:51:03] rahuldecoded, wrong [15:51:09] Sorry [15:51:09] gave argument. now works. thanks kushal abhishekg5 PrashantJ [15:51:10] you are not passing the value of a [15:51:22] cool [15:51:29] >>>print(add10(0)). Typo! [15:51:31] ! [15:52:44] next [15:52:47] http://paste.fedoraproject.org/404353/70664276/ [15:52:56] can you please help me with this ? [15:53:16] kushal: function body of def by_two(number) https://da.gd/vzW5P [15:53:34] done tp://paste.fedoraproject.org/404355/64352147/ [15:53:42] Aizen, its 'False' and 'True' [15:53:48] http://paste.fedoraproject.org/404355/64352147/ [15:53:50] Aizen true not TRUE [15:53:54] sandeepk, aman_ this is exactly why I asked not to paste :( [15:53:59] need to write True and false in '' ? [15:54:04] Why can not people read what I am writing :( [15:54:05] Aizen, use % instead of / [15:54:09] Aizen, no [15:54:28] kushal , is this right ? https://paste.fedoraproject.org/404358/14706643/ [15:54:31] Aizen, 'True' without quotes [15:54:31] Aizen: it's not TRUE. It's True. Same with False [15:54:45] ok [15:54:46] kushal: oops sorry :), in excitement i do that :( [15:54:51] Aizen, give quotes to true or false [15:55:21] snarwade, ? [15:55:42] kushal, he havnt given quotes to string [15:55:51] aniketh_, use return statement not 'print' [15:56:04] snarwade, that is supposed to be bool [15:56:06] not string [15:56:18] Aizen, also the logic is wrong [15:56:28] kushal, oh sorry, right [15:56:36] Aizen: yes. use modulo % [15:56:50] PrashantJ, okay. No other problems right ? [15:56:52] my 2ยข: http://paste.debian.net/787429/ [15:57:41] aniketh_,Please try. We are here.:) [15:58:09] done [15:58:18] aniketh_, use == instead of = [15:58:18] PrashantJ, Thanks [15:58:46] http://paste.fedoraproject.org/404361/70664679/ [15:59:10] poonam, No. [15:59:16] poonam, issues in that code [15:59:23] 1. You gave a different name [15:59:32] 2. y is string [15:59:54] okay kushal [15:59:55] poonam, why true don't have ( ), ? [15:59:56] 3. You are giving () brackets in the if statement, [16:00:13] 4. You are printing without () [16:00:25] you are supposed to return [16:01:07] PrashantJ, http://paste.fedoraproject.org/404362/66481514/ hope this is right ? [16:01:25] shridhar is now known as shridhar`brb [16:01:31] aniketh_, True and False without quotes [16:01:45] kushal, https://paste.fedoraproject.org/404363/47066488/ [16:02:13] snarwade, wrong, that is not the name I told [16:02:17] People stop. [16:02:24] Please learn to read the problem first. [16:02:31] it is not difficult. [16:02:37] But it will surely help in life. [16:03:56] but snarwade solution working for me. how it's wrong ? [16:04:14] buvanesh_kumar, function name is by_two [16:04:41] thanks kushal [16:04:42] buvanesh_kumar, as I said, please learn to read. [16:05:21] snarwade, i used your method => https://paste.fedoraproject.org/404366/ [16:06:18] ok thanks kushal [16:07:09] shridhar`brb is now known as shridhar [16:07:10] So, please try to read the chapter http://pymbook.readthedocs.io/en/latest/functions.html tonight. [16:07:24] Tomorrow we will try solve various things by writing functions [16:07:36] Feel free to ask questions here. [16:07:39] Roll Call [16:07:45] Prashant Jamkhande [16:07:45] Abhishek Gupta [16:07:49] sandeep kumar choudhary [16:07:50] Akhilesh Dhaundiyal [16:07:51] Anushil Kumar [16:07:54] Tabrez khan [16:08:04] Mamoon Manzoot [16:08:07] Rohan Hazra [16:08:10] Anupama Mandal [16:08:15] Mriyam Tamuli [16:08:16] Moiz Sajid [16:08:19] jogerder kota [16:08:21] Deepanshu Kapoor [16:08:29] Chaitanya Kukde [16:08:29] Buvanesh Kumar [16:08:40] Akash Mishra [16:08:45] poonam jadhav [16:08:50] Priyanka Ambre [16:08:52] Akash Ganbote [16:08:56] Kshitij [16:08:57] Avik Mukherjee [16:09:04] Priyanka Sharma [16:09:04] SpEcHiDe: Shrimadhav U K [16:09:06] yash bhadrwaj [16:09:07] Madhuri Muley [16:09:16] Aniketh Girish [16:09:17] yash bhardwaj [16:09:34] Harsh Vardhan [16:09:36] Shantanu Acharya [16:09:51] endclass [16:09:51] [## Class Ended at Mon Aug 8 16:09:51 2016 ##]