[13:50:49] [## Class Started at Tue Jul 9 13:50:49 2013 ##] [13:50:49] startclass [13:50:52] ok thanks [13:51:01] ----------SESSION STARTS------------ [13:51:09] Thank you [13:51:19] ROLL CALL [13:51:21] Pritha Ganguly [13:51:22] siddhant sengar [13:51:22] Priyanka Kotiyal [13:51:23] Rahul Chowdhury [13:51:24] amresh kumar [13:51:24] manish jain [13:51:25] Anisha Agrawal [13:51:25] Avinash Kumar Dasoundhi [13:51:26] Christina Beemer [13:51:27] Josep Caselles [13:51:30] elita lobo [13:51:30] puja Gupta [13:51:31] Sudip Gorai [13:51:32] Shungoh Kaetsu [13:51:33] sonam [13:51:34] iam_sudip [13:51:35] kavis khandelwal [13:51:36] Nilanjit Mitra [13:51:36] supriya saha [13:51:36] Bidisha Mukherjee [13:51:50] puspita ghosh [13:51:53] Aanchal [13:51:54] Sheesh Mohsin [13:52:09] kushal,ok but what is wrong in my email. [13:52:19] shalini, your email does not seem be a reply [13:52:37] shalini, It seems to be a new email with that subject line [13:53:03] prikotiyal, why you submitted same hometask twice ? [13:53:25] kushal, sorry [13:53:25] prikotiyal, please answer [13:54:17] Shantanu Sarkar [13:54:20] prikotiyal, please follow the instructions properly, in future we will start kicking out people from session for not following the instructions [13:54:27] shantanu, sleeping ? [13:54:36] ravi kumbhlkar [13:54:40] kushal, sorry i was away. [13:54:43] Rashmi [13:54:50] same goes to rashmi [13:54:50] kushal, i apologize.I wont repeat it further [13:54:56] sorry [13:55:02] Shalini Roy [13:55:02] kushal, ok thanks [13:55:03] kushal, sorry my net was deconnected [13:55:03] kushal, i will reply . [13:55:40] prikotiyal, also do you know that after full stop we give a space to start a new English sentence ? [13:56:15] kushal, yes. sorry again [13:56:19] dot|not, [13:56:37] now 15 minutes Q&A (at max) [13:56:42] questions anyone ? [13:56:59] ! [13:57:26] ! [13:57:27] rashmi, ask [13:57:57] ! [13:58:15] output of 'india' and 'india\'s best' is different [13:58:45] ! [13:58:52] rashmi, is that a question ? [13:59:14] Christi123, ask [13:59:16] kushal # is comment, So in the begining of sha-bang there is a # what does that imply ? [13:59:22] [14:00:04] Christi123, sha-bang is a special case for the shell, using that we tell the shell to use a particular interpreter for that file, it is not part of python [14:00:08] J_Caselles, ask [14:00:25] ! [14:00:29] shalini, ask [14:01:01] I understand tuple concept, but don't trully folow when you explain that the swapping proces has to do with this. [14:01:01] ! [14:01:07] kushal,i haven't got the mail from mailing list that's why i have sent new email. [14:01:50] J_Caselles, ok explaining the next lines [14:01:58] shalini, ah [14:02:09] shalini, I will tell you after session [14:02:16] J_Caselles here [14:02:27] yes [14:02:32] (10, 20) -- is tuple with two values, correct ? [14:02:37] yes [14:02:39] kushal, ok thanks. [14:02:44] a = 10 [14:02:46] b = 20 [14:02:52] (a, b) [14:03:05] J_Caselles, you can understand the above statement ? [14:03:08] a, b [14:03:11] sure [14:03:13] try this one too [14:03:49] so in that right hand of the assignment, we write b, a [14:03:58] so it becomes ( 20, 10) [14:04:18] ok! [14:04:19] and then in the left hand it gets assigned to (tuple unpacking) a, b [14:04:24] which is (a, b) [14:04:28] J_Caselles, is it ok now ? [14:04:54] yes. then tuple unpacking means assignment of the multiples variables, right? [14:04:59] yes [14:05:03] using tuple [14:05:07] ok, nice, thanks [14:05:07] dot|not, ask [14:05:58] anisha, ask [14:06:16] number = float(raw_input("")) here why do we have to specify the datatype? [14:06:20] any other question ? [14:06:27] I was just wondering why you are always talking of Shabang. I learned it as "Shebang". Googled it and found out that both variants are legitimate. Question solved. Thank you. [14:06:35] dot|not, ok [14:06:45] [14:07:07] anisha, we are not specifying the data type, we are doing type casting [14:07:17] raw_input returns string [14:07:24] we need to convert it to float [14:07:36] anisha23, does this answer your question ? [14:07:44] yes, thanks :) [14:09:01] ! [14:09:14] nilanjit, ask [14:09:23] Having problem in git push [14:10:29] nilanjit, buy a guitar and sing a song, YMCA if possible [14:10:46] next question please [14:10:51] a proper question [14:10:55] ! [14:10:55] This is the error i am getting http://www.fpaste.org/23940/33784411/ [14:11:27] nilanjit, answer is also given in that paste [14:11:30] Christi123, ask [14:11:37] kushal can we import any module. Is the visibility of modules public [14:11:54] even git pull is giving an error [14:12:14] Christi123, there is no private module [14:12:22] [14:12:26] nilanjit, we will look at git issues after session [14:12:34] nilanjit, ask help from your friends later on [14:12:35] nilanjit: "Giving an error" is no valid description. You should wait until the lass is over. Someone will probably find time to help you. [14:12:43] Args. Sorry kushal. [14:12:53] dot|not, no problem [14:13:17] any more python question ? [14:14:16] I forgot till what chapter I asked you all to read yesterday ? anyone ? [14:14:22] 3rd [14:14:26] 3rd. [14:14:26] ok [14:14:26] 3 [14:14:28] 3rd [14:14:33] 3rd [14:14:36] kushal, okay, thank you, it is taking huge time to paste for slow internet. [14:15:17] you all read 4th chapter later on [14:15:23] now moving to 5th chapter [14:15:28] conditional statements [14:15:41] these will help us to evaluate a condition [14:15:47] if condition: [14:15:52] statement1 [14:15:58] statement2 [14:16:22] all indented lines will be evaluated if the condition is true [14:16:28] s/true/True/ [14:16:29] What kushal meant to say was: all indented lines will be evaluated if the condition is True [14:16:53] same goes to else [14:17:03] we can also have elif statements [14:17:31] a = 10 [14:17:33] b = 20 [14:18:00] korak_ is now known as korak [14:18:01] write a program in the interpreter to print "hello" if a is greater than b or else print "zero" [14:18:12] ^^ everyone do it and then show us using pastebins [14:18:46] kushal, can you please repeat your question ? my internet was down [14:19:10] rahulch_, I wrote it after you came to this channel, nothing to repeat [14:19:31] ok got it [14:20:16] kushal, http://fpaste.org/23945/37337899/ [14:20:32] tutum, good [14:20:35] http://is.gd/K7VQ19 [14:20:53] tutum, can you please explain what you are doing in the code to others ? [14:21:18] Armageddon, wrong link [14:21:19] http://www.fpaste.org/23946/33790881/ [14:21:27] kushal, no, it needed time to upload [14:21:29] :p [14:21:52] kushal, http://fpaste.org/23947/73379115/ [14:21:57] puspita, you never wrote it in the interpreter as I asked [14:22:08] http://fpaste.org/23948/73379126/ [14:22:09] kushal ohh sorry [14:22:22] kushal, does my link work ? [14:22:29] okay. I assigned variable a to a value 10 and b to a value 20 and gave the condition that if a is greater than b then the program should print "Hello" [14:22:44] http://paste.fedoraproject.org/23950/ [14:22:45] else if a is less than or equal to b then zero would print out [14:22:46] Armageddon, no, that points to an image [14:22:52] kushal, http://is.gd/rV4bK3 [14:23:03] http://fpaste.org/23951/37918813/ [14:23:06] better [14:23:14] kushal: http://www.fpaste.org/23953/73379201/ [14:23:14] as a is less than b in this case, zero was printed. [14:23:36] kushal: http://www.fpaste.org/23954/ [14:23:42] it is correct for everyone else [14:23:45] kushal, fpaste.org/23952/73379194/ [14:24:00] Armageddon, please pass pastebin links as text is smaller than an image [14:24:03] kushal, http://fpaste.org/23958/ [14:24:04] http://www.fpaste.org/23956/79229137/ [14:24:10] kushal,http://fpaste.org/23955/33792221/ [14:24:25] http://fpaste.org/23959/ [14:24:34] I not checking these [14:24:36] * J_Caselles needs to forget about using xterm. Needs copy/paste urgently [14:24:39] kushal, http://www.fpaste.org/23956/79229137/ [14:24:57] http://www.fpaste.org/23961/37930113/ [14:24:59] you can check yourselves later [14:25:07] kushal, http://www.fpaste.org/23962/13733793/ [14:25:27] http://www.fpaste.org/23963/33793291/ [14:25:42] next chapter is looping [14:25:51] http://fpaste.org/23964/33793611/ [14:26:02] please read that chapter and ask any question you have (read it now) [14:26:06] during the session [14:27:09] ! [14:27:14] kushal,http://fpaste.org/23966/37941513/ [14:27:31] puspita, ask [14:27:31] kushal: http://pastebin.com/vwk9XVbb [14:27:41] kushal: how do we specify the boundary of while loop? [14:28:00] puspita, like while n < 10: ? [14:28:34] yes like when n < 10: then how many statements will it execute? [14:28:58] if there are other statements after the while loop how do we distinguish? [14:29:28] with the indentation [14:29:39] ok. [14:29:42] puspita, ^^ [14:30:00] remember, indentation is the key here [14:30:17] kushal got it thanks. J_Caselles thanks [14:32:05] ! [14:32:48] dell, ask [14:33:23] i power series example u wrote term < 0.0001, is their any inbuilt function available such as pow in C? [14:33:35] s/i/in [14:33:46] s/u/you [14:33:51] ^ Captain Cryptography strikes again. [14:34:04] And yes, there is such a function. [14:34:40] dell, yes, that example is wrong iirc [14:35:59] kushal: tell us the function if we will have to compare an accurate value. so. [14:36:44] ! [14:37:45] dell, what about pow ? [14:37:49] Christi123, ask [14:38:06] In lists what is a[-1] does the index of elements in descending order start from -1 [14:38:19] Christi123, counting from the end [14:38:34] kushal: pow is used in C [14:38:42] heh [14:39:03] ok and what is the meaning of a[0:-1] [14:39:12] [14:39:23] dell, and see if it works in Python or not ? [14:39:35] Christi123 +1 [14:39:43] ok. i will [14:39:47] [14:39:51] Christi123, from the first element to the element just before the last one [14:40:05] rahulch_ is now known as rahulch [14:41:24] kushal, if it is considering the first element like a[0] why isn't it considering the last element a[-1]. What would be the expression if i had to print all the elements ? [14:42:25] Christi123, to print, use a for loop [14:42:33] praveenkumar_ is now known as praveenkumar [14:42:52] >>> a = [1, 2, 3] [14:42:52] >>> print a[-1] [14:42:52] 3 [14:42:58] Christi123, ^^ [14:43:59] kushal, Thank you :) [14:47:11] ! [14:49:55] J_Caselles, ask [14:51:05] J_Caselles, ? [14:51:27] anyone else if you have any question please ask [14:51:27] print has the exact same format as printf of C? or there's anything different? [14:51:41] format string options are same [14:51:57] thanks [14:54:29] ! [14:54:33] puspita, ask [14:55:06] kushal what does this specify range(1,15,3) [14:55:22] puspita, type in the python interpreter and see :) [14:56:37] puspita, remember to write [14:56:48] kushal: these values are predefined. [14:56:59] puspita, which values ? [14:57:12] kushal: range values [14:58:08] puspita, no, you are deciding them when you call that range function [14:58:24] in your example it starts from 1 , before 15 [14:58:30] and increases by 3 [14:58:30] ! [14:58:33] elita15, ask [14:58:45] kushal: ok thanks [14:59:21] ! [14:59:39] ravi_pro, ask [14:59:51] what does a[0:1:4] mean? [14:59:53] kushal, if the range(13,1,3) [15:00:07] kushal, will it be possible? [15:00:10] [15:00:12] [15:00:26] ravi_pro, you yourself should be able to answer that question [15:01:19] elita15, where you found that ? [15:01:31] kushal, but i it is ginving only "[]" as output [15:02:18] ravi_pro, isn't it supposed to be ? you are starting from 14 and adding 3 everytime till you are less than 1 [15:02:27] rahulch: 13+1=14 so it is greater than 1 [15:02:39] starting from 13 [15:02:42] iam_sudip, thanks [15:03:07] kushal, but i want to decrese the number by 3 from 13 to 1 [15:03:16] ravi_pro, guess guess :) [15:03:17] use range(13,1-3) it will get you to your desired output. [15:03:23] iam_sudip, what ? [15:03:25] oh sorry. [15:03:27] kushal, i found a[0: :2] on pdf , so i tried a[0:1:4] and got output [1] where a = [ 1 , 342, 2233423, 'India', 'Fedora'] [15:03:51] iam_sudip, thanks [15:03:54] iam_sudip, you missed a comma [15:04:01] range(13,1,-3) will give you the desired o/p [15:04:06] elita15, a[0:1:4] doe snot make any sense [15:04:09] kushal: I just didn't want to say the answer. I typed it before you asked him to guess. [15:04:14] puspita, correct [15:04:19] iam_sudip, no problem :)( [15:04:53] kushal :) [15:05:44] ! [15:05:48] elita15, ask [15:06:39] kushal, i did not understand why do we use two colen here in this a[0: :2] ? what does it mean? [15:06:48] elita15: starting point and ending point both are same as a[0], so it is giving 1. step 4 does not make any sense. [15:07:41] elita15, means we want all values between first and 3rd element including first [15:07:47] that is called slicing [15:09:27] ! [15:10:14] ravi_pro, ask [15:10:14] elita15: it means, it will take the 1st, 3rd, 5th elements and so on [15:10:16] kushal, a[::2]: [15:10:33] kushal, doesnot make me any sence [15:10:36] [15:10:40] ravi_pro, are you sure about the last colon ? [15:11:05] kushal, yes [15:11:16] ravi_pro, why it does not make any sense to you ? [15:11:20] read this like: a[start,end,step] [15:11:34] ravi_pro, ^^^ [15:11:54] who ever finishes the chapter please say done here [15:12:02] kushal, in the middle of the [] why tho colon an after "2" [15:12:04] done [15:12:17] ravi_pro, iam_sudip answered that question [15:12:19] sorry a[start:end:step] [15:12:40] kushal, it takes the first , third and fifth element. can you please explain the output? is it considering every 3rd element? [15:12:43] ravi_pro, read the page 31 [15:13:01] elita15, no, between 1st and 3rd excluding the 3rd [15:13:07] iam_sudip, means it will start from a[0] to a[n] with the difference of 2 [15:13:22] ravi_pro, yes, where n is the length -1 of the list [15:13:59] ravi_pro: yes. Read carefully where the example has given in the book, just below the example. [15:14:06] done [15:14:06] kushal, iam_sudip, thanks i got it [15:14:11] done [15:14:32] rahulch, J_Caselles puspita any question ? [15:14:51] kushal, no :) [15:14:54] done [15:14:54] no [15:15:04] kushal , please check this output http://fpaste.org/23990/37338225/ [15:15:16] done [15:15:32] elita15, checked and ? [15:15:54] well, I need to refresh my math's skills, cause I'm lost with the power series. But this has nothing to do with python :P [15:16:08] J_Caselles, hehe [15:16:16] kushal: have doubts with the game of stick problem [15:16:35] J_Caselles, I promise there will not me much math issues in future during the sessions [15:16:37] puspita, ask [15:16:43] done [15:16:43] if sticks == 1: [15:16:44] print "You took the last stick, you loose" [15:16:49] kushal, i still dont understand why fifth element is considered. [15:16:55] [15:17:10] can't understand why choosing 1 is loosing [15:17:12] fortunately, I can still manage multiplication tables ;) [15:17:35] elita15, which one ? you pasted too many things in one go [15:18:38] puspita, because you are choosing the last stick that is why you are loosing. That is the rule of the game, just like if to score a goal in football you have to send the ball into any net [15:18:38] kushal: I think the program is wrong the e**x program. Pardon me kushal. I don't get it yet. [15:18:53] iam_sudip, what is that ? [15:19:26] iam_sudip, one series program is wrong [15:19:30] sorry kushal, the thirteenth line. and second line it is correct [15:19:30] I forgot which one [15:19:31] sorry I talked in between conversation. [15:19:32] kushal: ok thanks [15:20:08] elita15, yes, they are [15:20:34] can someone please explain elita15 why the 2nd and 13th line is correct in http://fpaste.org/23990/37338225/ ? [15:20:52] elita15: its the 4th element. a start with 0 and not 1. [15:22:10] ^^ (the 13th line) [15:23:07] any other question ? [15:24:40] kushal, thanks i understood the concept of slicing. [15:24:50] done [15:27:00] done [15:27:31] kushal: [OT] the example of cricket bat is great. it's showing you are Indian writer.[page 23] [15:29:21] done [15:30:00] pingall: who all are still reading the chapter ? Please say yes here, so that we wait for you [15:30:00] iam_sudip: [ot] great, i have to learn That crazy game? :) [15:30:15] kirk_iowa, hehe [15:30:19] done [15:30:32] done [15:30:36] done [15:30:36] done [15:30:38] done [15:30:42] done [15:30:48] done [15:30:52] done [15:30:53] done [15:31:06] done [15:31:19] done [15:31:38] Done. [15:31:41] done [15:32:09] one should not say done unless they really are, there is no problem if one goes slow [15:33:01] everyone done or anyone still reading ? [15:33:05] no body said yes [15:33:07] :( [15:33:31] done [15:33:33] kushal,yes [15:33:55] ravi_pro, eh, you said done, now you are saying yes to mark that you are still reading [15:34:10] done [15:34:58] I don't remember, how to find the type of an object ? is it explained in the book till what you read ? [15:35:24] anyone ^^ [15:35:27] no [15:35:28] done [15:35:33] one can use a function called type [15:35:39] type(list) [15:35:42] type(str) [15:35:46] type(int) [15:36:24] type(variable) it will show us. [15:37:13] fewcha_ is now known as fewcha [15:37:29] kushal, i said yes, means i have done [15:37:48] ravi_pro, and I asked different thing to which the answer was yes [15:38:14] kushal, sorry for that [15:38:25] ravi_pro, no problem [15:38:40] to get help on any object or type [15:38:42] do [15:38:46] help(obj) [15:39:07] help(type) -- actually [15:40:03] I think I am sleepy and typing stupid things :( [15:40:26] ! [15:40:31] puspita, ask [15:40:49] press q to exit from the help docs [15:41:07] after typing help(int) it has given me all about it. but i can't understand how to exit from there? [15:41:22] kushal : ohh i just got the answer. thanks [15:41:23] puspita, I answered before you asked :) [15:41:35] kushal : you did :) [15:42:00] anyway read chapter7 and chapter8 for tomorrow's session [15:42:06] ROLL CALL [15:42:11] Avinash Kumar Dasoundhi [15:42:12] Puspita Ghosh [15:42:13] Rahul Chowdhury [15:42:14] amresh kumar [15:42:14] anurag kumar [15:42:16] supriya saha [15:42:17] Aanchal [15:42:17] elita lobo [15:42:18] Anisha Agrawal [15:42:19] sonam banerjee [15:42:22] kirk gunderson [15:42:22] Bidisha Mukherjee [15:42:23] ravi kumbhkar [15:42:24] Shungoh Kaetsu [15:42:28] kavis khandelwal [15:42:28] Josep Caselles [15:42:29] Rashmi [15:42:29] manish [15:42:40] Pritha Ganguly [15:42:46] iam_sudip [15:42:53] avik ghosh [15:43:24] Priyanka Kotiyal [15:43:30] -----------SESSION ENDS--------------- [15:43:32] Shalini Roy [15:43:35] endclass [15:43:35] [## Class Ended at Tue Jul 9 15:43:35 2013 ##]