Seun's Posts
Nairaland Forum › Seun's Profile › Seun's Posts
1 2 3 4 5 6 7 8 ... 546 547 548 549 550 551 552 553 554 (of 1138 pages)
List elements can be used with great success in certain unconventional places: site menus, for example. But for basic layout, I'll have to recommend that the DIV element, because that's precisely what it's for. |
I see your point, but I learnt BASIC very early and that didn't stop me from learning C and C++ later. If you start with Python and you need something Python doesn't offer, you can just get Visual Studio (C#). |
Python is definitely the easiest programming language that's popular. |
What do you call the killings in Jos Kano and in the Niger Delta on a regular basis?What we're experiencing today is nothing compared to a war. They are incomparable. |
Yet another language? No thanks. I've not got around to learning Javascript and Actionscript yet. |
Python is a dynamic language and it offers features that are common to most dynamic languages.You make a good point. The flexibility of Python is probably one of the reasons I am hardly tempted to create classes and such. I can create ad-hoc tuples, lists and dictionaries to hold my data instead of defining classes. I can return multiple values from a function instead of having to create a new class to contain them. But this is still in line with my first comment on this topic: "I recommend procedural programming and python". But: OOP is all about defining classes , inheriting behaviour from other classes etc. If you have a lang that provides you a "Psuedo" way to acheiving this, then thats fine but to practice true OOP these concepts have to be strictly followed in some sense.This is what I'm unhappy about. Why do we assume OOP must be "strictly followed"? Is it a religion? If OOP isn't boosting your productivity in a particular project, why should it not be swept aside? Another typical advantage of object Oriented Programming is CODE REUSE ABILITY.Code reusability is good, but it predates OOP. Even a prehistoric language like C supports code reuse - hello, standard libraries! In Python you can organize procedural code into modules, and import them elsewhere. I can't remember re-writing the code that will login a user whenever i am writing a system that requires authentication in any project.Really? Even if the database schema changes completely? Even if columns are renamed and added? Nah. All I'm saying is that classes and objects are just another programming construct. Like variables. And operators. You don't see anyone talking about operator oriented programming do you? And classes are not needed in every situation: - A maths library doesn't have to contain a "sine" object, a "cosine" object, or even a "MathsWizard" object with a sin method. It can just contain the mathematical functions you need. - A user authentication library doesn't have to contain a User object. All it needs are three functions: "register", "login", and "verifycookie". OOP doesn't really fit database programming, because it's redundant (and wrong) to define the same business entities in two different places. - A program to print the numbers one to ten does not need a "NumberPrinter" class. Thanks. |
All these small African countries. One day they are models, the next day they are fighting civil wars. |
Use http://wap2.nairaland.com/ if you really want to enjoy nairaland on your iphone. |
Yes, it's odd. Smart person. ![]() |
Is that the government's job? Investing in video games? |
Well. . . . .hard luckMy point is, if both the naira and the dollar are going down, then there's no point converting one to the other. Hence no capital flight. Unless US-based investors are selling off their investments and going back home. |
Do you think it's wiser to trust in the Naira than the dollar?If the US economy is on the verge of collapsing, then I would trust neither since the naira depends on our petrodollars. I would definitely not convert my naira into dollars. |
Because the crisis has gone global, many people in a global crisis rush to the developed markets, of which the US is the most prominent. Witness the strenghtening of the dollar.But that is very stupid of them. I don't think people with access to lots of capital can be that stupid. My guess is that governors have started looting again, and converting the looted billions into dollars. |
How can the US financial crisis lead to an increase in demand for the dollar? I am confused. |
Nigerian girls for you. They want to risk the benefits of crime without facing any risks. |
Missy B:Look, let's face it, nobody steals to please another person. When a thief is caught, he begins to look for excuses. "I did it for you" is one of the more retarded excuses. Stealing is not a form of "sacrifice". It's just stealing. |
I was just trying to help you man. |
Java is wordy. Perl is difficult to understand. Python is expressive and straightforward. |
I think Anette was definitely the best singer. |
@niyyie: Relax, the problem is under control. The moderator is dong his job. |
Thanks a million for your suggestion. I appreciate it very much. |
Currently, the Programmer section has more spam than the Webmaster section. How about that? ![]() |
Ok, I'll try it as soon as I can. |
You wrote: averagelength=round(float(sum([len(word) for word in sentence.split()]))/ len(words)) That's not Python. That's Perl in Python. Real Python is both clear and concise. ![]() PS: I don't think it works. |
Python is object orientedNo. There's a difference between using objects and being object oriented. Python uses objects. My problem is with a style of programming that languages like Java encourage. Where you cannot write a basic program without defining a class and inheriting something. I hate libraries that require inheritance. I believe in code modularity, but I only define new classes when I absolutely have to. In languages like Python, you tend to use lists, dictionaries, tuples, and modules where you would have had to define new classes in languages like Java. So, yes, I use classes. I use objects. Inheritance. But only when the problem actually requires them. When you develop large applications and the likes that businesses today demand,You don't need OOP for complex business applications. You need a well designed database. ![]() |
I'm pretty sure the word count example can be simplified in the same way. Python is not Java. ![]() |
You wrote: def AverageWord (sentence): words=sentence.split() len_words=len(words) if len_words==1:print 'You Just Entered a Word' else: total=0 for i in range(0,len_words): total +=len(words[i]) print total average=total/float(len_words) print 'The Averge Word length in The Sentence is',average That is Java Programming in Python. This is Python: def AverageWord (sentence): words = sentence.split() wordlengths = [len(word) for word in words] averagelength = sum(wordlengths) / len(words) print "Average Length:", averagelength |
It will be difficult for a Nigerian game to surpass the foreign games that Nigerians are pirating everyday, unless the Nigerian game includes elements that are distinctly Nigerian and gives people a stronger incentive to pay for it. |
Look, all politicians are the same. The game is not a clean game, because we (the followers) are so gullible. |
It's a lovely court case. I hope she wins. |
Why not just introduce this courses in the Police academy? Universities have nothing to do with police training. |
I think what we need to do is separate this thread into two sections: Python Programming and Python Language Tutorial func = lambda n:n*func(n-1) if n else 1 Can anyone interpret the above function? Another Tutorial: http://personalpages.tds.net/~kent37/stories/00020.html#e20can-be-learned-in-a-few-days |
1 2 3 4 5 6 7 8 ... 546 547 548 549 550 551 552 553 554 (of 1138 pages)
