Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,513 members, 7,958,556 topics. Date: Wednesday, 25 September 2024 at 05:06 PM |
Nairaland Forum / Science/Technology / Programming / The Myth Of Saturation With Regards To Web Development. (19149 Views)
Introduction To Web 3.0 / How to add images to web pages with coding / How to code buttons to web pages (2) (3) (4)
(1) (2) (3) ... (7) (8) (9) (10) (11) (Reply) (Go Down)
Re: The Myth Of Saturation With Regards To Web Development. by airsaylongcome: 2:41pm On Nov 20, 2021 |
Gbsks: I know. But I was talking about the code itself. There are some bits of the code that dlas it is that don't need to be there? |
Re: The Myth Of Saturation With Regards To Web Development. by Gbsks: 3:03pm On Nov 20, 2021 |
airsaylongcome:Oh, I've seen it. The parentheses around the comparison of values was unnecessary, assigning the value to another variable "Largest" was unnecessary, the = operator was also unnecessary, the code get kleg sef, he should have considered the probability that the values could be equal since he decided to use the = operator along with the > operator. |
Re: The Myth Of Saturation With Regards To Web Development. by airsaylongcome: 6:55pm On Nov 20, 2021 |
Gbsks: Good points. I'm also thinking was there any need to do the elif num2>=num1? |
Re: The Myth Of Saturation With Regards To Web Development. by Gbsks: 8:27pm On Nov 20, 2021 |
airsaylongcome:I don't think so too. There are many flaws in the code. |
Re: The Myth Of Saturation With Regards To Web Development. by islamics(m): 10:12pm On Nov 21, 2021 |
airsaylongcome: How about after getting the three numbers, then we say: int largest = number1 If number2 > largest largest = number2 If number3 > largest largest = number3 In this case, I think the number of comparison is reduced. airsaylongcome: Based on the person code logic, I think it was needed. |
Re: The Myth Of Saturation With Regards To Web Development. by GeneralDae: 10:23pm On Nov 21, 2021 |
airsaylongcome:I don't see anything wrong with the code though. It looks perfect and Pythonic enough ( the one way of doing it) to me. I may be wrong though. |
Re: The Myth Of Saturation With Regards To Web Development. by airsaylongcome: 10:30pm On Nov 21, 2021 |
islamics: So yes I think the number of comparisons should reduce. After the initial check of num1>=num2 I don't think there should have been a check for that again in the elif. I'm rusty in my programming so I don't have a ready solution for that. But I believe after the first check there was no need to check it again because we would already know if num1 was greater or not after that check |
Re: The Myth Of Saturation With Regards To Web Development. by islamics(m): 9:49am On Nov 22, 2021 |
airsaylongcome:After checking num1>=num2, there is a need to compare using num2 in case num2 will be the largest in the elif. The approach is the basic logic. If you consider the first number as largest and then compare with others, your number of comparison will always be n-1 which is small improvement But I believe after the first check there was no need to check it again because we would already know if num1 was greater or not after that checkWe would know but we wouldn't know for certain if num2 or num3 is greater. You can open your terminal, run different variation of the code and see the results. |
Re: The Myth Of Saturation With Regards To Web Development. by GeneralDae: 11:17am On Nov 22, 2021 |
airsaylongcome:There's a need to also check if num 2>=num1, because that's a possibility. num 1 could be >= num 2, but it could also happen that num 2 is rather >= num 1. You definitely have to account for all possibilities. |
Re: The Myth Of Saturation With Regards To Web Development. by airsaylongcome: 1:55pm On Nov 22, 2021 |
GeneralDae: So let's look at it If (num1>=num2)... If the condition evaluates to true do we need to check num2>=num1? If it evaluates to false do we need to check num2>=num1? |
Re: The Myth Of Saturation With Regards To Web Development. by GeneralDae: 5:56pm On Nov 22, 2021 |
airsaylongcome:I get your point now. However, the way the code was written by giving condition to num 1 with respect to num 2 and num 3, if we fail to also give similar conditions to num 2 and num 3 ( being explicit enough), we may not get the desired outcome. Thinking about it now, I think a better way would be to make a list of num1, num 2, and num 3, and then find the maximum. I'll try that to see if that is possible. |
Re: The Myth Of Saturation With Regards To Web Development. by GeneralDae: 6:21pm On Nov 22, 2021 |
airsaylongcome:This should be the optimal code: num1=float (input ('Enter first number:') num2=float (input ('Enter second number:') num3=float (input('Enter third number:') a=[num1, num2, num3] print (max(a)) Answer Enter first number: 4 Enter second number: 5 Enter third number: 2 5.0 |
Re: The Myth Of Saturation With Regards To Web Development. by islamics(m): 6:51am On Nov 23, 2021 |
airsaylongcome:Nope. I think I get your logic now. |
Re: The Myth Of Saturation With Regards To Web Development. by airsaylongcome: 3:07pm On Nov 23, 2021 |
islamics: I'm from the If..then...else languages. So in rough pseudocode If (num1>=2) then { If (num1>=num3) then max==num1 } else if (num2>=num3) then max==num2 else max==num3 This may not be optimal for edge cases where all three inputs are equal |
Re: The Myth Of Saturation With Regards To Web Development. by airsaylongcome: 3:09pm On Nov 23, 2021 |
GeneralDae: This is also correct. But I wasn't talking about using arrays and inbuilt max function. Just pure conditionals. Nice solution all the same 1 Like |
Re: The Myth Of Saturation With Regards To Web Development. by shezpwiti(f): 7:41pm On Nov 23, 2021 |
Please is 31 years old too late to learn how to be a web developer? |
Re: The Myth Of Saturation With Regards To Web Development. by GeneralDae: 10:19pm On Nov 23, 2021 |
shezpwiti:I don't know where people get the notion that old people don't code or one can be too old to code. Is this perception from Hollywood that shows us young nerds and geeks hacking away at a very young age? If you want to start something, start. You don't need our validation to make you decide if you're too old or not. So if we say yes you are too old to code, what then? Does it mean you'll then abandon your desire to learn web development? If you do that, one can assume you were only looking for an excuse not to begin your web development journey in the first place. 2 Likes |
Re: The Myth Of Saturation With Regards To Web Development. by Pa5sa38: 10:14pm On Nov 24, 2021 |
Please I have basic knowledge of html and css what should I learn to become a web developer |
Re: The Myth Of Saturation With Regards To Web Development. by airsaylongcome: 4:21pm On Nov 26, 2021 |
shezpwiti: Absolutely NOT! If you gender here on NL (female) then I would advise that you look into UI/UX design or Product Dev. I find that (and this is my personal opinion) Women have a brain that can handle aesthetics very well |
Re: The Myth Of Saturation With Regards To Web Development. by shezpwiti(f): 4:25pm On Nov 26, 2021 |
I'm actually female. Thanks for the recommendation airsaylongcome: |
Re: The Myth Of Saturation With Regards To Web Development. by oluwaniyi66(m): 5:30pm On Feb 28, 2022 |
tensazangetsu20: Good day sir, please I want to talk to you tensazangetsu20 |
Re: The Myth Of Saturation With Regards To Web Development. by specialofficer: 3:54am On Mar 03, 2022 |
tensazangetsu20:Good day sir, I'm a commercial student that just got admission into the university, I was in 300l in uni but left uni 3 years ago to go do something that would help myself but it backfired, now I'm starting afresh... I'll be 24 this year, I'm good in maths, my sister was telling me to go into tech, I don't know if it's possible for someone studying economics to go into tech, mind you I just gained admission, I've not even resumed, what advice will you give me sir? Is it advisable to go into tech? You know as a student you'll need small small money to take care of your needs and age is no longer on my side 1 Like |
Re: The Myth Of Saturation With Regards To Web Development. by Kenny242(m): 2:19pm On Mar 03, 2022 |
tensazangetsu20:It’s not crap though |
Re: The Myth Of Saturation With Regards To Web Development. by BeLookingIDIOT(m): 9:08pm On May 01, 2023 |
tensazangetsu20:Abeg how far your friend ? Did he later get the data science job? I'm yet undecided wether to learn web development or data science. |
Re: The Myth Of Saturation With Regards To Web Development. by tensazangetsu20(m): 9:31pm On May 01, 2023 |
BeLookingIDIOT: Na he never did. Went into cyber security |
Re: The Myth Of Saturation With Regards To Web Development. by BeLookingIDIOT(m): 9:34pm On May 01, 2023 |
tensazangetsu20:Wow. Isn't the job prospect for cyber security even worse than data science |
Re: The Myth Of Saturation With Regards To Web Development. by tensazangetsu20(m): 9:35pm On May 01, 2023 |
BeLookingIDIOT: He was lucky to get a good cyber security job with a Nigerian bank. They are training him and paying for every certification exam. |
Re: The Myth Of Saturation With Regards To Web Development. by Nobody: 6:50am On May 02, 2023 |
BeLookingIDIOT: data science for sure. |
Re: The Myth Of Saturation With Regards To Web Development. by BeLookingIDIOT(m): 6:09pm On May 04, 2023 |
Failure2019:I personally prefer data science,but I'm hearing no jobs just like his friend. |
Re: The Myth Of Saturation With Regards To Web Development. by KillingJoke: 5:00pm On Dec 30, 2023 |
Jeez Too many man children on this thread |
Re: The Myth Of Saturation With Regards To Web Development. by PeterZoom: 12:43pm On May 30 |
Ok. |
(1) (2) (3) ... (7) (8) (9) (10) (11) (Reply)
Web Based Software Vs Standalone Solution / Simple Code Challenge: C#, Java, C, C++ / Nigerian Ethical Hackers In Here --->
(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. 54 |