[15:00:06] [## Class Started at Wed Jul 20 15:00:06 2016 ##] [15:00:06] startclass [15:00:08] vharsh_ is now known as vharsh [15:00:12] Roll Call [15:00:14] Harsh Vardhan [15:00:14] Amit Kokitkar [15:00:15] Priyanka Sharma [15:00:17] Rahul Bajaj [15:00:17] Vaibhav Jain [15:00:17] Abhishek Shrivastava [15:00:20] Akhilesh Dhaundiyal [15:00:23] shobhit upadhyay [15:00:25] Avik Mukherjee [15:00:25] Rohan Hazra [15:00:26] Varsha R [15:00:26] kalyan [15:00:27] Akshay CV [15:00:27] Mahesh Gahlot [15:00:27] Poonam Jadhav [15:00:27] Anupama Mandal [15:00:27] Avinash Madhukar [15:00:30] Utkarsh Shukla [15:00:31] Jogender Kota [15:00:31] goutham [15:00:32] Prashant Jamkhande [15:00:34] Aman Kumar [15:00:35] Deepanshu Kapoor [15:00:36] Krishna Biradar [15:00:44] Amrita Nair [15:00:49] Mamoon Manzoor [15:00:50] Moiz Sajid [15:00:54] Sanyam Khurana [15:00:57] pragnavi [15:01:19] Gobinda Akhuli [15:01:19] sandeep kumar choudhary [15:01:23] chandu [15:01:26] bhanu teja [15:01:29] K Sai Kiran [15:01:30] sairam [15:01:38] kiran [15:01:39] sarath chandrika [15:01:49] mounica [15:01:54] Akhilesh [15:02:04] chaitanya gupta [15:02:17] Sriniketh [15:02:23] Sudeep Mukherjee [15:02:27] Akash Mishra [15:02:33] madhumathi [15:02:38] Revathy Narayankutty [15:02:49] Manoj [15:03:05] Venkitaraman [15:03:14] Dhriti Shikhar [15:03:17] I will take 2 minutes, can not find a server :( [15:03:22] Rahul Bhattacharjee [15:03:34] himavarshini [15:03:41] Abhishek Rai [15:03:52] Madhuri Muley [15:03:58] sindhu [15:04:25] ABHISHEK LAL [15:04:27] ganesh kadam [15:04:53] Harshit Gupta [15:04:54] Okay, who all are complete new to Python (or any other programming)? [15:05:10] i am [15:05:14] IAM [15:05:16] I am [15:05:17] I am new [15:05:17] I am new to pyhton [15:05:18] i am [15:05:25] I am [15:05:27] I AM [15:05:31] i am [15:05:33] i am [15:05:34] I am [15:05:37] me too [15:05:41] i am [15:05:48] . [15:05:49] i am new [15:05:50] I am [15:05:55] i am [15:05:58] I am [15:05:59] I am [15:06:00] himavarshini_ is now known as himavarshini [15:06:01] I am new [15:06:01] i am [15:06:04] iam [15:06:05] i am [15:06:09] i am [15:06:13] i am new [15:06:43] I am new [15:06:49] roll call: Akshay Shipurkar [15:07:08] Sorry I'm late, Roll Call: Sandeep Maity [15:07:32] Okay. [15:07:44] So for the people who already know Python or parts of Python [15:07:54] The programming sessions may look a bit slow at first/ [15:08:01] Because we will go slow. [15:08:22] We will give enough time for everyone to practice. [15:08:38] kushal, We might pick up something new in the way :) [15:09:18] I am new [15:09:22] kushal, most of us are new :) [15:09:27] roll call: Buvanesh kumar [15:09:33] iam also new [15:09:45] i am new [15:09:50] roll call:ananthakrishnan [15:10:33] i am new [15:11:08] roll call:Rohit jaysankar [15:12:38] i am [15:14:01] Okay [15:14:29] I was taking time to check the setup once more. [15:14:30] Now. [15:14:47] So we will start with Python today [15:14:52] I will do demo on shellshare [15:14:54] Roll call: Tosin Animashaun [15:15:06] and we will discus or take questions here. [15:15:15] Roll call : Shaurya Kalia [15:15:22] discuss [15:15:23] Python is a dynamic and interpreted language. [15:15:38] goutham__, thanks [15:15:50] Means we can simply type the code in an interpreter. [15:16:01] Which is python3 in our case. [15:16:07] https://shellshare.net/r/summertraining [15:16:12] I will type there [15:16:19] and I will come here [15:16:56] Roll Call: Shantanu Acharya [15:17:22] Roll call:Amey Jain [15:17:28] Sorry, I am late. I just came back from college, can someone catch me up? [15:17:38] code_geek_, https://shellshare.net/r/summertraining [15:17:49] okay, kushal [15:17:56] >>> in the line means the interpreter is waiting for the next input [15:18:54] That was a typo :( [15:19:00] When I wrote a = 1 [15:19:35] roll call:Yogesh [15:19:44] python created a variable a (though in details it works little bit differently) and store 1 in it. [15:20:02] So now a is 20 [15:20:16] Now is a is 25 [15:20:19] Roll call : Aniket [15:20:27] We can actually print this on the screen [15:20:52] Here print() is a function all, a is the function argument. [15:21:21] I hope this is okay [15:21:37] Roll call : Amol Kahat [15:21:48] yes [15:21:51] kushal: yes [15:21:58] yes [15:21:58] yes [15:22:06] * is for multiplication [15:22:10] Roll Call - Pabitra Pati [15:22:10] yes [15:22:12] yes [15:22:24] / for division [15:22:33] Is this okay? [15:22:41] Don't answer [15:22:43] wait [15:22:45] :) [15:22:52] Okay [15:23:01] ok [15:23:16] Now you can you find the answer if you multiply 324532532453245234532432453237 with 789 [15:23:25] try it out. [15:23:34] If you have a problem, then type ! here [15:24:00] Okay [15:24:05] 256056168105610490046089205603993 [15:24:20] akshays, you don't have to give us the answer. [15:24:22] can anybody please pm me what i missed [15:24:30] ohh sorry ! [15:24:59] /msg pabitra Now you can you find the answer if you multiply [15:24:59] 324532532453245234532432453237 with 789 [15:25:05] pksadiq, ? [15:25:10] oops. sorry [15:25:14] pksadiq, also /query first [15:25:15] :) [15:25:24] ! [15:25:26] next [15:25:38] what if we want to do integer division ? (i am new to python 3) [15:25:54] abstatic, convert the answer to int [15:26:08] kushal, okay. [15:26:15] For everyone else: if you see closely 30 / 2 returns 15.0 [15:26:17] abstatic, If you want to truncate decimal, use // [15:26:31] . [15:26:32] what if want answer to be in float? [15:26:33] roll call: Abhishek Gupta [15:26:50] rohan_h, that is floor division [15:27:00] ! [15:27:01] now the numbers with a . in it are known as floats [15:27:02] like [15:27:04] 1.0 [15:27:09] 1.3245 [15:27:12] 56.7 [15:27:14] if i divide any two numbers,can i have a chance to get the result in reduced fraction form? [15:27:16] 8.0 [15:27:18] kushal, okay :) [15:27:33] next [15:27:53] do we not have to give the datatypes with variables? eg. int a=1 ? [15:28:09] avik no [15:28:17] For some strange reason pabitrapati gave a roll call in the Fedora Cloud channel. [15:28:29] avik, No, as it is a dynamic language, we don't have to. [15:28:45] Check the shellshare [15:29:03] a was integer first [15:29:07] and became float [15:29:25] we can find the type of a variable by using type function [15:29:44] The type() function might be helpful for this [15:29:54] got it :) [15:30:32] avik, its like the variable is a name binding the value and it automatically casts the type unto itslef as per the value [15:30:38] kushal: Ignore what I said [15:30:42] ! [15:30:44] next [15:31:17] Does it makes difference that type(a) command gives type 'int' rather than class 'int' [15:31:19] ? [15:31:58] ! [15:31:59] !! [15:32:25] amey, In Python3 it will tell you class [15:32:46] ! [15:32:51] amey, does it only say int in your case? [15:32:53] next [15:33:11] no it says [15:33:20] I am python 2.7 [15:33:34] Should I download version 3? [15:33:36] amey, which distro ? [15:33:39] amey, so you have to use Python3 for this session. [15:33:41] amey yes [15:33:46] amey, we discussed this on Monday. [15:33:50] next [15:33:52] then how to get the only the int result of 15/2 ? [15:34:20] OK, I will ask beforehand from now on. Thanks. [15:34:31] 15//2 avik [15:34:37] avik, type int(15/2) [15:35:08] deep123k, that will also do :) [15:35:49] ! [15:35:49] ! [15:36:54] What of we want--- >> a=5 >>b=2 a/b >>2.5 [15:37:06] of is if [15:37:14] wait everyone. [15:37:28] There is something called, type conversion. [15:37:36] Where we can convert one type to another. [15:37:41] like (look at shellshare) [15:38:14] int() and float() [15:38:24] Now we also have to have to work with text all the time. [15:38:30] We call them strings [15:38:36] type is str [15:38:48] Can be defined inside a '' or "" [15:38:50] like [15:38:58] ! [15:39:26] Ooops typing error [15:39:43] You can see I started with ' and when tried to end with " it gave error [15:39:59] next [15:40:04] what is difference between print(a) and typing a and than pressing enter both shows a's value. [15:40:17] or they are same [15:40:31] What is the difference between ' ' and " ". I already googled it. But unable to understand. [15:40:43] sandy_, just typing a and pressing enter is only for the interpreter, but for the real program, we will always have to print [15:40:49] sandy_, look closely now [15:41:04] sandy_, can you see the difference? [15:41:14] in print there is no '' [15:41:19] sandy_, Yes [15:41:37] sandy_, and when I typed name and pressed enter, you can guess the type by seeing those '; [15:41:40] sandy_, and when I typed name and pressed enter, you can guess the type by seeing those '' [15:41:49] buvanesh_kumar, why are you asking in the middle? [15:42:02] buvanesh_kumar, there is no difference between '' and "". they are used to represent a string in python. [15:42:09] you can use any of them [15:42:34] next [15:42:38] kushal: got it, thank's :-) [15:42:56] pabitra, please do not answer people who are asking out of turn. [15:42:58] next [15:43:04] buvanesh_kumar, this is your turn. [15:43:05] oh okay. [15:43:26] Got answer :). actually i typed it and get my question ready , i am planned to enter it when my role come, but typo error. pressed Enter [15:43:35] Thanks kushal :) [15:43:52] buvanesh_kumar, Okay [15:43:54] next [15:44:00] +1 kushal pabitra [15:44:17] We can also do like [15:44:21] (watch shellshare) [15:44:24] can u say how to use "IF-ELSE" in python [15:44:57] manoj_, no [15:44:59] manoj_, https://shellshare.net/r/summertraining [15:46:44] I hope this is okay. [15:47:08] kushal, yes [15:47:50] yes [15:47:58] thank uu [15:48:10] manoj_, the spelling is you. [15:48:10] ! [15:48:14] next [15:48:50] is there loops such as for,while in python [15:49:04] venki, yes [15:49:28] is it similar to c [15:50:02] syntax is different. theory is same [15:50:17] ok got it!! [15:50:20] venki, are you new in this session? [15:50:27] venki it is better give time to kushal to teach :) [15:50:27] ! [15:50:30] venki, if yes, then we have rules for asking questions. [15:50:42] meamitk +1 [15:50:49] venki, you type ! (as goutham__ did above) and wait for your turn. [15:50:58] And ask only when batul says so. [15:51:00] is '....' and "......" both are same in string case? [15:51:17] chandu, read the above few lines to venki [15:51:34] So, back to code [15:51:38] yes [15:51:42] oops, sorry kushal i answered questions, out of turn:( [15:51:58] using relational operators we can write condition statements. [15:52:04] Which can check for a condition. [15:52:38] Let us check if a number is greater than 10 or not [15:53:16] if condition: <--- remember that colon at the end [15:53:22] ! [15:53:43] next line starts with ... means it is waiting for the rest of the if statement. [15:53:49] I gave 4 spaces. [15:54:01] then I am going to print a line [15:54:07] sindhu__ is now known as sindhu_ [15:54:20] ! [15:54:34] Next line it is still waiting if there are more lines for the if block. [15:54:40] but we don't have any [15:54:49] so we can end the if block and giving a blank line. [15:55:11] and as the condition is true, it printed the statement (line). [15:55:13] next [15:55:18] ! [15:55:26] can we change the font of text in strings [15:55:46] ! [15:55:50] goutham__, yes, just change the font of the terminal, python does not know what font you are using. [15:55:52] next [15:55:58] is '....' and "......" both are same in string case? [15:56:07] chandu, yes, they are same [15:56:14] chandu, look at the shellshare [15:56:21] ok thank you [15:56:49] print(result [15:56:58] next [15:57:08] kiran_, type in the terminal not on IRC :) [15:57:19] what is the use "white spaces" in python,i could not under stand that [15:58:12] manoj_, very good question. [15:58:25] manish, whitespaces are used for indentation. [15:58:33] by using those, we mark blocks of code. [15:58:43] ! [15:58:59] ! [15:59:04] like in that if statement, all the lines to be executed when the statement is true, has to be properly indented with 4 spaces. [15:59:11] look at the shellshare [15:59:36] as I started randomly after giving one space, it is giving me error. [15:59:37] next [15:59:41] The indentation acts as block? [15:59:46] can we use more than one statement in if condition? [15:59:48] ^ this was the question. cleared [15:59:48] Anupama, yes. [15:59:56] mounica, yes, I will do that now [16:01:15] see, none of it worked as a is not greater than b [16:01:43] ah, a is a string now [16:01:44] :( [16:01:55] ! [16:02:28] worked [16:02:29] next [16:02:34] next [16:02:39] can we add two strings [16:02:40] mounica, also you asked out of turn [16:02:42] I missed that [16:02:48] kiran_, yes, try + [16:03:06] next [16:03:09] next [16:03:30] kushal: Shell share link please. [16:03:42] lambainsaan, https://shellshare.net/r/summertraining [16:03:43] https://shellshare.net/r/summertraining lambainsaan [16:04:53] next [16:05:37] ! [16:05:50] ! [16:06:36] next [16:07:18] what is the use of"bool" operator [16:07:46] boolean [16:07:54] sandeepmaity09_ is now known as sandeepmaity09 [16:08:12] next [16:08:19] in c without initialization of a variable shows some garbage value,does it also shows in phyton [16:08:39] goutham__, generally no [16:08:51] goutham__, because you will always provide a value [16:09:01] manoj, may this link help you https://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python_3/Boolean_Expressions [16:09:06] There is a special value for not having anything. [16:09:12] None [16:09:42] ! [16:09:54] next [16:09:58] thank you meamitk [16:10:13] how can you define something without a value ? [16:11:06] i mean we use variable = something [16:11:11] akshays, a = "" [16:11:28] meamitk, that is empty string. [16:12:28] oh noted [16:12:36] jeyy is now known as jwngsar [16:13:17] next [16:14:08] ! [16:14:26] next [16:14:49] how to indicate comments in python? [16:15:01] akhilesh, good question [16:15:02] use # [16:15:40] kushal_thank you [16:15:56] akhilesh, check the shellshare [16:16:09] To get out of the interpreter, press ctrl + d [16:16:32] Now for actual programs, we will write them in a file, and execute them. [16:16:39] I am going to demo it in the shell share [16:16:46] so have a look [16:18:17] Done, any questions on the last few steps I did? [16:18:51] kushal: PS1 might help. Sorry for reminding again. [16:19:02] pksadiq, oh correct [16:19:16] pksadiq, problem is, I can not find the server I was using before :( [16:19:27] pksadiq, not sure which one was that :( [16:20:17] the current PS1 randomly breaks at some '-'. Don't know why. this hurts readability [16:20:57] Okay. [16:21:07] pksadiq, will do that before next session. [16:21:14] Anyway, any other question? [16:21:32] for now: export PS1="\w $ " [16:21:52] kushal, No [16:23:14] So. [16:23:16] rahuldecoded is now known as Guest76062 [16:23:34] Read till the end of if else chapter from http://pymbook.readthedocs.io/en/latest/index.html [16:23:46] Practice, and ask doubts here. [16:24:00] kushal, sorry i got late [16:24:00] Remember: I will make some updates to the book tonight/tomorrow morning. [16:24:09] So do not download the PDF, read online :) [16:24:10] ! [16:24:13] tabrez, no problem. [16:24:16] next [16:24:33] kushal,okay [16:24:48] can i ask question, if i have any doubts in that book? [16:25:08] buvanesh_kumar, I already said that [16:25:15] You can ask your doubts in the channel. [16:25:23] We will close the session here. [16:25:30] Please blog more (everyone). [16:25:53] ! [16:26:03] Kushal, ok [16:26:17] next [16:26:22] kushal, how did you run the file ? [16:26:27] kushal, thanks for an informatice session :) [16:26:33] kushal,most of the times i am not able to be on time so please update the logs so that i can read from there. thanks. [16:26:36] s/informatice/informative [16:26:39] avik, have you read the bash guide we provided? [16:26:41] thanks kushal [16:26:56] tabrez, we did, no session was there on Monday or on Tuesday. [16:26:59] Roll Call [16:27:04] Abhishek Gupta [16:27:05] no, not completed sorry [16:27:05] Akhilesh Dhaundiyal [16:27:05] Abhishek Shrivastava [16:27:05] Harsh Vardhan [16:27:08] Shaurya Kalia [16:27:08] Avinash Madhukar [16:27:09] Madhuri Muley [16:27:09] tabrez khan [16:27:10] Buvanesh Kumar [16:27:12] Priyanka Sharma [16:27:12] Utkarsh shukla [16:27:12] sandeep kumar choudhary [16:27:13] Mahesh Gahlot [16:27:14] Rohan Hazra [16:27:14] shobhit upadhyay [16:27:15] Avik Mukherjee [16:27:15] Varsha R [16:27:17] Prashant Jamkhande [16:27:18] Amit Kokitkar [16:27:20] Jogender Kota [16:27:21] Sudeep Mukherjee [16:27:23] Vivek Shelar [16:27:23] akshay cv [16:27:26] Mamoon Manzoor [16:27:27] Anupama Mandal [16:27:27] ganesh kadam [16:27:29] Yash Bharadwaj [16:27:30] Suniva Priyadarshini [16:27:45] Harshit Gupta [16:27:56] endclass [16:27:56] [## Class Ended at Wed Jul 20 16:27:56 2016 ##]