Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
~15.6K People Reached

10 Posted Topics

Member Avatar for ywang

[CODE] n = 1 for i in (range(1,10)): print ("%d*8+%d=%d" % (n, i, (n * 8 + i))) n = n * 10 + i + 1 [/CODE] does the n = 1 have to stay outside the for loop?

Member Avatar for vegaseat
0
1K
Member Avatar for bpatt22

[CODE] class Player(object): def __init__(self): self.points = 0 def add_points(): plyr1.points += 1 plyr2.points += 1 plyr3.points += 1 if __name__ == '__main__': (plyr1, plyr2, plyr3 = (Player(), Player(), Player()) add_points()[/CODE] How could the 3 lines in add_points() be written better/shorter?

Member Avatar for Gribouillis
0
177
Member Avatar for RICH148

Looks to me like [CODE]card.suit[/CODE] is giving you that error b/c there hasn't been a Card class object created, no? You created a Poker object in [CODE]game = Poker(numhands)[/CODE], but i don't see where a Card object occurs. Could need some thing like [CODE]cards = Card()[/CODE] under main(). Do the …

Member Avatar for bpatt22
0
259
Member Avatar for bpatt22

What are some alternatives to writing [CODE]len(mylist3 & mylist4)[/CODE] within this code? [CODE] mylist1 = [1,2,3] mylist2 = [4,5,6] mylist3 = set(mylist1) mylist4 = set(mylist2) lenresult = len(mylist3 & mylist4) [/CODE] A module i'm importing is unable to use the count() that gets called with the ' & ' operator.

Member Avatar for bpatt22
0
112
Member Avatar for ke24126

Have you first created the 5-card hand? What do you ultimately want the hand sorted by? Rank, suit or poker hand? ex. a 5 card hand that contains a pair sorted by rank could look like this: 2s, 3d, 6h, 6c, Ad or sorted by what the poker hand is …

Member Avatar for bpatt22
0
5K
Member Avatar for bpatt22

If you start an open source project, say on code.google.com to develop a game, how is revenue from that game distributed? Assuming you or the contributers have found a way to monetize it.

0
67
Member Avatar for aot
Member Avatar for bpatt22

If I want to find the X coordinate of an image that's already on a canvas, how would I do that with tkinter?

Member Avatar for bpatt22
0
557
Member Avatar for bpatt22

How would you modify this gui code to designate only certain spots on your canvas to drop your image? Like when your playing solitaire and the game only allows you to drop your card in a certain spot. [URL="http://www.daniweb.com/forums/post1111987.html#post1111987"]http://www.daniweb.com/forums/post1111987.html#post1111987[/URL]

Member Avatar for bpatt22
0
662
Member Avatar for bpatt22

What approach should I use to return all dict keys that have the maximum value. The code below outputs 1, but I would like for it to return 1, 2. [CODE]import operator d1 = dict() d1[0] = 1 d1[1] = 2 d1[2] = 2 maxValue = max(d1.iteritems(), key=operator.itemgetter(1))[0] [/CODE]

Member Avatar for TrustyTony
0
8K

The End.