Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~7K People Reached
About Me

Python noob and xbox fanatic

Favorite Tags

19 Posted Topics

Member Avatar for Ghostenshell

Keep getting Attribute Errors with my code any suggestions? There are two files attatched [code] from string12 import * from root import * def main(): tree1 = raw_input("enter numbers: ") print buildParseTree(tree1) def buildParseTree(fpexp): fplist = fpexp.split() pStack = Stack() eTree = BinaryTree('') pStack.push(eTree) currentTree = eTree for i in …

Member Avatar for Gribouillis
0
119
Member Avatar for Ghostenshell

Help with passing the arguments. This program is supposed to ask for how many numbers do you want. I would stick with ten. Then how many numbers in a randrange (upper limit) Please choose 100 After a list is generated it is supposed to sort the numbers and look for …

Member Avatar for Gribouillis
0
97
Member Avatar for Ghostenshell

Can someone help me with my queue? I think the stack works fine. I just need the indexing of the queue or do I need to index the queue? [CODE]from string12 import * from queue import * def main(): stack1 = Stack() queue = Queue() word = raw_input("Enter a word …

Member Avatar for Ghostenshell
0
2K
Member Avatar for Ghostenshell

Trying to put the 4 queue.enqueue into a while loop. Any suggestions? Files are attached. [CODE]from string13 import * from queue import * stack1 = Stack() queue = Queue() pallist =[] pallist2 =[] def main(): stack1.push(4) stack1.push('2') stack1.push(1) stack1.push(5) while not stack1.isEmpty(): pallist.append(stack1.pop()) print pallist """while queue.size < len(pallist):""" queue.enqueue(pallist[3]) …

Member Avatar for Gribouillis
0
102
Member Avatar for Ghostenshell

Trying to call the gcd from the constructor but I keep getting either a global error or gcd is not defined error. Any suggestions? The program is supposed to reduce fractions immediately. So I got rid of the add. [CODE]class Fraction: def __init__(self,m,n): self.num = m self.den = n gcd() …

Member Avatar for -ordi-
0
106
Member Avatar for Ghostenshell

Trying to find an easier way to write my code. I am using the graphics.py module. I will add the graphics program as an attachment for anyone who does not have it or doesn't know what I am talking about. The first program I made is archery. Just simple circles …

Member Avatar for TrustyTony
0
2K
Member Avatar for Ghostenshell

How would I pass something from a driver into a list inside a class. I then need remove a word from the list and replace it with a new word.

Member Avatar for griswolf
0
156
Member Avatar for Ghostenshell

Really stuck on this and its supposed to be easy. I'm supposed to input 2 positive nonzero integers into x and y. Then return the value of x times y. The book has an example of 7 * 4 = 4 + 4 + 4 + 4 + 4 + …

Member Avatar for TrustyTony
0
143
Member Avatar for Ghostenshell

I need to check for floating point numbers inside my class but it doesn't seem to be working. Any suggestions? [CODE] class Rectangle: def __init__(self, length = 1, width = 1): self.__length = length self.__width = width ##Setters to float def set_length(self, length): self.__length = float(length) try: #self.__length = float(length) …

Member Avatar for Ghostenshell
0
217
Member Avatar for Ghostenshell

I read a lot of car classes on several sites and still can't get mine to work. Any ideas? [CODE]##Car class class Car: def __init__(self, y_model, make, speed): self.y_model = y_model self.make = make self.speed = speed def set_year_model(self, y_model): self.y_model = y_model def set_make(self, make): self.make = make def …

Member Avatar for Ghostenshell
0
105
Member Avatar for Ghostenshell

Could someone show me how to add line numbers to a sorted list? If you need the code it is under the last thread I started. I started using document.write() but every time I did this the page would erase.

0
73
Member Avatar for Ghostenshell

New to JavaScripting and copying information out of a book. I understand the concept of the code but I do not know why it is not working. I can type info in both boxes but the information does not add. Tried it in three browser FF, IE, and Chrome. [CODE]<html> …

Member Avatar for Ghostenshell
0
114
Member Avatar for Ghostenshell

Having trouble with the final loop in this craps program. Any suggestions. Problem starts on line 28. Was thinking about breaking the whole thing into functions but I don't exactly know where to call them at. When I do call them I get accessed before argument errors or something to …

Member Avatar for oldSoftDev
0
127
Member Avatar for Ghostenshell

First I like to thank everyone that helped me with my work... Please bear with me I don't know how to explain my problem. Trying to get the random number to remain the same through out the length of the program. When the player guess the right number the player …

Member Avatar for Ghostenshell
0
142
Member Avatar for Ghostenshell

Can someone explain how to add a file to a dictionary. The file is simple. Maybe a word or a number on each line. Here is the code I have. Didn't know if i should use this post or the List and Dictionaries post so kind of posted twice... sorry …

Member Avatar for woooee
0
154
Member Avatar for wotthe2000

Can someone explain how to add a file to a dictionary. The file is simple. Maybe a word or a number on each line. Here is the code I have. Didn't know if I should use this post or start a new one. Just in case I will start a …

Member Avatar for Ghostenshell
0
152
Member Avatar for Ghostenshell

Can anyone simplify this for me? I don't know if it is going to work I tried to adjust the code to fit on the page. Might have to delete the extra [ICODE]+\[/ICODE] [CODE=python]def main(): try: infile = open('text.txt','r') files = infile.readlines() lower,count,blank,dig = 0,0,0,0 #Counting uppercase for line in …

Member Avatar for Stefano Mtangoo
0
971
Member Avatar for Ghostenshell

I think I have several questions before I post my code. [LIST=1] [*]How do I change the attributes? Everything looks the same and I was basically looking at one of the examples in my book for this problem. The book always has the arguments and attributes as being the same …

Member Avatar for Stefano Mtangoo
0
134
Member Avatar for Ghostenshell

First time I've asked for help so please bear with me... ***Brain Freeze*** OK Supposed to open a txt file. Assuming the txt file is formated properly. The file is a what I am assuming a list of names and ages. I created my own file... kick me 989 bodybody …

Member Avatar for Murtan
0
105

The End.