Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,585 members, 7,955,153 topics. Date: Saturday, 21 September 2024 at 06:05 PM |
Nairaland Forum / Science/Technology / Programming / Common good python programming practices you should know (13394 Views)
A Thread For Tutorial On Python Programming / A Very Good Python Programmer Needed Asap / Recommend A Good Python Data Mining Book (2) (3) (4)
(1) (2) (3) (4) (5) (6) (7) (8) (Reply) (Go Down)
Re: Common good python programming practices you should know by gbolly1151(m): 9:44pm On Jun 18, 2020 |
iCode2:Sure it will work |
Re: Common good python programming practices you should know by gbolly1151(m): 9:59pm On Jun 18, 2020 |
iCode2:Dont mind my naming
|
Re: Common good python programming practices you should know by iCode2: 10:15pm On Jun 18, 2020 |
gbolly1151:Hmmmm you've so grabbed Python concept. I hope to be like you when I grow up. |
Re: Common good python programming practices you should know by gbolly1151(m): 7:35am On Jun 19, 2020 |
iCode2:It is not about the language, it is about data structure and algorithm sir |
Re: Common good python programming practices you should know by iCode2: 9:12am On Jun 19, 2020 |
gbolly1151:Did you take any course on that or you got to understand it over time? 1 Like |
Re: Common good python programming practices you should know by gbolly1151(m): 1:23pm On Jun 19, 2020 |
iCode2:No course just pdf You can download this pdf Data Structures and Algorithms in Python by Michael T. Goodrich 3 Likes |
Re: Common good python programming practices you should know by Predstan: 2:45pm On Jun 19, 2020 |
gbolly1151: I am using one by Rance D. Necaise. Do you have the link to the pdf? |
Re: Common good python programming practices you should know by gbolly1151(m): 3:49pm On Jun 19, 2020 |
Predstan: It should be first on Google search sir |
Re: Common good python programming practices you should know by Predstan: 3:55pm On Jun 19, 2020 |
gbolly1151: Keeps directing me to buy the book. I dont know if its because of my Location |
Re: Common good python programming practices you should know by iCode2: 5:32pm On Jun 19, 2020 |
gbolly1151:Okay thanks. Which area do you major? Web dev or data science? |
Re: Common good python programming practices you should know by gbolly1151(m): 6:08pm On Jun 19, 2020 |
Predstan: Sorry bro...i should have sent the link https://www.google.com/url?sa=t&source=web&rct=j&url=http://predmet.singidunum.ac.rs/pluginfile.php/14584/mod_folder/content/0/Data%2520Structures%2520and%2520Algorithms%2520in%2520Python%2520%255BGoodrich%252C%2520Tamassia%2520%2520Goldwasser%25202013-03-18%255D.pdf%3Fforcedownload%3D1&ved=2ahUKEwiqvev2rY7qAhXS2aQKHYGzDeoQFjAAegQIBhAB&usg=AOvVaw0_J9ADcYtLK-LBzI7uQkuW Or search for Data Structures and Algorithms in Python Michael T. Goodrich Department of Computer Science University of California, Irvine Roberto Tamassia Department of Computer Science Brown University Michael H. Goldwasser Department of Mathematics and Computer Science Saint Louis University pdf |
Re: Common good python programming practices you should know by gbolly1151(m): 6:11pm On Jun 19, 2020 |
iCode2: I really want to specialize in software development (in Blockchain space) 1 Like |
Re: Common good python programming practices you should know by Predstan: 6:19pm On Jun 19, 2020 |
gbolly1151: Thanks Boss.. This is Okay |
Re: Common good python programming practices you should know by iCode2: 8:44pm On Jun 19, 2020 |
gbolly1151:Nice! You're set for it. 1 Like |
Re: Common good python programming practices you should know by gbolly1151(m): 8:50pm On Jun 19, 2020 |
iCode2:Not fully set,but moving closer 1 Like |
Re: Common good python programming practices you should know by rastaxarm(m): 3:17am On Jun 21, 2020 |
iCode2: def join_list(items) : return ",".join(items) print(join_list(spam)) |
Re: Common good python programming practices you should know by rastaxarm(m): 3:20am On Jun 21, 2020 |
|
Re: Common good python programming practices you should know by gbolly1151(m): 3:36pm On Jun 21, 2020 |
REMINDER: bool of empty string is False and bool of any string or character is True '''
|
Re: Common good python programming practices you should know by gbolly1151(m): 2:01pm On Jun 26, 2020 |
How To Use Index Method In List To find the first position of a particular element in a list,index method get you covered; the syntax is list.index(element [,start[,end]]) (start and end are optional) '''
|
Re: Common good python programming practices you should know by gbolly1151(m): 8:49pm On Jun 27, 2020 |
What is sentinel? Sentinel in programming is a value that help to stop the execution of a sequence. E.g
|
Re: Common good python programming practices you should know by gbolly1151(m): 10:14pm On Jun 30, 2020 |
TYPICAL MICRO BUG YOU MUST AVOID IN PYTHON There is often hidden bug that most begginers do encounter when using conditional statement example
""" hmm...but why is the output Male? This is how python evaluate the if statement above. it evaluate from left to right starting with sex == 'M' which return False,then evaluate the result with next condition, False or 'm' which is True, if you are worried how we evaluate bool and str, here is how it works bool('m') return True,so in real sense we are evaluating False or True which make us arrive at True,now sex == 'M' or 'm' result to True which make code under if triggered. the way python see above code is this
to correct the bug, just rewrite the code this way"""
|
Re: Common good python programming practices you should know by gbolly1151(m): 9:23am On Jul 01, 2020 |
ACCESS CLASS ATTRIBUTE IN FEW LINES OF CODE USING VARS() Let assume you have class profile and its attributes, you can access them in two lines of code compare compare to what we know before example: '''
wow we achieve same result in just two lines of code regardeless of the number of attributes Note: side effect of this approch is that,it is unordered ''' |
Re: Common good python programming practices you should know by gbolly1151(m): 7:57pm On Jul 02, 2020 |
DO YOU KNOW THAT else KEYWORD WORKS WITH while AND for LOOP? the purpose of else statement in for and while loop is to get executed when loop ended without break statement
|
Re: Common good python programming practices you should know by gbolly1151(m): 9:21am On Jul 06, 2020 |
HOW TO USE hasattr,getattr AND setattr >>hasattr is to check if a particular object/class has a particular attribute. syntax hasattr(obj,attribute_name), it return True or false >>getattr is use to get the value of an object(function,variable,class and other object), if available else it return AttributeError syntax is getattr(obj,attribute_name) >>setattr is used to set the attribute of an object syntax is setattr(obj,attribute_name,value)
|
Re: Common good python programming practices you should know by gbolly1151(m): 11:37am On Jul 11, 2020 |
KEY DIFFERENT BETWEEN return AND yield IN PYTHON Return - this keyword terminate a function Yield - pause the execution of a function |
Re: Common good python programming practices you should know by gbolly1151(m): 2:37pm On Jul 12, 2020 |
CHECK OUT THIS PYTHON FLOW
|
Re: Common good python programming practices you should know by gbolly1151(m): 1:49pm On Jul 19, 2020 |
|
Re: Common good python programming practices you should know by gbolly1151(m): 7:25am On Aug 11, 2020 |
Quite an age here |
Re: Common good python programming practices you should know by Predstan: 3:39am On Aug 12, 2020 |
gbolly1151:Yeah, where have you been? I don day use tensorflow |
Re: Common good python programming practices you should know by gbolly1151(m): 4:20am On Aug 12, 2020 |
Predstan:Wao!!!...that is cool bro,keep moving |
Re: Common good python programming practices you should know by gbolly1151(m): 7:39pm On Oct 14, 2020 |
It been a while here |
(1) (2) (3) (4) (5) (6) (7) (8) (Reply)
What Attracted You To Learn how to code? / In What Order Did You Learn Your Languages? / Where Is That Female Geek: Any Good Female Developer Around?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 47 |