Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,639 members, 7,823,815 topics. Date: Friday, 10 May 2024 at 03:53 PM

Scarplanet's Posts

Nairaland Forum / Scarplanet's Profile / Scarplanet's Posts

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

Investment / Re: Litecoin Wallet by scarplanet(m): 1:11am On Dec 02, 2020
Use Binance
Software/Programmer Market / Re: Do You Want Paid Udemy Courses For Free? Get In Here by scarplanet(m): 8:35am On Jun 17, 2020
ThatPetiteChic:


Pls ma, can you help with this course

I saw this course on Udemy and thought of you.
https://www.udemy.com/share/1023JGAEIZdF5SQn0H/

Not Free.

Well done @EazyJ, you are doing well.

1 Like

Romance / Re: I Need You Advice by scarplanet(m): 11:20pm On Jun 07, 2020
undecided undecided
Programming / Re: Python 3: Exercises And Solutions. by scarplanet(m): 7:31pm On Jun 04, 2020
class Solution:

def __init__(self, n):
self.n = list(n)

def prog(self):
print("Total Number: ", len(self.n))
print("Last Item: ", self.n[-1])
print("Reverse List: ", self.n[::-1])
l = filter(lambda x: x == 5, self.n)
print("YES List Contains 5" if 5 in list(l) else "NO List does not contain 5" )
print("Number of fives in list: ", self.n.count(5))
_, *b, _ = self.n
print("Sorted list minus first and last elements: ", sorted([*b]))
y = filter(lambda x: x < 5, self.n)
print("Number less than five: ", len(list(y)))

list_elements = eval(input("Enter desired integers separated by comma: " ))
sol = Solution(list_elements)
sol.prog()
Programming / Re: Python 3: Exercises And Solutions. by scarplanet(m): 7:28pm On Jun 04, 2020
iCode2:
I've tried my hands on this though. I want to see if someone can answer it a different way. Maybe yours will be better.

Write a program that asks the user to enter a list of integers. Do the following:
(a) Print the total number of items in the list.
(b) Print the last item in the list.
(c) Print the list in reverse order.
(d) Print Yes if the list contains a 5 and No otherwise.
(e) Print the number of fives in the list.
(f) Remove the first and last items from the list, sort the remaining items, and print the result.
(g) Print how many integers are less than 5

.
Programming / Re: Data Structures And Algorithms: A Beginner's Journey. by scarplanet(m): 2:16pm On Jun 04, 2020
Paying attention....

1 Like

Programming / Re: Programming Learning Challenge June. by scarplanet(m): 2:10pm On Jun 04, 2020
SQL
Programming / Re: Data Science Advise Please by scarplanet(m): 6:39pm On May 25, 2020
omoluabiguy:



Every programming language has their own strengths and advantages so the answer to your question would determine what system you want to build and what you need to achieve. C++ is one of the oldschool languages while python is one of the new generation languages. They both have their own advantages

You claim to be a Software industry veteran, and this is the "wack" response you can give to a simple question??
I pity those you have been teaching!

1 Like

Programming / Re: Let Learn Artificial Neutral Network by scarplanet(m): 1:45pm On May 21, 2020
gbolly1151:

Hmm...praise?


Negative. Try again grin grin
Health / Re: How I Burnt My Chest After Using Harsh Chemicals On It (Graphic) by scarplanet(m): 1:36pm On May 21, 2020
Dont Joke with this please oo..

Cancer can easily set in if your arent careful. See qualified medical practitioner immediately shocked shocked shocked
Programming / Re: Let Learn Artificial Neutral Network by scarplanet(m): 9:54pm On May 20, 2020
gbolly1151:
The backbone or foundation of deep learning is from this equation below


Y=a+bx

what ANN is looking for is a and b

A typical question to throw to the network is if Y= 1 and X=0 find a and b

How ANN find a and b is as follows
1. first get random value for a and b
2. Calculate Y from x using a and b generated (a + bx)
3. If output is not equal to Y,update a and b and try again

On a norm we can do this by bruce-force method but it consume a lot of time and resources to find the real a and b

How ANN minimize the error is by calculating a and b from the error obtain using gradient decent

Error= Y - YP (YP = output gotten from random pick for a and b]

This error is used to update our a and b by finding the rate at which a and b has contributed to the error i.e dE/db and dE/da

Our new a and b for next testing will

a=a + dE/da
b=b + dE/db

in order to speed up our findings we add step called learning rate n

So new equation is

a= a + n dE/da
b=b + n dE/db

we will continue updating still we find the real a and b that satisfy the equation.


Nice one Tag wink wink

1 Like

Programming / Re: Which Programming Language Should A Beginner Start With? by scarplanet(m): 2:32am On May 19, 2020
Oladara003:
Is there anyone who knows a protective software that can cover ones IP

Why do you want to mask your IP.... Are you doing something illegal?
Programming / Re: Why Is Python Programming So Hard To Understand by scarplanet(m): 2:19pm On Apr 29, 2020
gbolly1151:


Soory for late reply,just got my acct back....pycharm is the best,but i do use pyscripter

Anyways, not many persons will agree with you that Pycharm is the best. Do you realise that Pycharm is not entirely free??

Just use the IDE you feel most comfortable with and that works well for you. Other IDEs include Jupyter, Eclipse, Visual Studio, Spyder, Sublime Text e.t.c

1 Like

Programming / Re: Python 3: Exercises And Solutions. by scarplanet(m): 12:57am On Apr 29, 2020
SKYQUEST:
Great job guys!

Write a python program where python LOOKS FOR Total Assets and Total liabilities in the attached table and returns the value of the ratio of the two given variables as per their values in the table.


Is this a job at your workplace or an assignment given to you? Oya confess cheesy grin

1 Like

Programming / Re: A Thread For Tutorial On Python Programming by scarplanet(m): 12:54am On Apr 29, 2020
LordAA:


Hi. Thanks for your response.
Please I need materials to learn it.

Materials to learn what precisely?
Programming / Re: A Thread For Tutorial On Python Programming by scarplanet(m): 6:42pm On Apr 28, 2020
LordAA:
Dear all,

Please anyone good with python for biologist /bioinformatics?
Thanks


Hello... What do you wish to get done?

1 Like

Programming / Re: A Thread For Tutorial On Python Programming by scarplanet(m): 6:41pm On Apr 28, 2020
Tobiee:


Hello, can I send a PM too? I just started learning python 3.
yeah you can
Programming / Re: Can Someone Help Me With A Solution To This Python Problem by scarplanet(m): 12:04pm On Apr 28, 2020
silento:


U seems to know too much about python , instead of correcting someone you are mocking them , don't forget python is not the only programming language someone that has good background from c or c++ will always write his code like that ,


I am sure farmsata understands we are just trying to get under each other's skin; I don't see how I am making fun of him.
If trying to point out something means I am mocking the person, then I'll hold my peace moving forward.

And No, I dont know all of python. No one is a bundle of knowledge.

Cheers
Programming / Re: Can Someone Help Me With A Solution To This Python Problem by scarplanet(m): 7:32am On Apr 28, 2020
farmsata:
num1 = eval(input("Enter number one " ))

num2 = eval(input("Enter number two " ))

largenum = 0

if num1 > num2:

largenum = num1

elif num1 < num2:

largenum = num2

print(str(largenum) + " is the large number"wink

else:

print("The numbers are equal"wink


1. Line 3 is not necessary. Memory space is being wasted initializing largenum = 0.

2. Your code will yield no result If num1 is larger. tongue tongue

1 Like

Programming / Re: Can Someone Help Me With A Solution To This Python Problem by scarplanet(m): 7:22am On Apr 28, 2020
silento:


It is never wrong to use int with input , it depends on the problem at hand


Like I said, you can never tell the behavior and intent of the users of your code. What if someone someday decides to compare floating numbers?

It's best to use the correct syntax, eval()
Programming / Re: Can Someone Help Me With A Solution To This Python Problem by scarplanet(m): 12:00am On Apr 28, 2020
farmsata:
num1 = eval(input("Enter number one "wink)
num2 = eval(input("Enter number two "wink)
largenum = 0
if num1 >= num2:
largenum = num1
else:
largenum = num2
print(str(largenum) + " is the large number"wink


if num1 == num2, then num1 cannot be the larger number??
Programming / Re: Can Someone Help Me With A Solution To This Python Problem by scarplanet(m): 10:28pm On Apr 27, 2020
jjmk:
I need to know more about input(). I don't seem to understand it clearly.

There are two numbers one higher than the other. Let's say 40 and 20 respectively.

Num1 = int(input("Enter the first number: "wink)
Num2 = int(input("Enter the second number: "wink)

# take the larger number

If num1 > num2:
Larger_num = num1
Else:
Larger_num = num2

# Print the result
Print("The larger number is:" Larger_num)

Pls guys help...I am stuck here.


First, your code is 95% correct. However Like you have been already told, variable names are case sensitive. You started with Num1 and Num2; then i switched to num1 and num2. Red flag!

Secondly, python builtin functions always start in lower case... have that imprinted at the back of your mind. Therefore "if" and "else" should start in lower case, "print" also.

Third, I have seen a lot of young programmers use int() with the input() function. That is TOTALLY WRONG. Let me tell you why. If in this your code you are to find the larger number between 20.2 and 20.3. When you use int() with input(), then both values will be rounded to the nearest integer and 20 will be returned. You see, the goal is defeated. I have also seen some people say you can use float() with input() if you want to enter a floating number. However, remember that you don't write a code for your own use, it is for others to use and maybe reproduce. So in a case where u have used float() and a user of your code enters 20 in the input, it is automatically converted into 20.0 float value. This alone is enough to distort the final result. Note that in programming, 20 and 20.0 are not thesame!
So then, what should you use? Well not many person might know, but whenever you want to return a non-string value with the input() function, the best function to use is eval(). To be used as eval(input("say something" )).

Cheers

3 Likes

Programming / Re: Python 3: Exercises And Solutions. by scarplanet(m): 12:29pm On Apr 27, 2020
jayphe:

Collinsanele Taofeekdboy kensmoney Daddyshome Zabiboy

hmm....who else ooo? Let's get to business. Pls, let's try to read the question in details first. If the question asks for the users' input, then we should include an input statement. Zabiboy we need to talk ooo. This one wey I no see you....


Exercise 4
We are doing some 'loop and looping stuffs' today.


Write a Python program that accepts the name of a student, matric number, course code and the score he/she got in the course. E.g
Name: John Alfred
Matric. No.: MUC/CS/014/0882
Course Code: CMP 212
Score: 100

The program then print the result as:
John Alfred, MUC/CS/014/0882, CMP 212, Grade A


Using this grading table.
100-95 A
94-85 B
84-70 C
69-60 D
59-50 E
49-0 F

Corrections, advices, suggestions and opinions are highly welcome!


Unfortunately, Nairaland would not allow indentation

class Student:

def __init__(self, firstname, lastname, matric, course):
self.firstname = firstname
self.lastname = lastname
self.matric = matric
self.course = course

def grade(self, score):
if score >= 95:
return "A"
elif score >= 85:
return "B"
elif score >= 70:
return "C"
elif score >= 60:
return " D "
elif score >= 50:
return "E"
else:
return "F"

def fullname(self):
return "{} {}".format(self.firstname, self.lastname)

first = input("Enter Firstname of Student: " )
last = input("Enter Lastname of Student: " )
matricNo = input("Enter Matriculation Number of Student: " )
coursecode = input("Enter the Course Code: " )
studentscore = eval(input("Enter the Score for Student: " ))
stud1 = Student(first, last, matricNo, coursecode)

print("{}, {}, {}, Grade {}".format(stud1.fullname(), stud1.matric, stud1.course, stud1.grade(studentscore)))

1 Like

Programming / Re: Python 3: Exercises And Solutions. by scarplanet(m): 10:10pm On Apr 26, 2020
jayphe:


Exercise 1


Write a python program that obtains the domain name (thapar.edu) from the URL

http://www.thapar.edu/index.php/about-us/mission

site = "http://www.thapar.edu/index.php/about-us/mission"
a, b = site.split(sep="//" )
c = b.split(sep="/ " )[0]
d, e, f = c.split(sep="." )
print("{}.{}".format(e, f))

1 Like

Programming / Re: Common good python programming practices you should know by scarplanet(m): 9:11pm On Apr 25, 2020
Well done chief

1 Like

Programming / Re: Let's Learn Python Together by scarplanet(m): 11:02am On Apr 24, 2020
http:??//short??url.??at/ktzN8
Programming / Re: Let's Learn Python Together by scarplanet(m): 3:22pm On Apr 21, 2020

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 31 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. 39
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.