abhi12ravi

Aug6

Aug 5th, 2014
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.27 KB | None | 0 0
  1. 10:11 PM <abhiramr> Okay, then we'll start today's session.
  2. 10:11 PM <abhiramr> Attendance
  3. 10:11 PM <abhiramr> Abhiram R
  4. 10:12 PM <Abhishek_Jain> Abhishek Jain
  5. 10:12 PM <Vaishnavi> Vaishnavi Rao
  6. 10:12 PM <ramrutha> Amrutha Ramanathan
  7. 10:12 PM → chetusa joined (chetusa@conference/jsconf/x-gougdnrphvppbcah)
  8. 10:12 PM <chetusa> Chaitanya.S.A
  9. 10:12 PM <samruda> Samruda
  10. 10:12 PM <amjad> Amjad Ali
  11. 10:12 PM → localhost1 joined (localhost@conference/jsconf/x-joimbbdkysbzveie)
  12. 10:12 PM <localhost1> Rakesh
  13. 10:12 PM <abhiramr> Cool. Santosh will join us in a while. Till then I'll moderate the session
  14. 10:13 PM <abhiramr> So did you see video 4 on the lecture as asked?
  15. 10:13 PM → pallavi joined (uid13480@gateway/web/irccloud.com/x-mqvcczgcgzubioku)
  16. 10:14 PM <abhiramr> yes or no?
  17. 10:14 PM <ramrutha> Half way through
  18. 10:14 PM <abhiramr> okay, others?
  19. 10:15 PM <abhiramr> I'm assuming silence is no.
  20. 10:15 PM <Vaishnavi> Doing nw
  21. 10:15 PM <abhiramr> Vaishnavi: I suggest you watch it later. Before tomorrow's session.
  22. 10:15 PM <Abhishek_Jain> yes
  23. 10:16 PM <abhiramr> All right.
  24. 10:16 PM <Vaishnavi> Okay
  25. 10:16 PM <chetusa> could not..
  26. 10:16 PM <chetusa> :/
  27. 10:16 PM <abhiramr> Please do watch the videos as they would help you understand algorithms better.
  28. 10:16 PM <abhiramr> Okay?
  29. 10:17 PM <Abhishek_Jain> okay cool
  30. 10:17 PM <Abhishek_Jain> +1
  31. 10:17 PM <ramrutha> sure abhi
  32. 10:17 PM <Vaishnavi> Ok
  33. 10:17 PM <samruda> okay
  34. 10:17 PM <amjad> Where do you post the links to the videos?
  35. 10:17 PM <chetusa> yeah.. I know.. They are really good.. I could not today.. :/
  36. 10:17 PM <abhiramr> amjad: Refer yesterday's summary on the group
  37. 10:18 PM <abhiramr> Anyway, Richard talks about how the number of bits affect algorithms
  38. 10:19 PM <abhiramr> although we increase decimal numbers linearly, their respective binary forms are exponential
  39. 10:19 PM <abhiramr> his video was along those lines
  40. 10:20 PM <abhiramr> who remembers yesterday's home question?
  41. 10:20 PM <Abhishek_Jain> i do
  42. 10:20 PM <abhiramr> can you tell us?
  43. 10:21 PM <abhiramr> by the time Abhishek_Jain types others think if you have an answer
  44. 10:21 PM <Abhishek_Jain> yea
  45. 10:21 PM <abhiramr> shoot!
  46. 10:21 PM <Abhishek_Jain> how to find tome complexities of algms
  47. 10:21 PM ← nerret left (guest-nerr@conference/jsconf/x-oxacgjgenpberqdq)
  48. 10:21 PM <abhiramr> that's a little vague
  49. 10:21 PM <abhiramr> "given the time complexity its easy to say which algorithm is the better one , but given an algorithm how do you find its time complexity ?? go through the algorithms for bubble sort and insertion sort and find their time complexities "
  50. 10:21 PM <Abhishek_Jain> and we need to find time complexities of bubble sort
  51. 10:21 PM <Abhishek_Jain> and nsertion sort
  52. 10:21 PM <abhiramr> yes
  53. 10:22 PM <Abhishek_Jain> dude i was typing
  54. 10:22 PM <Abhishek_Jain> sorry :(
  55. 10:22 PM <abhiramr> Abhishek_Jain: Okay.
  56. 10:22 PM <abhiramr> Does anyone have an answer. Hit a !
  57. 10:22 PM <abhiramr> Does anyone have an answer? Hit a !
  58. 10:22 PM <ramrutha> a
  59. 10:22 PM <abhiramr> everyone else?
  60. 10:23 PM <abhiramr> I'll repeat the question
  61. 10:23 PM <abhiramr> "given the time complexity its easy to say which algorithm is the better one , but given an algorithm how do you find its time complexity ?? go through the algorithms for bubble sort and insertion sort and find their time complexities "
  62. 10:23 PM <amjad> a
  63. 10:23 PM <Abhishek_Jain> a
  64. 10:23 PM <abhiramr> I meant hit a "!"
  65. 10:23 PM <Vaishnavi> a
  66. 10:23 PM <abhiramr> like this
  67. 10:23 PM <chetusa> a
  68. 10:24 PM <abhiramr> !
  69. 10:24 PM <chetusa> !
  70. 10:24 PM <Abhishek_Jain> hahaha
  71. 10:24 PM <amjad> lmao
  72. 10:24 PM — abhiramr lol just now
  73. 10:24 PM → nerret joined (guest-nerr@conference/jsconf/x-faxsbutxxqcmuwoy)
  74. 10:24 PM <nerret> lol
  75. 10:24 PM <abhiramr> Okay cool. ramrutha go ahead. Give your answer
  76. 10:24 PM <chetusa> finally!
  77. 10:24 PM <ramrutha> Well u first find the basic step in the algorithm.The basic step is the the single statement which takes most time to execute.
  78. 10:25 PM <abhiramr> okay.. go on
  79. 10:25 PM <abhiramr> if anyone has a question, please pose it to ramrutha
  80. 10:25 PM <ramrutha> And then you see how many times it executes (whether it lies in one or more loops)
  81. 10:25 PM <Abhishek_Jain> +1 ramrutha
  82. 10:26 PM <Vaishnavi> +1 kool
  83. 10:26 PM <ramrutha> That essentially gives us the time complexity of the algorithm
  84. 10:26 PM <abhiramr> ramrutha: yes you're right
  85. 10:27 PM <abhiramr> anyone has anything to add?
  86. 10:27 PM <abhiramr> or oppose?
  87. 10:27 PM <chetusa> yes
  88. 10:27 PM <abhiramr> chetusa: go on
  89. 10:27 PM <chetusa> the step which takes longest
  90. 10:27 PM <Abhishek_Jain> Main concern is to find the basic step
  91. 10:28 PM <chetusa> we need to see the size of input to size of output is what matters too
  92. 10:28 PM <abhiramr> ramrutha: how do you find which step takes the longest time?
  93. 10:28 PM <Abhishek_Jain> now for bubble sort we have the comaprision which is the basic step
  94. 10:28 PM ⇐ amjad quit (0116cbc0@gateway/web/freenode/ip.1.22.203.192) Ping timeout: 246 seconds
  95. 10:28 PM <abhiramr> chetusa: can you be clearer ?
  96. 10:29 PM <Abhishek_Jain> the basic step can be found out as the one which gets executed the largest number of times..
  97. 10:29 PM <Abhishek_Jain> correct me if i am wrong
  98. 10:29 PM <ramrutha> @abhiramr like abhishek explained.Normally the step inside the loop is the basic step
  99. 10:29 PM <ramrutha> It definitely can't be initialization or declarations
  100. 10:30 PM <nerret> Most singnifact step
  101. 10:30 PM <chetusa> like in the 3rd video
  102. 10:30 PM <ramrutha> It has to be native to the algorithm
  103. 10:30 PM <abhiramr> okay consider this.
  104. 10:30 PM <ramrutha> @nerret +1
  105. 10:30 PM <abhiramr> say i sort a list of numbers. and write it to a file
  106. 10:30 PM <chetusa> the 2 bits input gives a larger output
  107. 10:30 PM → sant0sh joined ([email protected])
  108. 10:30 PM <chetusa> in other words, the
  109. 10:30 PM <abhiramr> file write operation takes more time
  110. 10:30 PM <chetusa> complexity is more
  111. 10:30 PM <sant0sh> Hola!
  112. 10:30 PM <abhiramr> sant0sh: Hi, we were discussing about this
  113. 10:30 PM <chetusa> and further, remember the oblivious algo?
  114. 10:31 PM <abhiramr> "given the time complexity its easy to say which algorithm is the better one , but given an algorithm how do you find its time complexity ?? go through the algorithms for bubble sort and insertion sort and find their time complexities "
  115. 10:31 PM <Abhishek_Jain> @santosh Hi
  116. 10:31 PM <nerret> PyBot^, kick sant0sh
  117. 10:31 PM <ramrutha> @sant0sh Hey
  118. 10:31 PM <abhiramr> chetusa: yes.
  119. 10:31 PM <abhiramr> and ramrutha Abhishek_Jain you were right.
  120. 10:31 PM <sant0sh> Abhishek_Jain, ramrutha o/
  121. 10:31 PM <Abhishek_Jain> yea see for every step in bubble sort we compare two numbers
  122. 10:31 PM <Abhishek_Jain> so that it becomes the basic step
  123. 10:32 PM <chetusa> well, that matters too.. cuz if it is a waste of steps n calculations then its a waste of time too
  124. 10:32 PM → abraat joined ([email protected])
  125. 10:32 PM <ramrutha> @abhiramr like i said,the basic step is native to the algorithm
  126. 10:32 PM <chetusa> @santosh hi!
  127. 10:32 PM <abhiramr> ramrutha: yes.
  128. 10:32 PM <nerret> ramrutha, +1
  129. 10:32 PM <abhiramr> sant0sh: the stage is yours
  130. 10:32 PM <ramrutha> So the comparison is the native to finding the time complexity
  131. 10:32 PM <sant0sh> abhiramr, ok thanks
  132. 10:32 PM abraat → abraar
  133. 10:33 PM <sant0sh> to be frank i dont know what happened? how much data is completed?
  134. 10:33 PM <Abhishek_Jain> @ramrutha +1
  135. 10:33 PM <sant0sh> also i didnt refer to the videos
  136. 10:33 PM <sant0sh> :P
  137. 10:33 PM <sant0sh> my work is to teach you guys about the bubble sort
  138. 10:34 PM <sant0sh> ;)
  139. 10:34 PM <sant0sh> will do that
  140. 10:34 PM <abhiramr> sant0sh: yeah, we just saw a few lectures on how to think in algorithmic terms.
  141. 10:34 PM <sant0sh> abhiramr, ok!
  142. 10:35 PM <sant0sh> abhiramr, everything was in python i assume
  143. 10:35 PM <abhiramr> sant0sh: It was not language specific.
  144. 10:35 PM <Abhishek_Jain> Basic algorithms no implementation till now
  145. 10:35 PM <sant0sh> abhiramr, ah ok! interesting
  146. 10:35 PM <abhiramr> guys you can update too.
  147. 10:35 PM <sant0sh> yes please
  148. 10:37 PM <sant0sh> let me bring my bot
  149. 10:37 PM <sant0sh> :)
  150. 10:37 PM <Abhishek_Jain> today we need to implement in python
  151. 10:37 PM <Abhishek_Jain> yay
  152. 10:37 PM — Abhishek_Jain is feeling good
  153. 10:37 PM <abhiramr> sant0sh: okay
  154. 10:37 PM → PyBot^ joined ([email protected])
  155. 10:37 PM <sant0sh> yes lets do some coding ;)
  156. 10:37 PM <chetusa> :)
  157. 10:38 PM — ramrutha is excited
  158. 10:38 PM <nerret> let's get our hands dirty
  159. 10:38 PM → nitesh joined ([email protected])
  160. 10:38 PM — nerret opens python interpreter
  161. 10:39 PM <sant0sh> pingall: session begins now
  162. 10:39 PM <PyBot^> nitesh, abraar, nerret, pallavi, localhost1, chetusa, Vaishnavi, ramrutha, samruda, Abhishek_Jain, vrishabh, bhoom, maheshkumar, 6A4AAOQV9, abhiramr, psacrifice|away, dash-rai, kaustavdm
  163. 10:39 PM <PyBot^> session begins now
  164. 10:39 PM <nerret> haha
  165. 10:39 PM <chetusa> awesome!!
  166. 10:39 PM — abhiramr says Naice!
  167. 10:39 PM → coolbhavi joined
  168. 10:39 PM <Abhishek_Jain> we are ready to conquer
  169. 10:39 PM <nerret> it should have pinged only python guys
  170. 10:39 PM <nerret> it pinged some extra people :P
  171. 10:39 PM — chetusa wonders how will I run anything without python
  172. 10:39 PM → hackdroid joined (hackdroid@conference/jsconf/x-ennkbbwdrrymhabs)
  173. 10:39 PM — hackdroid is here
  174. 10:39 PM <sant0sh> lets get to the topic
  175. 10:39 PM <abhiramr> nerret: is Jeevan I'm guessing?
  176. 10:40 PM — nerret asks abhiram to stop guessing
  177. 10:40 PM <sant0sh> so today bubble sort in python
  178. 10:40 PM <hackdroid> @sant0sh yup
  179. 10:40 PM <sant0sh> Everyone knows about bubble sort?
  180. 10:40 PM <ramrutha> yes
  181. 10:40 PM <Abhishek_Jain> yea
  182. 10:40 PM <chetusa> oblivious?
  183. 10:40 PM <samruda> yes
  184. 10:40 PM <nerret> @sant0sh yes
  185. 10:40 PM <chetusa> yes
  186. 10:40 PM <Vaishnavi> Yes
  187. 10:41 PM <hackdroid> @sant0sh did you saw todays TOI?
  188. 10:41 PM <abhiramr> yes
  189. 10:41 PM <nerret> about hackerearth
  190. 10:41 PM <sant0sh> hackdroid, later :P in between a session now
  191. 10:41 PM <abhiramr> hackdroid: session in progress. we'll chat later
  192. 10:41 PM <nerret> @sant0sh no deviation please
  193. 10:41 PM <nerret> @hackdroid*
  194. 10:41 PM <hackdroid> @sant0sh oops!
  195. 10:41 PM <sant0sh> can someone explain the logic of bubble sort?
  196. 10:41 PM <nitesh> sant0sh: does not promote his company on #fsmk
  197. 10:42 PM <sant0sh> +1
  198. 10:42 PM <nitesh> i was being sarcastic
  199. 10:42 PM <sant0sh> pingall: can someone explain the logic of bubble sort?
  200. 10:42 PM <PyBot^> hackdroid, coolbhavi, nitesh, abraar, nerret, pallavi, localhost1, chetusa, Vaishnavi, ramrutha, samruda, Abhishek_Jain, vrishabh, bhoom, maheshkumar, 6A4AAOQV9, abhiramr, psacrifice|away, dash-rai, kaustavdm
  201. 10:42 PM <PyBot^> can someone explain the logic of bubble sort?
  202. 10:42 PM <hackdroid> @sant0sh iit is basically done to minimize the no. of comparision
  203. 10:43 PM <ramrutha> Each element is compared with the element adjacent to it and swapped if bigger/smaller in each pass.
  204. 10:43 PM <Abhishek_Jain> The basic logic is we keep comparing two adjacent numbers and the largest number is shifted to last
  205. 10:43 PM <abhiramr> swapped only if bigger
  206. 10:43 PM <Abhishek_Jain> +1 Ramrutha Abhiram
  207. 10:43 PM <hackdroid> @abhiramr it depends
  208. 10:43 PM <ramrutha> At the end of each pass an element is bubbled to its place
  209. 10:43 PM <Vaishnavi> Sorting in which succesivd elements are exchanged when the compared is lesser
  210. 10:43 PM <abhiramr> okay yeah, for ascending/descending
  211. 10:44 PM <sant0sh> great!
  212. 10:44 PM <sant0sh> :)
  213. 10:44 PM <sant0sh> let me summarize
  214. 10:45 PM <sant0sh> "The bubble sort makes multiple passes through a list. It compares adjacent items and exchanges those that are out of order. Each pass through the list places the next largest value in its proper place. In essence, each item “bubbles” up to the location where it belongs."
  215. 10:45 PM <abraar> Perfect summary ;)
  216. 10:45 PM <sant0sh> anyone who didnt understand please ping! :)
  217. 10:46 PM <hackdroid> @sant0sh proceed :)
  218. 10:46 PM <sant0sh> ok before going into more of the topic
  219. 10:46 PM <nerret> let's implement
  220. 10:46 PM <sant0sh> I would like to know who all know python
  221. 10:46 PM <nerret> basic python
  222. 10:46 PM <abhiramr> me
  223. 10:46 PM <ramrutha> me
  224. 10:46 PM <samruda> me
  225. 10:46 PM <abraar> Basic python ..yes
  226. 10:46 PM <sant0sh> let me rephrase the question! who don't know basic python
  227. 10:46 PM <chetusa> barely something...
  228. 10:46 PM <hackdroid> @sant0sh still learning
  229. 10:47 PM <Vaishnavi> Me
  230. 10:47 PM <Abhishek_Jain> I dont know
  231. 10:47 PM <Vaishnavi> Idk
  232. 10:47 PM <sant0sh> hmm ok!
  233. 10:47 PM <sant0sh> no problem!
  234. 10:47 PM <Abhishek_Jain> @vaishnavi Dont use Sms Language :P
  235. 10:47 PM <sant0sh> +1 Abhishek_Jain :)
  236. 10:47 PM <Vaishnavi> I don't know. :P
  237. 10:47 PM <abraar> Laugh out loud :p
  238. 10:48 PM <hackdroid> @abhishek-jain santosh : concentrate plz
  239. 10:48 PM <hackdroid> please
  240. 10:48 PM <chetusa> "plz"
  241. 10:48 PM <nerret> IDK is fine :P
  242. 10:48 PM <nerret> it's Internet language
  243. 10:48 PM <sant0sh> hackdroid, your identity?
  244. 10:48 PM <coolbhavi> jargons are fine I guess...
  245. 10:48 PM <hackdroid> @sant0sh shall never be revealed :P
  246. 10:49 PM <sant0sh> oh yes its fine coolbhavi
  247. 10:49 PM <sant0sh> :)
  248. 10:49 PM <sant0sh> I wish i was op
  249. 10:49 PM <sant0sh> anyways lets get back to session
  250. 10:49 PM <sant0sh> lets get started with basics of python
  251. 10:49 PM <coolbhavi> sant0sh, I dont know as I'm a newbie here and m just assuming :)
  252. 10:49 PM <sant0sh> coolbhavi, using standard rules in irc here!
  253. 10:49 PM <sant0sh> coolbhavi, using standard rules of irc here!
  254. 10:49 PM — hackdroid was waiting for this day :)
  255. 10:50 PM <nitesh> sant0sh: even if you were op you cannot find out. He/She is connected via scrollback
  256. 10:50 PM — hackdroid python learning finally
  257. 10:50 PM <nerret> nitesh +1
  258. 10:50 PM <sant0sh> I would have banned that person
  259. 10:50 PM <sant0sh> :D
  260. 10:50 PM <nerret> yeah :P
  261. 10:50 PM — Abhishek_Jain is excited !
  262. 10:50 PM <abhiramr> Guys, let sant0sh talk. Don't side-track
  263. 10:50 PM <coolbhavi> sant0sh, :)
  264. 10:50 PM <nerret> @coolbhavi okay.
  265. 10:50 PM <sant0sh> yea sorry
  266. 10:50 PM <nerret> sant0sh go ahead
  267. 10:51 PM <sant0sh> what is python?
  268. 10:51 PM <sant0sh> its question for everyone
  269. 10:51 PM <coolbhavi> sant0sh, python is a scripting language with oops concepts in it a bit :)
  270. 10:52 PM <abraar> Python is a programming or scripting language ..its easy to learn coz its more like english
  271. 10:52 PM <ramrutha> Also Its easy to implement because of the vast collection of libraries
  272. 10:53 PM <sant0sh> Then?
  273. 10:53 PM <abhiramr> python is an interpreter based scripting langauge. although it takes a lot of time to execute, it's useful for automation as number of lines of code is lesser
  274. 10:53 PM <hackdroid> @sant0sh and its interpreter based
  275. 10:53 PM <abraar> Works at interpretive mode
  276. 10:53 PM <samruda> and it is interpreted
  277. 10:53 PM <hackdroid> @abhiramr :P same points same time:P
  278. 10:53 PM <coolbhavi> abhiramr, takes lot of time to execute?
  279. 10:54 PM <sant0sh> abhiramr, ^^^
  280. 10:54 PM <abhiramr> coolbhavi: Python is what you call a heavier language. so the same code takes more resources n time to execute compared to traditional C
  281. 10:55 PM <coolbhavi> abhiramr, heavier? how do u compare with say Java? :)
  282. 10:55 PM <abhiramr> coolbhavi: I have not worked with Java. sant0sh to the rescue
  283. 10:55 PM <chetusa> C is very close to hardware... so, its fast
  284. 10:56 PM <chetusa> heavier languages are further away which makes them relatively slower..
  285. 10:56 PM <abhiramr> chetusa: Also C is a procedural way of program. no objects/instances
  286. 10:56 PM <chetusa> correct!
  287. 10:56 PM <nerret> chetus: explain the terms "close" an "further"
  288. 10:56 PM <nerret> and*
  289. 10:56 PM <chetusa> its not oop...
  290. 10:56 PM <abhiramr> whereas Java, Python , C++ are all objected oriented
  291. 10:56 PM <coolbhavi> chetusa, commands module lets u to interact with system
  292. 10:57 PM <nerret> chetusa: what do you mean by close to the hardware?
  293. 10:57 PM — hackdroid wondering where is santosh
  294. 10:57 PM <sant0sh> me listening to debate
  295. 10:57 PM <sant0sh> go on!
  296. 10:57 PM — nitesh thinks sant0sh is watching naruto
  297. 10:58 PM — nerret thinks or wathcing something else
  298. 10:58 PM <chetusa> The word "low" refers to the small or nonexistent amount of abstraction between the language and machine language; because of this, low-level languages are sometimes described as being "close to the hardware".
  299. 10:58 PM <sant0sh> let me summarize in technical words
  300. 10:58 PM <chetusa> source: wiki.. :P
  301. 10:58 PM <sant0sh> "Python is a general-purpose interpreted, interactive, object-oriented and high-level programming language."
  302. 10:59 PM <chetusa> I could not come out with proper statements.. :
  303. 10:59 PM <sant0sh> others you with the flow right?
  304. 10:59 PM <Abhishek_Jain> yea
  305. 10:59 PM <ramrutha> yup
  306. 10:59 PM <abhiramr> what do you mean by general-purpose?
  307. 10:59 PM <Vaishnavi> Yea
  308. 10:59 PM <hackdroid> @sant0sh yeah go on
  309. 10:59 PM <nerret> But C is a high level language, right?
  310. 10:59 PM <chetusa> ya
  311. 10:59 PM → sarathms joined ([email protected])
  312. 10:59 PM <abraar> Yes
  313. 11:00 PM <abhiramr> is there languages with a specific purpose?
  314. 11:00 PM <abhiramr> sant0sh: ^^^ ?
  315. 11:00 PM <sant0sh> http://hck.re/aELwuh
  316. 11:01 PM <sant0sh> @all^^^
  317. 11:01 PM <sant0sh> check this link which explains about general purpose programming languages
  318. 11:01 PM <abhiramr> yeah, got it
  319. 11:01 PM → brat197 joined ([email protected])
  320. 11:01 PM <abhiramr> they have a wide variety of applications
  321. 11:02 PM <nitesh> abhiramr: all of them have a single purpose, to convert from one form to another form
  322. 11:02 PM ↔ sarathms nipped out
  323. 11:02 PM <abhiramr> nitesh: are you talking about high level to machine code? those forms?
  324. 11:02 PM <nitesh> yeah
  325. 11:03 PM <abhiramr> +1
  326. 11:03 PM <sant0sh> Python is Interpreted language: This means that it is processed at runtime by the interpreter
  327. 11:03 PM <sant0sh> and you do not need to compile your program before executing it.
  328. 11:04 PM <sant0sh> python is interactive: it means the you can sit in the python shell and start writing programs directly
  329. 11:04 PM <sant0sh> python is object oriented language
  330. 11:05 PM <sant0sh> its takes the concept of abstractions and encapsulation techniques
  331. 11:05 PM <sant0sh> and yes python is beginners language
  332. 11:05 PM <sant0sh> quite easy to learn
  333. 11:05 PM <sant0sh> so till here everyone understood?
  334. 11:05 PM <abhiramr> yes
  335. 11:05 PM <chetusa> y
  336. 11:05 PM <ramrutha> @abhiramr yes
  337. 11:05 PM <hackdroid> @sant0sh yes
  338. 11:05 PM <Vaishnavi> Yes
  339. 11:06 PM <ramrutha> @sant0sh yes
  340. 11:06 PM — hackdroid teach teach!teach!
  341. 11:06 PM <sant0sh> great! :)
  342. 11:06 PM <Abhishek_Jain> yea
  343. 11:06 PM <sant0sh> if at any point someone doesnt understand just stop me there
  344. 11:06 PM <chetusa> ok
  345. 11:07 PM <sant0sh> python name doesnt refer from snake
  346. 11:07 PM <nerret> damn. I typed so much. I was offline
  347. 11:07 PM <abhiramr> comes from Monty Python
  348. 11:07 PM <chetusa> monty python! :)
  349. 11:07 PM <abhiramr> a comic series
  350. 11:07 PM <sant0sh> The creator Guido van Rossum loves a series called Monty Python
  351. 11:08 PM <Abhishek_Jain> oh cool :)
  352. 11:08 PM <chetusa> yup!
  353. 11:08 PM <sant0sh> -_-
  354. 11:08 PM <sant0sh> because of which he named the language python
  355. 11:08 PM <sant0sh> python is under GPL!
  356. 11:09 PM <abhiramr> GNU Public Licence - an open source licence
  357. 11:09 PM <nitesh> *free
  358. 11:09 PM <nitesh> it is a free software license
  359. 11:09 PM <abhiramr> my bad.
  360. 11:09 PM <abhiramr> it's a a free, copyleft license
  361. 11:09 PM <sant0sh> nitesh, +1
  362. 11:09 PM <abhiramr> correction ^^^
  363. 11:10 PM <sant0sh> let me assume everyone is using linux
  364. 11:10 PM <ramrutha> General Public licence
  365. 11:10 PM <Abhishek_Jain> yea obviously
  366. 11:10 PM <nitesh> *GNU/Linux
  367. 11:10 PM <abhiramr> GNU/linux here
  368. 11:10 PM <abhiramr> lol
  369. 11:10 PM <ramrutha> yes
  370. 11:10 PM <hackdroid> i am
  371. 11:10 PM <nerret> haha
  372. 11:10 PM <sant0sh> open your terminal
  373. 11:10 PM <nerret> ramrutha, virtualbox not counted :P
  374. 11:11 PM <chetusa> nope!
  375. 11:11 PM <abraar> +1 nerret
  376. 11:11 PM — Abhishek_Jain says nice one nerret
  377. 11:11 PM <sant0sh> ctrl+alt+T in "ubuntu?
  378. 11:11 PM <chetusa> internet nor working on ubuntu.. :( connection only on windows.... :(
  379. 11:11 PM <ramrutha> @nerret go die
  380. 11:11 PM <hackdroid> @sant0sh following
  381. 11:11 PM <chetusa> *connection working
  382. 11:11 PM <sant0sh> stop trolling please!
  383. 11:12 PM <nerret> sant0sh, okay boss
  384. 11:12 PM <sant0sh> did everyone open their terminal?
  385. 11:12 PM <ramrutha> sorry sir
  386. 11:12 PM <chetusa> wired connection acting weird... :/
  387. 11:12 PM <abhiramr> yes
  388. 11:12 PM <nerret> @abhiramr yes
  389. 11:12 PM <nerret> yes
  390. 11:12 PM <ramrutha> yes
  391. 11:12 PM <hackdroid> @sant0sh please continue
  392. 11:12 PM <sant0sh> type "python"
  393. 11:13 PM <sant0sh> you will get into interactive shell of python
  394. 11:13 PM <abhiramr> done
  395. 11:13 PM <hackdroid> @sant0sh got it
  396. 11:13 PM <Abhishek_Jain> yea
  397. 11:13 PM <ramrutha> @sant0sh yes
  398. 11:13 PM <sant0sh> let start by printing data
  399. 11:14 PM <sant0sh> how do you print in C?
  400. 11:14 PM <sant0sh> command
  401. 11:14 PM <Abhishek_Jain> printf
  402. 11:14 PM <sant0sh> c++
  403. 11:14 PM <sant0sh> ?
  404. 11:14 PM <chetusa> cout<<
  405. 11:14 PM <ramrutha> print "hello"
  406. 11:14 PM <nerret> printf()
  407. 11:14 PM <chetusa> c++!!
  408. 11:14 PM <nerret> cout<<
  409. 11:14 PM <hackdroid> cout<<
  410. 11:14 PM <sant0sh> ok
  411. 11:14 PM <sant0sh> in python you have to type
  412. 11:14 PM <chetusa> @ramtutha its python code that u told
  413. 11:14 PM <sant0sh> print 'hello world'
  414. 11:15 PM <ramrutha> yes
  415. 11:15 PM <ramrutha> @chetusa +1
  416. 11:15 PM <chetusa> he asked c++ :P
  417. 11:15 PM <sant0sh> NOTE: this works in python 2.7
  418. 11:15 PM <hackdroid> @sant0sh working
  419. 11:15 PM <sant0sh> in python 3.3 you have use brackets ()
  420. 11:15 PM <sant0sh> great!
  421. 11:15 PM <chetusa> really?
  422. 11:16 PM <sant0sh> chetusa, really for?
  423. 11:16 PM <nitesh> using brackets
  424. 11:16 PM <hackdroid> @sant0sh go on
  425. 11:16 PM <sant0sh> chetusa, yes in python 3.3 you need to use brackets
  426. 11:16 PM <nerret> I have 2.7.6
  427. 11:16 PM <nerret> @sant0sh should I update?
  428. 11:16 PM <Abhishek_Jain> i too have 2.7
  429. 11:16 PM <ramrutha> 2.7.5
  430. 11:17 PM <brat197> 2.7.* is fine.
  431. 11:17 PM <chetusa> Are you using the camp disc? As far as i knw the camp disc has updated one
  432. 11:17 PM <sant0sh> no need
  433. 11:17 PM <sant0sh> we are working in python 2.7
  434. 11:17 PM <nitesh> there are two versions of the interpreters
  435. 11:17 PM <hackdroid> @chetusa it has 2.7.6
  436. 11:17 PM <nitesh> i have 2.7 and 3.4 on mine
  437. 11:17 PM <nerret> no, not the camp distro
  438. 11:18 PM <chetusa> tried typing python and tab twice?
  439. 11:18 PM <nerret> nitesh, how to switch? I too have both I think
  440. 11:18 PM <chetusa> it shows all the versions available..
  441. 11:18 PM <nitesh> pingall: it is not important
  442. 11:18 PM <brat197> use 2.7 ....
  443. 11:18 PM <chetusa> @brat197 yup
  444. 11:18 PM <nitesh> let him continue
  445. 11:18 PM <chetusa> +1
  446. 11:18 PM <sant0sh> if you are using python3.3 then you can shift to python2.7 by typing command in console "python2.7"
  447. 11:18 PM <nerret> okay (y)
  448. 11:18 PM <sant0sh> lets get back!
  449. 11:18 PM <nitesh> or python2
  450. 11:19 PM <sant0sh> what are the basic arithmetic operations?
  451. 11:19 PM <nerret> addition, sub, mul, div
  452. 11:19 PM <nerret> power, sqrt
  453. 11:19 PM <ramrutha> +,-,*,/
  454. 11:19 PM <nerret> not basic*
  455. 11:19 PM <hackdroid> @nerret mod
  456. 11:19 PM <nitesh> **
  457. 11:19 PM <nerret> @niteshmod yeah
  458. 11:19 PM <chetusa> power
  459. 11:19 PM <chetusa> is **
  460. 11:19 PM <chetusa> exponent
  461. 11:19 PM <nerret> yup.
  462. 11:20 PM <sant0sh> that should be enough for nnow
  463. 11:20 PM <sant0sh> now*
  464. 11:20 PM <sant0sh> you can use those operations directly in python console
  465. 11:20 PM <sant0sh> 2+2
  466. 11:20 PM <sant0sh> 3*3
  467. 11:20 PM <sant0sh> like wise experiment with it
  468. 11:20 PM <sant0sh> 2 min time
  469. 11:20 PM <nerret> done
  470. 11:20 PM — Abhishek_Jain is playing with numbers in python
  471. 11:20 PM <chetusa> interactive environment.. giv an input it gives an output,, :)
  472. 11:21 PM <ramrutha> done
  473. 11:21 PM <sant0sh> try exponents
  474. 11:21 PM <sant0sh> powers
  475. 11:21 PM <sant0sh> etc
  476. 11:21 PM <nerret> a**b
  477. 11:21 PM <ramrutha> **
  478. 11:21 PM <ramrutha> for exponents
  479. 11:21 PM <sant0sh> ok fine
  480. 11:21 PM <sant0sh> lets move on
  481. 11:22 PM <nerret> yeah
  482. 11:22 PM <sant0sh> there is no initializing variable here
  483. 11:22 PM <sant0sh> like you used to do in C, C++ or Java
  484. 11:22 PM <sant0sh> you can directly use the variable
  485. 11:23 PM <sant0sh> example
  486. 11:23 PM <sant0sh> temp = 1
  487. 11:23 PM <nerret> I object
  488. 11:23 PM <sant0sh> stores integer value in temp variable
  489. 11:23 PM <sant0sh> nerret, yes
  490. 11:23 PM <nerret> @sant0sh you are initializing there
  491. 11:23 PM <nerret> you are not defining*
  492. 11:23 PM <brat197> *declaring
  493. 11:23 PM <sant0sh> sorry i mean declaring
  494. 11:23 PM <sant0sh> :D
  495. 11:23 PM <nerret> @sant0sh yup. declaring is the right word :D
  496. 11:23 PM <sant0sh> thanks for pointing out
  497. 11:23 PM <nerret> @sant0sh :)
  498. 11:24 PM <sant0sh> you need not declare in python
  499. 11:24 PM <sant0sh> only initializing
  500. 11:24 PM <hackdroid> is it like js
  501. 11:24 PM <sant0sh> string1 = "hello,wold"
  502. 11:24 PM <sant0sh> farhaan No
  503. 11:24 PM <sant0sh> its not like js
  504. 11:24 PM <chetusa> in js you say var a=""
  505. 11:24 PM <sant0sh> you declare using var right!
  506. 11:24 PM <hackdroid> @sant0sh having two datatype numbers and strings?
  507. 11:24 PM <sant0sh> not here like that
  508. 11:24 PM <chetusa> but here you dont even need to do that
  509. 11:25 PM <chetusa> declare a variable.. anything
  510. 11:25 PM <sant0sh> hackdroid, i didnt understand your question
  511. 11:25 PM <chetusa> and trye type( name )
  512. 11:25 PM <chetusa> *try
  513. 11:25 PM <chetusa> eg a=3.5
  514. 11:25 PM <chetusa> type(a)
  515. 11:26 PM <nerret> int
  516. 11:26 PM <sant0sh> chetusa, i'll go to that topic! please don't go ahead
  517. 11:26 PM <hackdroid> @sant0sh js has only two datatypes string and number irrespective of float int char etc
  518. 11:26 PM <chetusa> ok
  519. 11:26 PM <chetusa> @hackdroid sorry
  520. 11:26 PM <chetusa> @santosh sorry
  521. 11:26 PM <sant0sh> hackdroid, in python we have 5 datatypes
  522. 11:26 PM <sant0sh> @all^^^
  523. 11:27 PM <sant0sh> 1.number
  524. 11:27 PM <sant0sh> 2.strings
  525. 11:27 PM <sant0sh> 3.list
  526. 11:27 PM <sant0sh> 4.tuple
  527. 11:27 PM <sant0sh> 5.dictionary
  528. 11:27 PM <nerret> cool
  529. 11:27 PM <sant0sh> Everyone is in flow with the session?
  530. 11:27 PM <nerret> @sant0sh yes
  531. 11:27 PM <ramrutha> @sant0sh yes
  532. 11:27 PM <Abhishek_Jain> yes
  533. 11:27 PM <hackdroid> @sant0sh elaborate on 3 4 5
  534. 11:27 PM <Vaishnavi> Yea
  535. 11:27 PM <abhiramr> yes
  536. 11:27 PM <chetusa> y
  537. 11:27 PM <sant0sh> hackdroid, please hold the seat i'll tell you soon
  538. 11:28 PM <sant0sh> Numbers
  539. 11:28 PM — hackdroid is sorry , got excited
  540. 11:28 PM <sant0sh> you can initialize a variable as number using like this
  541. 11:28 PM <sant0sh> var1 = 1
  542. 11:28 PM <sant0sh> var1 = 2
  543. 11:28 PM <sant0sh> var3 = 2.3
  544. 11:28 PM <chetusa> @sant0sh ?
  545. 11:28 PM <sant0sh> you can use type(var1)
  546. 11:29 PM <chetusa> var1=1 or 2?
  547. 11:29 PM <sant0sh> to find out about the variable type
  548. 11:29 PM <sant0sh> var1 = 1
  549. 11:29 PM <sant0sh> var2 = 3
  550. 11:29 PM <sant0sh> its just an example
  551. 11:29 PM <nerret> chetusa, it will just replace the old value :P
  552. 11:30 PM <sant0sh> lets move on to strings
  553. 11:30 PM <chetusa> ya... i knw
  554. 11:30 PM <chetusa> :P
  555. 11:30 PM <sant0sh> you can define string in single quotes('), double quotes(") or triple quotes(''')
  556. 11:30 PM <sant0sh> example
  557. 11:30 PM <sant0sh> string1 = 'hello'
  558. 11:30 PM <sant0sh> string2 = "hello"
  559. 11:30 PM <sant0sh> string3 = '''hello world'''
  560. 11:31 PM <nerret> any significance about triple quotes?
  561. 11:31 PM <sant0sh> yes
  562. 11:31 PM <nerret> what?
  563. 11:31 PM <sant0sh> you can use triple quotes to comment code also
  564. 11:31 PM <Abhishek_Jain> it prints the quotes also
  565. 11:31 PM <sant0sh> will tell you later about that
  566. 11:31 PM <hackdroid> @sant0sh why all three? significance?
  567. 11:31 PM <sant0sh> its also used to print in multiple lines
  568. 11:31 PM <nerret> @sant0sh okay
  569. 11:32 PM <sant0sh> say you want to print like this
  570. 11:32 PM <nerret> @sant0sh yeah I tried
  571. 11:32 PM <sant0sh> this's new
  572. 11:32 PM <sant0sh> you can use single quote to do that
  573. 11:32 PM <nerret> in interpreter for multiple lines, ''' can be used
  574. 11:32 PM <sant0sh> you can't use single quote to do that
  575. 11:32 PM <sant0sh> that is
  576. 11:32 PM <sant0sh> 'this's new'
  577. 11:32 PM <sant0sh> will print "this"
  578. 11:32 PM <sant0sh> and will raise error for rest
  579. 11:33 PM <sant0sh> so you have to use
  580. 11:33 PM <sant0sh> "this's new"
  581. 11:33 PM <sant0sh> understood?
  582. 11:33 PM <nerret> Yes :D
  583. 11:33 PM <nerret> cool stuff
  584. 11:33 PM <ramrutha> @sant0sh yes
  585. 11:33 PM <nerret> sant0sh, objection again
  586. 11:33 PM <sant0sh> nerret, go on
  587. 11:34 PM <nerret> @sant0sh to print this's new, you should use triple quotes
  588. 11:34 PM <nerret> '''this's new'''
  589. 11:34 PM <sant0sh> you can also use double quotes
  590. 11:34 PM <nerret> @sant0sh okay. sorry. I used two single quotes and tried
  591. 11:35 PM <sant0sh> nevermind lets move on
  592. 11:35 PM <nerret> two single quotes and double quote are different
  593. 11:35 PM <sant0sh> yes
  594. 11:35 PM <nerret> @sant0sh cool
  595. 11:35 PM <sant0sh> regarding other datatypes will explain in later state
  596. 11:36 PM <nerret> sure.
  597. 11:36 PM <sant0sh> now more on comparison operators
  598. 11:36 PM <nerret> you mean tomorrow?
  599. 11:36 PM <sant0sh> now
  600. 11:36 PM <sant0sh> if you guys can stay awake till 12
  601. 11:36 PM <sant0sh> :)
  602. 11:36 PM <nerret> yeah, can stay.
  603. 11:36 PM <sant0sh> pingall: shall i continue now or will continue tomorrow?
  604. 11:36 PM <PyBot^> sarathms, brat197, hackdroid, coolbhavi, nitesh, abraar, nerret, pallavi, localhost1, chetusa, Vaishnavi, ramrutha, samruda, Abhishek_Jain, vrishabh, bhoom, maheshkumar, 6A4AAOQV9, abhiramr, psacrifice|away, dash-rai, kaustavdm
  605. 11:36 PM <PyBot^> shall i continue now or will continue tomorrow?
  606. 11:36 PM <Abhishek_Jain> yea
  607. 11:36 PM <ramrutha> continue
  608. 11:36 PM <Vaishnavi> Nw
  609. 11:36 PM <Abhishek_Jain> continue
  610. 11:36 PM <hackdroid> @sant0sh if you go on i dont mind going till 4
  611. 11:37 PM <sant0sh> lets go on then! :)
  612. 11:37 PM <chetusa> continue
  613. 11:37 PM <abhiramr> whoever wants to leave can follow the log.
  614. 11:37 PM <sant0sh> = is simple assignment operator
  615. 11:37 PM <abhiramr> both log and summary will be posted in the group
  616. 11:37 PM <sant0sh> == is comparing the two variable
  617. 11:38 PM <Abhishek_Jain> same as other languages :P
  618. 11:38 PM <sant0sh> more you can google about it
  619. 11:38 PM <sant0sh> yes its very much similar to other languages
  620. 11:38 PM <nerret> duckduckgo*
  621. 11:38 PM → Mahesh__ joined (75c011e8@gateway/web/freenode/ip.117.192.17.232)
  622. 11:39 PM <sant0sh> you can also use logical operators such as
  623. 11:39 PM <chetusa> check on the internet.. :P
  624. 11:39 PM <sant0sh> not
  625. 11:39 PM <sant0sh> and
  626. 11:39 PM <sant0sh> or
  627. 11:39 PM <sant0sh> 1.not
  628. 11:39 PM <sant0sh> 2.and
  629. 11:39 PM <sant0sh> 3.or
  630. 11:39 PM <sant0sh> lets jump to decision making
  631. 11:39 PM <sant0sh> condition I mean
  632. 11:40 PM <sant0sh> if, else if etc
  633. 11:40 PM <sant0sh> who doesnt know if construct in C?
  634. 11:40 PM <sant0sh> @all^^^
  635. 11:41 PM <nerret> everybody knows, I am assuming
  636. 11:41 PM <ramrutha> yup
  637. 11:41 PM <sant0sh> lets not assume!
  638. 11:41 PM <nerret> ok.. I am assuring.
  639. 11:42 PM <chetusa> seems like every1 knows..
  640. 11:42 PM <sant0sh> it will be good if you all respond quickly!
  641. 11:42 PM <sant0sh> so that session goes faster
  642. 11:42 PM <sant0sh> :)
  643. 11:42 PM <Abhishek_Jain> yea sure
  644. 11:43 PM <hackdroid> go on
  645. 11:43 PM <abhiramr> yeah
  646. 11:43 PM <sant0sh> the syntax of if loop is:
  647. 11:43 PM <Vaishnavi> Continue
  648. 11:43 PM <sant0sh> ok me continuing now
  649. 11:43 PM <sant0sh> the syntax of if loop is:
  650. 11:43 PM <sant0sh> if condition:
  651. 11:43 PM <sant0sh> data
  652. 11:43 PM <sant0sh> example:
  653. 11:44 PM <sant0sh> if 2==2:
  654. 11:44 PM <sant0sh> print "true"
  655. 11:44 PM <sant0sh> you can see white space over there
  656. 11:44 PM <sant0sh> that is indentation
  657. 11:44 PM <sant0sh> another super power of python
  658. 11:44 PM <sant0sh> you dont need to put brackets like C or c++
  659. 11:44 PM <abhiramr> Everyone, read this in your free time : http://pymbook.readthedocs.org/. Bookmark this link. Whenever you have a doubt, refer this!
  660. 11:44 PM — nitesh if loop?
  661. 11:45 PM <sant0sh> just use indentation
  662. 11:45 PM <sant0sh> indentation is 4 spaces or 1 tab
  663. 11:45 PM <sant0sh> indentation is like brackets in python
  664. 11:45 PM <sant0sh> is it working in your terminal
  665. 11:45 PM <sant0sh> @all??
  666. 11:45 PM <sant0sh> try implementing if loop
  667. 11:45 PM <nerret> @sant0sh if loop?
  668. 11:45 PM <nerret> or if conditional?
  669. 11:46 PM <abhiramr> http://pymbook.readthedocs.org/en/latest/ifelse.html#if-statement
  670. 11:46 PM <sant0sh> if condition
  671. 11:46 PM <abhiramr> Implement this ^
  672. 11:46 PM <nitesh> if construct is a better term
  673. 11:46 PM <hackdroid> not happening erroe with print statement
  674. 11:47 PM <ramrutha> indentation error
  675. 11:47 PM <sant0sh> wait let me send you the code
  676. 11:47 PM ⇐ sarathms quit ([email protected]) Ping timeout: 255 seconds
  677. 11:47 PM <chetusa> four spaces or one tab space isn't it..
  678. 11:47 PM <abhiramr> hackdroid: use pastebin.com to paste the error
  679. 11:47 PM <abhiramr> sant0sh: u can use this http://pymbook.readthedocs.org/en/latest/ifelse.html#if-statement
  680. 11:47 PM <nitesh> one more thing, if you want to send some code or output use the something like pastebin
  681. 11:47 PM <hackdroid> @abhiramr IndentationError: expected an indented block
  682. 11:48 PM <hackdroid> >>> if 2==2:
  683. 11:48 PM <hackdroid> ... print "true"
  684. 11:48 PM <hackdroid> File "<stdin>", line 2
  685. 11:48 PM <hackdroid> print "true"
  686. 11:48 PM <hackdroid> ^
  687. 11:48 PM <hackdroid> IndentationError: expected an indented block
  688. 11:48 PM <sant0sh> http://code.hackerearth.com/b266d6r
  689. 11:48 PM <sant0sh> check this
  690. 11:48 PM <ramrutha> okay got it
  691. 11:48 PM <nerret> hackdroid: use a tab space
  692. 11:48 PM <nitesh> hackdroid: use pastebin
  693. 11:48 PM <nerret> and please don't paste the code here
  694. 11:48 PM <abhiramr> hackdroid: use pastebin.com
  695. 11:48 PM <sant0sh> try checking the codevideo side to see how its done
  696. 11:48 PM <sant0sh> when everyone is ready ping me
  697. 11:48 PM <nerret> http://ideone.com/6hbtTY
  698. 11:49 PM — abhiramr feels codetable is cool
  699. 11:49 PM <nerret> sant0sh: ping
  700. 11:49 PM <nitesh> use something like http://paste.debian.net/ to paste code or output
  701. 11:49 PM <sant0sh> anything is fine!
  702. 11:50 PM <nerret> or paste.ubuntu.com :P
  703. 11:50 PM <brat197> +1 for codetable
  704. 11:50 PM <nitesh> ya anything
  705. 11:50 PM ⇐ Vaishnavi quit ([email protected]) Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )
  706. 11:50 PM <nitesh> don't paste on channel
  707. 11:50 PM <ramrutha> @sant0sh done
  708. 11:50 PM <sant0sh> great! :)
  709. 11:50 PM <abhiramr> sant0sh: We'll end at 12.
  710. 11:50 PM <sant0sh> sure
  711. 11:50 PM <chetusa> @sant0sh I need a workspace..
  712. 11:51 PM <sant0sh> i said codetable because you can see how i coded in that using codeVideo in right panel!
  713. 11:51 PM <chetusa> I dont have python on windows...
  714. 11:51 PM <sant0sh> try code.hackerearth.com
  715. 11:51 PM <nerret> you can install
  716. 11:51 PM <sant0sh> you can compile codes there
  717. 11:51 PM <sant0sh> :)
  718. 11:51 PM <hackdroid> @sant0sh great
  719. 11:51 PM <chetusa> ty
  720. 11:51 PM <brat197> advertisement zyada ho gaya
  721. 11:52 PM <nerret> haha
  722. 11:52 PM <sant0sh> :D
  723. 11:52 PM <abhiramr> lol
  724. 11:52 PM <nitesh> +1 brat197
  725. 11:52 PM <sant0sh> ok lets get back to session
  726. 11:52 PM <nerret> increment milega
  727. 11:52 PM — hackdroid codetable is sweet :)
  728. 11:52 PM <sant0sh> http://code.hackerearth.com/b266d6r
  729. 11:52 PM <sant0sh> check this
  730. 11:53 PM <sant0sh> on how to implement if-else
  731. 11:53 PM <sant0sh> when done ping me
  732. 11:54 PM <nerret> @sant0sh ping
  733. 11:54 PM <abhiramr> working
  734. 11:54 PM <abhiramr> sant0sh:
  735. 11:54 PM <sant0sh> nerret, tell me
  736. 11:54 PM <ramrutha> @sant0sh done
  737. 11:54 PM <nerret> you asked to ping when done
  738. 11:54 PM <nerret> :P
  739. 11:54 PM <ramrutha> @nerret :D
  740. 11:54 PM <hackdroid> @sant0sh done
  741. 11:54 PM <sant0sh> ok great!@
  742. 11:55 PM <sant0sh> will move to next
  743. 11:55 PM <sant0sh> everyone knows about for loop right?
  744. 11:55 PM <abhiramr> yes
  745. 11:55 PM <ramrutha> @sant0sh yes
  746. 11:55 PM <hackdroid> yeah
  747. 11:55 PM <sant0sh> who doesnt know please tell me quickly
  748. 11:56 PM <brat197> finish off today by showing them how to swap two variables :P
  749. 11:56 PM <sant0sh> :)
  750. 11:56 PM <Abhishek_Jain> yes
  751. 11:56 PM <sant0sh> ok will move to for loops
  752. 11:57 PM <sant0sh> range(10)
  753. 11:57 PM <sant0sh> displays from 0 to 9
  754. 11:57 PM <sant0sh> try in your terminal
  755. 11:57 PM <nerret> yes
  756. 11:58 PM <hackdroid> @sant0sh that was so cool
  757. 11:58 PM <Abhishek_Jain> done
  758. 11:58 PM <sant0sh> great! :)
  759. 11:58 PM <ramrutha> @sant0sh done
  760. 11:58 PM <sant0sh> syntax of for loop is
  761. 11:58 PM <sant0sh> for iterating_var in sequence:
  762. 11:58 PM <sant0sh> statements(s)
  763. 11:59 PM <sant0sh> for example check this
  764. 11:59 PM <sant0sh> http://code.hackerearth.com/b266d6r
  765. 11:59 PM <sant0sh> when done tell me'
  766. 11:59 PM <abhiramr> done
  767. 12:00 AM <nerret> @sant0sh done
  768. 12:00 AM <ramrutha> @sant0sh done
  769. 12:00 AM <sant0sh> anywhere you guys stuck in?
  770. 12:00 AM <sant0sh> any doubts?
  771. 12:00 AM <nerret> @sant0sh how to give custom range?
  772. 12:00 AM <hackdroid> @sant0sh cool
  773. 12:01 AM <sant0sh> range(4,10)
  774. 12:01 AM <sant0sh> nerret, ^^^
  775. 12:01 AM <nerret> @sant0sh cool.. thanks
  776. 12:01 AM <nerret> done
  777. 12:01 AM <sant0sh> great!
  778. 12:01 AM <sant0sh> now i hope you know for loop
  779. 12:01 AM <chetusa> @sant0sh
  780. 12:01 AM <sant0sh> :)
  781. 12:01 AM <sant0sh> chetusa, yes tell
  782. 12:02 AM <hackdroid> @sant0sh so every time we use for loop we use this way only not the usual syntax?
  783. 12:02 AM <chetusa> @sant0sh if i give tab space or space there
  784. 12:02 AM <chetusa> it gives error
  785. 12:02 AM <chetusa> but i put print"asdad"
  786. 12:02 AM <chetusa> its working
  787. 12:02 AM <sant0sh> where did you execute
  788. 12:02 AM <sant0sh> in codetable^^^
  789. 12:02 AM <nerret> chetusa, send the link
  790. 12:02 AM <sant0sh> chetusa, yes send the link
  791. 12:02 AM <chetusa> @sant0sh ya
  792. 12:03 AM <sant0sh> in codetable it automatically puts space or tab
  793. 12:03 AM <sant0sh> you need not put explicitly
  794. 12:03 AM <Abhishek_Jain> it works even if we give more than one tab..i tried it works
  795. 12:04 AM <sant0sh> oh is it
  796. 12:04 AM <sant0sh> send the link Abhishek_Jain ^^^
  797. 12:04 AM <Abhishek_Jain> http://code.hackerearth.com/5afc12V
  798. 12:04 AM <chetusa> @sant0sh http://code.hackerearth.com/cab8bbX
  799. 12:05 AM <sant0sh> chetusa, else is under the if loop
  800. 12:05 AM <nerret> @chetusa your else has gone inside the if
  801. 12:05 AM <sant0sh> see the indentation
  802. 12:05 AM <nerret> it should come out
  803. 12:05 AM <Abhishek_Jain> @santosh It works right ?
  804. 12:05 AM <sant0sh> haha yes
  805. 12:06 AM <nerret> chetusa, check http://code.hackerearth.com/181054D
  806. 12:06 AM <sant0sh> anyways lets finish it here!
  807. 12:06 AM <nerret> I fixed your code
  808. 12:06 AM <sant0sh> will get back to you when you guys want another session
  809. 12:06 AM <sant0sh> :)
  810. 12:06 AM <nerret> @sant0sh come tomorrow
  811. 12:06 AM <abhiramr> sant0sh: Giving assignment?
  812. 12:06 AM <hackdroid> santosh coming tomorrow? right?
  813. 12:06 AM <Abhishek_Jain> yea see you tomorrow Santosh
  814. 12:07 AM <nerret> yeah, assignment please
  815. 12:07 AM <sant0sh> one assignment
  816. 12:07 AM <sant0sh> to all
  817. 12:07 AM <nerret> i think bubble sort in python would be a good assignment
  818. 12:07 AM <sant0sh> *
  819. 12:07 AM <sant0sh> **
  820. 12:07 AM <sant0sh> ***
  821. 12:07 AM <sant0sh> *****
  822. 12:07 AM <nerret> @sant0sh that is easy :P
  823. 12:07 AM <chetusa> ty
  824. 12:07 AM <sant0sh> try to print this in python
  825. 12:07 AM <chetusa> @nerret
  826. 12:07 AM <sant0sh> question to all
  827. 12:07 AM <nerret> @sant0sh will submit now itself
  828. 12:07 AM <ramrutha> @sant0sh okay
  829. 12:07 AM <chetusa> cool
  830. 12:08 AM <sant0sh> pingall: how to swap two numbers
  831. 12:08 AM <PyBot^> Mahesh__, brat197, hackdroid, coolbhavi, nitesh, abraar, nerret, pallavi, localhost1, chetusa, ramrutha, samruda, Abhishek_Jain, vrishabh, bhoom, maheshkumar, 6A4AAOQV9, abhiramr, psacrifice|away, dash-rai, kaustavdm
  832. 12:08 AM <PyBot^> how to swap two numbers
  833. 12:08 AM <Abhishek_Jain> yea cool
  834. 12:08 AM <sant0sh> professionals need not answer this
  835. 12:08 AM <sant0sh> reply now
  836. 12:08 AM — abhiramr types ans erases
  837. 12:08 AM <chetusa> for?
  838. 12:08 AM <abhiramr> *and
  839. 12:08 AM <chetusa> swap or pattern
  840. 12:08 AM <chetusa> or both
  841. 12:09 AM <sant0sh> a=2
  842. 12:09 AM <sant0sh> b=3
  843. 12:09 AM <sant0sh> swap these two variables in one line
  844. 12:09 AM <hackdroid> @sant0sh using two variable or temporary variable?
  845. 12:09 AM <sant0sh> no temporary variable
  846. 12:10 AM <hackdroid> a=a+b
  847. 12:10 AM <Abhishek_Jain> a=a+b,b=a-b
  848. 12:10 AM <hackdroid> b=a-b
  849. 12:10 AM <sant0sh> nope
  850. 12:10 AM <sant0sh> one line thats it
  851. 12:10 AM <hackdroid> a=a-b
  852. 12:11 AM — Abhishek_Jain is thinking ! wait !
  853. 12:11 AM <ramrutha> (a,b)=(b,a)
  854. 12:11 AM <Abhishek_Jain> a=a+b && b=a-b
  855. 12:11 AM <chetusa> @ramrutha +1
  856. 12:12 AM <abhiramr> sant0sh: the cat is outta the bag :P
  857. 12:12 AM <ramrutha> :-D
  858. 12:12 AM <hackdroid> @sant0sh i still didnt get that
  859. 12:12 AM <sant0sh> ramrutha, good
  860. 12:13 AM <sant0sh> the answer is
  861. 12:13 AM <sant0sh> a,b=b,a
  862. 12:13 AM <hackdroid> @sant0sh elaborate plz
  863. 12:13 AM <abhiramr> Repeating the assignment - "Please write a Python script to print the following pattern using loops http://pastebin.com/zskDZGg8"
  864. 12:13 AM <sant0sh> ramrutha, ^^^
  865. 12:14 AM <abhiramr> hackdroid: we'll finish off with attendance. then u can ask sant0sh
  866. 12:14 AM <abhiramr> Attendace
  867. 12:14 AM <abhiramr> Abhiram R
  868. 12:14 AM <sant0sh> cool
  869. 12:14 AM <hackdroid> hackdroid
  870. 12:14 AM <sant0sh> abhiramr, let me make your task easier
  871. 12:14 AM <ramrutha> its more like re-assigning values
  872. 12:14 AM <sant0sh> pingall: yell your name
  873. 12:14 AM <PyBot^> Mahesh__, brat197, hackdroid, coolbhavi, nitesh, abraar, nerret, pallavi, localhost1, chetusa, ramrutha, samruda, Abhishek_Jain, vrishabh, bhoom, maheshkumar, 6A4AAOQV9, abhiramr, psacrifice|away, dash-rai, kaustavdm
  874. 12:14 AM <PyBot^> yell your name
  875. 12:15 AM — abhiramr thanks PyBot^
  876. 12:15 AM <chetusa> Chaitanya
  877. 12:15 AM <sant0sh> hackdroid, farhan
  878. 12:15 AM <Abhishek_Jain> Abhishek
  879. 12:15 AM <ramrutha> Amrutha
  880. 12:15 AM <abhiramr> < -- SESSION 4 END -- >
Advertisement
Add Comment
Please, Sign In to add comment