118 Posted Topics
Re: A truly empty value is None. [CODE]mylist = [None] * 5[/CODE] Creates a list with five empty elements. | |
Re: [url]http://www.daniweb.com/forums/post1017422.html#post1017422[/url] | |
Re: Jesus Christ. Get some object oriented design and code in that program ASAP! | |
Re: It's more object oriented than most code posted here, but there are more ways to use object oriented design and code in this program. For instance, there could be a general class for a menu. | |
So I'm interested in learning about data validation. Especially in Python. Python all ready has several common idioms for data validation. There are several statements that evaluate data. For instance, isinstance(object, classinfo) will check that the given object is an instance of the class or type in classinfo. One idiom … | |
I want to call another object's methods from another object, and I have no idea how. Can someone please help me? Thank you. | |
Re: I don't know. I'd probably just check that the user's input was in a tuple containing the appropriate input values. | |
Re: Here are some RSS related Python libraries that might help you. [url]http://wiki.python.org/moin/RssLibraries[/url] | |
Is it a good idea to help people with object oriented software design and code? I'm asking this because most of the code here is written using the functional programming, and all could probably improve a little or a lot with object oriented design and coding. My first doubt about … | |
Re: I'm wondering [I]why[/I] is there a requirement that the code be written using a while loop? Is it a requirement as part of an assignment? Is it just to learn the while loop better? Is it a personal belief that the while loop is a better or the best method … | |
I always wondered how a programmer could efficiently generate a random number from a set* of numbers once and only once. I quickly realized the inefficient solution. Simply generate the number and if it equals one you have all ready generated then regenerate the number. Regenerating the number is a … | |
![]() | Re: You can use str.count(sub, [, start [, end]]) to count the instances of a substring in a string. |
Re: I wonder how list slicing or struct.unpack() would work. | |
Re: So what you basically want is to fill the list with a sequence of numbers? Why? ![]() | |
Re: Object oriented programming is designing and coding software based on objects. Classes are a conceptual abstraction (a way of representing a complex idea with a simpler idea) that have properties. Classes serve as blueprints for the creation of objects. Objects are the actual items in a program. A object's properties … | |
Re: Is anyone else besides me thinking Python sets might be a good tool to use to solve this? Edit: Actually this probably won't work. According to Python documentation on sets, sets are containers for unique objects. | |
Out of curiosity, how would you reverse a string's case in Python? Make uppercase characters lowercase and lowercase characters uppercase. Here's the function for the naive implementation. [CODE] #!/usr/bin/env python def flip_case(input_string): temp_list = list(input_string) for index, character in enumerate(temp_list): if character.islower(): temp_list[index] = character.upper() else: temp_list[index] = character.lower() output_string … | |
Re: To answer the coding problem, I think that the word "init" has to be wrapped in double underscores. |
The End.