side the appropriate
cells, but clearly the error means that what I'm trying to do is not what is
actually happening. My full code is below and I would greatly appreciate
any help you can provide.
Thanks,
Ben
_-
#Ben Ganzfried
#2/18/11
#Tic-Tac-Toe
class Player:
def
Hey,
I'm having a lot of confusion getting the unit test working for one of my
classes for the Roulette bot I'm working on and would greatly appreciate any
advice or help.
Here is the description of what I am trying to do:
http://homepage.mac.com/s_lott/books/oodesign/build-python/html/roulette/b
Hey guys,
Would it be feasible for a beginner to write a script that could connect
with:
https://chrome.google.com/extensions/detail/laankejkbhbdhmipfmgcngdelahlfoji
? More specifically, I am interested in writing a script such that the user
would have to enter a short password (say 6 random lett
Hey guys,
I'm trying to get a version of Roulette working and I had a quick question.
Here is my code:
class Outcome:
def __init__(self, name, odds):
self.name = name
self.odds = odds
def winAmount(self, amount):
return odds*amount
def __eq__(self, other):
* I meant that*: A method actually can be called from the command prompt,
but the syntax is quite different than that used to call a function from the
command prompt.
On Fri, Jan 14, 2011 at 2:37 PM, Ben Ganzfried wrote:
> I actually just figured it out (since the tutorial talks about
be called from the command prompt.
Although if this isn't quite right or there's more to it, I would still
definitely appreciate any advice you have.
Thanks again,
Ben
On Fri, Jan 14, 2011 at 1:53 PM, Ben Ganzfried wrote:
> Hey guys,
>
> I'm using a tutorial geared for
Hey guys,
I'm using a tutorial geared for a 2.x version of Python and I am currently
using Python 3.1-- so it is possible that my confusion has to do with
different notations between them. But in any case, here is what I have:
>>> type(Time)
>>> t1 = Time()
>>> type(t1)
where:
class Time:
When I call one of my functions from the shell (ie compare(10, 5)) it
produces the correct output. However, when I run the program after calling
the method later in the script, the result is bizarre. I'm curious why the
wrong result is printed. Here is an example:
def compare(x,y):
if x < y
Happy holidays everyone!
My current question relates to a broader python programming question I
have and so I thought it was worth posting here. I'm trying to read a
single MAGE-TAB file (http://www.mged.org/mage-tab/) and acquire
metadata.
I just downloaded WinRAR to open zip files, but when tr
Hey,
I keep getting the error above and unfortunately browsing through
google and finding similar responses has not been fruitful for me. My
code is below and I have marked off the location of the problem in my
code. I'm wondering the following:
1) Doesn't the read() file object method return t
I'm searching line by line for certain tags and then printing the tag
followed by the word immediately following the tag.
So for example, suppose I had the following line of text in a file:
"this is a key test123 noisenoise noise noise noise"
In this example, I would wan
I'm currently working through the Google Python tutorial exercises and
had questions about the following function:
def not_bad(s):
# +++your code here+++
# LAB(begin solution)
n = s.find('not')
b = s.find('bad')
if n != -1 and b != -1 and b > n:
s = s[:n] + 'good' + s[b+3:]
return
I'm trying to build a program that reads in a file and copies specific
sections to a new file. More specifically, every time the words
"summary on" are in the original file, I want to copy the following
text to the new file until I get to the words "summary off".
My questions are the following:
1
13 matches
Mail list logo