118 Posted Topics

Member Avatar for mitsuevo

A truly empty value is None. [CODE]mylist = [None] * 5[/CODE] Creates a list with five empty elements.

Member Avatar for mitsuevo
0
10K
Member Avatar for EAnder
Member Avatar for lrh9
0
157
Member Avatar for nevets04
Member Avatar for nevets04
-2
312
Member Avatar for AutoPython

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.

Member Avatar for AutoPython
0
216
Member Avatar for lrh9

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 …

Member Avatar for paddy3118
0
362
Member Avatar for lrh9

I want to call another object's methods from another object, and I have no idea how. Can someone please help me? Thank you.

Member Avatar for lrh9
0
203
Member Avatar for tlj333

I don't know. I'd probably just check that the user's input was in a tuple containing the appropriate input values.

Member Avatar for tlj333
0
194
Member Avatar for MkeVaughanG

Here are some RSS related Python libraries that might help you. [url]http://wiki.python.org/moin/RssLibraries[/url]

Member Avatar for lrh9
0
41
Member Avatar for lrh9

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 …

Member Avatar for Gribouillis
0
97
Member Avatar for saikeraku

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 …

Member Avatar for marecute
-1
110
Member Avatar for lrh9

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 …

Member Avatar for lrh9
0
379
Member Avatar for masterofpuppets

You can use str.count(sub, [, start [, end]]) to count the instances of a substring in a string.

Member Avatar for lrh9
1
765
Member Avatar for Gribouillis
Member Avatar for jsw24
Member Avatar for masterofpuppets
0
15K
Member Avatar for lewashby

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 …

Member Avatar for willygstyle
0
304
Member Avatar for jmark13

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.

Member Avatar for lukerobi
0
193
Member Avatar for lrh9

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 …

Member Avatar for lukerobi
0
253
Member Avatar for lewashby

To answer the coding problem, I think that the word "init" has to be wrapped in double underscores.

Member Avatar for lllllIllIlllI
0
121

The End.