----BEGIN CLASS---- [13:40] #startclass [13:40] Roll Call [13:40] Priyanka Sharma [13:40] Vivek Anand [13:40] Akash pathak [13:40] Shivam Singhal [13:40] kumar vipin yadav [13:40] Krishnanand Rai [13:40] Suraj Ghimire [13:40] Kshitij [13:40] Sandesh Patel [13:40] Gaurav Sitlani [13:41] Priyansh Sourav [13:41] ! [13:41] Deepika Upadhyay [13:41] Abhishek Singh [13:41] Atul kumar [13:41] neha kandpal [13:41] Robin Schubert [13:41] yurii pylypchuk [13:41] Anu kumari Gupta [13:42] next [13:42] next [13:42] Questions people: [13:42] I want to know how i read a character in python ? [13:42] [13:42] Anything on Python you did till now? [13:42] ! [13:43] kvy_, input("Enter a character:") ? [13:43] next [13:43] How to represent a list in form of array? [13:43] I have some strings in a list, I want to convert it to integer array [13:43] skarpy, Means? [13:43] kvy_: var_name = input("Enter Character") [13:43] roll call Devesh Verma [13:44] ! [13:44] Roll Call: Onyinye Madubuko [13:44] Roll call: Ashwani Kumar Gupta [13:44] skarpy, Okay, wait [13:44] map() is there [13:44] l = ["123", '345', "777"] [13:44] skarpy, ^^^ you want to convert each of them into Int lists. [13:44] Yes [13:45] People jump into code, and do this in your notebook and show to skarpy [13:45] ok kushal doing [13:46] fast fast :) [13:46] Someone? [13:47] [int(number) for number in l] [13:47] https://paste.fedoraproject.org/paste/rxB-Idnx22Ps2oS9Bcfaog [13:47] I am doing some coding over a bot. And the motor gives output as a{}=[(0,198) (0,187) (0,198] [13:47] skarpy, ^^ [13:47] https://notebooks.azure.com/n/XkWu1lcvRRM/notebooks/summertraining.ipynb [13:47] I want to convert those to simple int numbers [13:48] skarpy: what about the list comprehension that kushal wrote? [13:48] kushal,ikshitij It work in online compilers but while i code this in a .py file and run it in terminal it show error [13:49] kvy_, Compilers? [13:49] https://notebooks.azure.com/n/LtqI6fzgyMc/notebooks/pythonPractice.ipynb [13:49] knrai, ashwanig nice [13:49] https://notebooks.azure.com/san-D/libraries/san-D/html/pythonPractice.ipynb this looks weird to anyone? [13:49] kushal I mean in notebook. [13:50] oops sory! [13:50] roll call: Soumam Banerjee [13:50] kushal also to mention, I am doing code in Python, converted to lua. [13:50] skarpy, I have no clue about it. [13:50] Kushal: its lua coding. [13:50] skarpy, So now you have answer. [13:50] kushal, Isn't it wrong syntax? [13:50] ashwanig, yup [13:50] next [13:50] How to take inputs on a single line in python? [13:51] kushal, what are we suppose to do? [13:51] sorry for being late! [13:51] https://notebooks.azure.com/n/LtqI6fzgyMc/notebooks/pythonPractice.ipynb [13:51] avik, wait and see [13:51] what is the question? [13:51] https://paste.fedoraproject.org/paste/5UnzfsgbnB4UEACtjILmzA [13:52] avik, convert a list of strings to int. [13:52] why is it not showing my modified code? [13:52] anuGupta, Your program isn't converting the list of strings into list of integers [13:52] again [13:52] san-D: that doesn't look like python code to me ;) what are you trying to do? [13:52] Anyone. [13:52] skarpy: discuss after class [13:52] oops [13:52] pr97, use the input function call [13:52] I am not getting what exactly you want skarpy [13:53] https://notebooks.azure.com/n/LtqI6fzgyMc/notebooks/pythonPractice.ipynb [13:53] ikshitij: I will explain to you in person. Now to the class. [13:53] pr97: use map ( ) [13:53] Ooh so for that map function can be used [13:53] kushal, sorry, didn't get you [13:53] please, can someone repeat the question to be solved! [13:53] map() function is not clear to me [13:53] san-D: now it's updated. You should avoid variable names like 'list', it is a researved keyword in python [13:54] pr97, Use the input function call. [13:54] pr97, You can use `elements = input().split()` [13:54] avik, I just wrote the question to you. [13:54] next [13:54] ! [13:54] never got that! [13:54] sorry! [13:54] ashwanig, if you have to take 50 inputs, then? [13:55] ok on it now! [13:55] okay kushal [13:55] kushal, thanks [13:55] pr97, 50 inputs in same line? [13:55] okay ikshitij [13:55] pr97: https://notebooks.azure.com/n/PMlQyZdJoH0/notebooks/summertraining.ipynb [13:55] ashwanig, yes [13:55] Last line [13:55] Okay, people stop for now. [13:55] okay thank you ikshitij [13:57] ikshitij it's private [13:57] ikshitij, yes, not opening [13:58] What was the last thing fhackdroid discussed on Monday? loops? [13:58] Yes, for loop [13:58] List [13:59] anuGupta, ? [13:59] https://notebooks.azure.com/kshitiz/libraries/dgplug/html/summertraining.ipynb [13:59] https://pymbook.readthedocs.io/en/latest/datastructure.html start reading from here. [13:59] List [13:59] https://notebooks.azure.com/technotron/libraries/dgplug/html/summertraining.ipynb [13:59] There maybe things which you do not understand, feel free to come here and ask. [14:00] I will be waiting for questions. [14:00] Along with your questions, please show us the notebook link [14:00] so that can we can see what have you tried [14:00] ! [14:01] ! [14:03] next [14:04] next [14:04] Kushal: how can I have packages in notebook? I am using numpy and scipy in my IDE. [14:04] doubt cleared :) [14:04] skarpy, no clue, you will have to search. [14:05] Kushal: we have to code only on available packages? We can't add new? [14:05] Kushal: ok [14:05] skarpy, Btw, when you say notebook, you mean Azure notebook, not the notebook in your laptop, correct? [14:05] Kushal: yes azure notebook :p [14:05] skarpy, I will ask the people who wrote/manage Azure notebook. [14:05] ! [14:05] skarpy, but, generally, you can just pip install [14:05] skarpy, try !pip install whatever [14:05] next [14:05] Is that list is something similar to array? [14:06] balaji, Yes sir :) [14:06] sorry for saying sir. [14:06] Kushal: pip in azure notebook????? [14:06] balaji, But, yes. [14:06] skarpy, look at the syntax I gave. [14:06] Kushal: ok [14:06] skarpy, if you read about how Jupyter works, you will know. [14:07] we do not code any function but we can insert or append any data how it's working ? [14:07] skarpy: All useful libraries used for data science is installed already. [14:07] [14:07] Kushal: yes I forgot about google :p [14:07] okay kushal [14:07] next [14:07] we do not code any function but we can insert or append any data how it's working ? [14:07] [14:08] kvy_, Because the people who wrote Python programming language, already wrote those for you. [14:08] kvy_, Just like the for loop. [14:08] It's cool [14:08] kvy_, Yes, it is :) [14:08] next [14:10] skarpy: I just installed a packages in my notebook. Check https://notebooks.azure.com/kshitiz/libraries/dgplug/html/summertraining.ipynb [14:11] Ikshitij: thank you :) [14:12] ikshitij, it tells me there is an error :) [14:13] Error in link that I shared ? [14:13] ikshitij, Yes [14:14] Make sure that is public [14:14] ! [14:15] Ok checking [14:15] ! [14:15] next [14:15] what does end = ' ' actually doing? https://notebooks.azure.com/technotron/libraries/dgplug/html/summertraining.ipynb [14:16] same doubt as avik [14:17] avik, try these two [14:17] for i in range(10): [14:17] print(i) [14:17] and then [14:17] for i in range(10): [14:17] print(i, end=' ') [14:17] try and see :) [14:17] ok! [14:18] yes, '\n' is not there, right? [14:19] kushal, ? ^^ [14:19] avik, now, try help(print) [14:19] avik: we discussed already about this last class. :) [14:19] avik, in your terminal :) [14:20] ikshitij, Some people just don't read the logs or the sessions when they are live. [14:20] ok. saw that [14:20] next [14:20] avik,pr97 I think it help to print output horizontal . [14:20] kushal, sorry for that! [14:20] avik, You don't have to say sorry. [14:20] In students.py example, what is that sum ( ) function for ? It's not defined anywhere in that particular problem [14:20] yes kvy_ [14:21] ikshitij, means it is already written :) [14:21] ikshitij, try help(sum) in your terminal :) [14:21] Ok [14:21] ! [14:22] Got it kushal [14:22] next [14:22] how is divmod function being used? [14:22] ! [14:23] atul916, that is an easy way to get answers of two operations in one function call [14:23] next [14:23] "flush: whether to forcibly flush the stream." what does this mean? [14:24] atul916 I think it return 2 value reminder and another is result of there divide. [14:25] avik, so you can use print function to any file like object, say a file on the drive. [14:25] avik: print(var_name, end = ' '). It will append space in last. You can add a line break and tab using end = '\n' and end = '\t' at respectively [14:26] avik, and when you write to a file, it is on the kernel to decide when to write the content to the actual drive, it may just return saying writing is successful, but maybe it is writing only when you are closing the file. [14:26] kushal, can you please explain that a little more? [14:26] avik, you can try to force that with a flush [14:26] never mind, got it! [14:27] kushal, thanks. [14:27] avik, also https://stackoverflow.com/questions/10545167/what-does-it-mean-to-flush-file-contents-in-python#10545247 [14:27] ikshitij, got that! [14:27] next [14:27] okay [14:28] atul916 It is use as a,b = divmod(10,2) now a = 5 and b = 0. [14:28] kushal, is it like fflush in c? [14:28] avik, you are answering your own questions. [14:28] hehe! [14:32] anyway, others please ask what ever you want to. [14:35] https://paste.fedoraproject.org/paste/b0CJmSpRBQ0~zBto0p3CZw [14:35] I am getting error in this [14:35] sorry fixed [14:35] :) [14:37] ! [14:38] ! [14:40] In dictionaries, if we want to check data for particular key, we use data[key]. What If I want to see key for a particular data. [14:40] ikshitij, wait [14:41] to check if a key exists or not, check with if statement [14:41] if key in data: [14:41] print("Yes") [14:41] Like I want to check who use Fedora ! [14:41] It should return Kushal [14:43] ikshitij, so maintain another dictionary where the values from here are the keys, and the values are list of users. [14:44] Ok [14:44] ikshitij, or you have to loop through all the values. [14:45] Loop through all the key and check the value, if it's equal to required value, return key [14:49] https://paste.fedoraproject.org/paste/PVVp8kyRlBmiONtEc574Aw [14:50] kushal: solved [14:50] next [14:50] how to print result of loop on same line? [14:50] mext [14:50] next [14:50] championshuttler, end argument in the print function [14:50] championshuttler, see the discussion with avik a few minutes back [14:51] kushal ok :) will read logs after uploading loosing connection again and again [14:52] championshuttler, okay [14:58] I was disconected for 20 minutes, is session going on [14:59] yurii ya session is going on [14:59] next [14:59] championshuttler: use "print(i, end = ' ')" It will print output on the same line adding spaces between them. Pass different parameters for different results [15:02] yes yurii [15:04] Anyway, seems everyone is busy reading./ [15:04] ikshitij: thanks :) [15:04] So, to make people actually talk, I will end the session now, and expect people to stay online and ask doubts to friends here (we will also help). [15:04] Roll Call [15:04] I guess people are busy. ----END CLASS----