Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,452 members, 7,823,062 topics. Date: Thursday, 09 May 2024 at 11:00 PM

Gbolly1151's Posts

Nairaland Forum / Gbolly1151's Profile / Gbolly1151's Posts

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 16 pages)

Family / Re: "Marry Your Friend" - Who Then Is Your Friend? by gbolly1151(m): 2:43pm On Jul 06, 2020
Grandlord:
Some people on the quest to be

Most young, designer pastors do this and you see the church members nodding in agreement. Laff fit kill me cheesy cheesy
Most Christian trust their pastor more than God
Programming / 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)


Example:
class Person:
p=locals()
def __init__(self,fname,lname,age):
self.fname=fname
self.lname=lname
self.age=age

def fullname(self):
return '{0} {1}'.format(self.fname,self.lname)

Bob=Person('bob','alex',20)
print(hasattr(Bob,'fname')) #return True
print(hasattr(Bob,'lname')) #return True
print(hasattr(Bob,'fullname')) #return True
print(hasattr(Bob,'age')) #return True
print(hasattr(Bob,'DOB')) #return False

print(getattr(Bob,'lname')) #same as Bob.lname return alex
print(getattr(Bob,'fullname')) #return function object like <bound object....at 0xefbad> same as Bob.fullname
print(getattr(Person,'fullname')) #same as Person.fullname

setattr(Bob,'age',40) #same as bob.age=40
print(Bob.age) #return 40
Programming / Re: 10 Ways To Get High Paid Job In Tech Companies, No 8 May Shock You by gbolly1151(m): 9:09am On Jul 06, 2020
Tim1212:
I will personally donate NGN240, 000 a scholarship fund to 5 individual for 12 months, to learn software design, mobile application design, software architecture, UI/UX, OS design and web design @ diib Academy.

Also will pledge NGN 100 000 investment fund to 5 Startup, SMEs, for 6 months. To support small businesses to invest the funds in SEO and ICT through diib Nigeria.

The white people do this to support Startup, SMEs and small businesses to grow faster. Many Tech company's CEO in US donate funds to assist business owners. Some companies make their quality services free because of the pandemic, to protect their small businesses.

I will do the same in my country in my own capacity. I encourage others to do the same.

I interested in software development (Blockchain Field) and currently building a Blockchain software using python just to learn.... Help a desperate and passionate python programmer

1 Like

Programming / Re: Programming: Video Or PDF Tutorials, Which Is Best? by gbolly1151(m): 8:56am On Jul 06, 2020
Video look boring to me,i use pdf for all my learning
Programming / 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

example1
this for loop statement end with the help of break so
else statment wont be excecuted

for i in range(1,5):
print(i)
if i == 4: break
else:
print('hi')

output:
1
2
3
4

example2
this for loop statement end without the help of
break,so else statement get executed

for i in range(1,5):
print(i)
else:
print('hi')

output:
1
2
3
4
hi

example3
using while loop

start=1
while True:
print(start)
start += 1
if start == 5: break
else:
print('hi')


output:
1
2
3
4

start=1
while start < 5:
print(start)
start += 1
else:
print('hi')

output:
1
2
3
4
hi
Programming / 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:

'''

class Profile:
def __init__(self,name,age,sex,nationality):
self.name=name
self.age=age
self.sex=sex
self.nationality= nationality


obj=Profile('sam',20,'M','Nigeria')
#it is boring to access each attribute using attribute name like this
print(obj.name)
print(obj.age)
print(obj.sex)
print(obj.nationality,'\n')

'''
output:
sam
20
M
Nigeria

problem with that approch is that,it is boring
to update and write for large attribute,the lines of
code to use is equal to number of attributes
'''

# A fast approach is using vars()

for key,value in vars(obj).items():
print(value)

'''
output:
sam
20
M
Nigeria

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
'''
Programming / 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

sex='F'
if sex == 'M' or 'm':
print('Male')
else:
print('Female')

#ouput : Male

"""
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

sex = 'F'
if True:
print('Male')
else:
print('Female')



to correct the bug, just rewrite the code this way"""

sex='F'

if sex == 'M' or sex == 'm':
print('Male')
else:
print('Female')

#output: Female
Programming / Re: Python Gurus Please Help Me With This Code. by gbolly1151(m): 12:02pm On Jun 29, 2020
Brukx:

Show us how

[Code]
[/code]

Change C to c


Example

class hello:
pass
Programming / Re: Python Gurus Please Help Me With This Code. by gbolly1151(m): 11:52am On Jun 29, 2020
Area where i think should improve on is how to use @property decorator to change the behavior of getter methods where necessary, remove setter method where not needed and the class will be perfect. Just my few cents
Programming / How Is Blockchain Job Size In Nigeria? by gbolly1151(m): 9:55pm On Jun 28, 2020
Please do anyone know about Blockchain development job in Nigeria? should share his/her experience, the possible market size and future outlook in few years
Programming / 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

age=1

while age > 0:
age=input('enter your age:')
print('your age is ',age)
Programming / Re: Chronicle Of A Data Scientist/analyst by gbolly1151(m): 6:43pm On Jun 27, 2020
dauddy97:

Let me add to this.
I see no way, learning Programming will affect your studies.
I do have lecture from morning still evening most time and i must revise all note taken that day,you see that no time Left to pick programing for 1hour.

what works for you might not work for me
Programming / Re: Chronicle Of A Data Scientist/analyst by gbolly1151(m): 6:38pm On Jun 27, 2020
dauddy97:

Learning Programming makes you smarter and be able to think logically. If you find Programming easy, bro your studies will be piece of cake.

Am with you on this bro...programming will change your thinking

2 Likes

Programming / Re: Chronicle Of A Data Scientist/analyst by gbolly1151(m): 6:35pm On Jun 27, 2020
saheedniyi22:

I'm a Python programmer with machine learning knowledge,
I've seen your thread on Python best practices but it looks tough I don't seem to get some stuffs there, kindly recommend some texts or courses I can take that will help me improve( especially on Data Structure and OOP).

Thanks
On Data structure

Data Structures and Algorithms in Python by Michael T. Goodrich , Irvine Roberto Tamassia , Michael H. Goldwasser

Data structure and algorithms in python By Benjamin Baka


For OOP use realpython.com and learn class diagram (search on google for this)

2 Likes

Programming / Re: Chronicle Of A Data Scientist/analyst by gbolly1151(m): 4:02pm On Jun 27, 2020
TMwise1942:
Please can someone learn programing while going to school, and won't be distract answer is needing please � thanks in advance
I started learning python before i got admitted and still learning in the education system,currently in 300L geology and 4.55 CGPA

What help me is that i focus on programming in holiday and go off when i resume back in school

Currently i have acquired various skills in computer science

1.Data structure
2.OOP
3.backend development using django

I am an intermediate python programmer

Just schedule your time and dont be carried away by programming in school

2 Likes

Programming / 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)
'''

fruits = ['banana','orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana']
#let get first position of banana
print(fruits.index('banana')) #output: 0

#To specify where searching to begin,add optional arguement start position

print(fruits.index('banana',5)) #output: 7

# The searching start from kiwi i.e fruits[5:]

#you can also specify where searching should stop

print(fruits.index('banana',1,5)) #output:4

#here searching begin at position 1 (orange) and end at position 5(kiwi)
Politics / Re: Charles Idahosa Dumps APC, Says PDP A More Organised Party by gbolly1151(m): 6:44pm On Jun 25, 2020
Lolz...same set of people under new name, political party in Nigeria is just a wrapper
European Football (EPL, UEFA, La Liga) / Re: Southampton Vs Arsenal - (0 - 2) On 25th June 2020 by gbolly1151(m): 4:38pm On Jun 25, 2020
Hmm...arsenal
Health / Re: 649 New COVID-19 Cases, 275 Discharged And 9 Deaths On June 24 - (2047 Tested) by gbolly1151(m): 12:56am On Jun 25, 2020
Between north and south who observe personal hygiene past and what is the result now.....this isn't clear
Programming / Re: Low Views On Nairaland? See How To Get More Views by gbolly1151(m): 5:37pm On Jun 23, 2020
Lateztblog:
Whenever you post u experience you got low views like 100+
This is what to do!!!

Whenever you want to post, don’t post MIGHT LIKE. Post what THEY LIKE.

For example I post

1:BUHARI is going to China and also post
2:TRUMP is going to China
Which one do u think people will view most

Of course buhari is going to China bcuz we live in Nigeria we don’t have much business to do with trump... they MIGHT LIKE to view TRUMP IS GOING TO CHINA. But They LIKE to view BUHARI GOING TO CHINA

IS THIS FEED HELPFUL?: yes or no

Don’t forget to check www.lateztblog.

Lolz...post about snake on Nairaland ,you will see how people will rush your post
Programming / 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
'''

x=''
y='hello'
print('bool of x is ',bool(x)) #output: False
print('bool of y is ',bool(y)) #output: True
Programming / Re: Let Learn Artificial Neutral Network by gbolly1151(m): 11:01am On Jun 20, 2020
Dwise19990:

Now I see where our mathematics is applied
If hou learn algorithm analysis, you will appreciate math more because it bring math closer to real world
Programming / Re: Let Learn Artificial Neutral Network by gbolly1151(m): 10:59am On Jun 20, 2020
Dwise19990:

Now I see where our mathematics is applied
Yes....in Nigeria school, they just hardcode math into our brain without no full application
Programming / Re: Common good python programming practices you should know by gbolly1151(m): 8:50pm On Jun 19, 2020
iCode2:
Nice! You're set for it.
Not fully set,but moving closer

1 Like

Software/Programmer Market / Re: Join Programners Hub by gbolly1151(m): 7:46pm On Jun 19, 2020
Pls add me o oo 07060435624
Programming / Re: Common good python programming practices you should know by gbolly1151(m): 6:11pm On Jun 19, 2020
iCode2:
Okay thanks. Which area do you major? Web dev or data science?

I really want to specialize in software development (in Blockchain space)

1 Like

Programming / Re: Common good python programming practices you should know by gbolly1151(m): 6:08pm On Jun 19, 2020
Predstan:


Keeps directing me to buy the book. I dont know if its because of my Location

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
Programming / Re: Common good python programming practices you should know by gbolly1151(m): 3:49pm On Jun 19, 2020
Predstan:


I am using one by Rance D. Necaise. Do you have the link to the pdf?

It should be first on Google search sir
Programming / Re: Let Learn Artificial Neutral Network by gbolly1151(m): 3:48pm On Jun 19, 2020
Runningwater:

What courses, tutorials, or ebooks are you using to learn about the artificial neural networks (ANN)? So I can learn more too.
Thanks in advance
Pdf

Neural Networks and Deep Learning by Michael Nielsen

1 Like

Programming / Re: Common good python programming practices you should know by gbolly1151(m): 1:23pm On Jun 19, 2020
iCode2:
Did you take any course on that or you got to understand it over time?
No course just pdf
You can download this pdf Data Structures and Algorithms in Python by Michael T. Goodrich

3 Likes

Programming / Re: Let Learn Artificial Neutral Network by gbolly1151(m): 8:01am On Jun 19, 2020
Runningwater:
Blast!!! Nice thread posts. Machine learning intrigued me. I could implement some codes in Matlab, simpler problems anyway. Kudos to you keep it burning.
Hmm...thank bro but might take time to resume this thread

1 Like

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 16 pages)

(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. 45
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.