print "Welcome to Bunt Ranking" print "" card_1234 = { 'names': 'Mike Trout', 'set': "Signature", 'count': 100, 'image': "1234.jpg", 'rarity': "Limited", 'score': 1200 } card_1235 = { 'names': 'Derek Jeter', 'set': "Signature", 'count': 100, 'image': "1235.jpg", 'rarity': "Limited", 'score': 1200 } card_1776 = { 'names': 'David Wright', 'set': "Stars & Stripes", 'count': 17, 'image': "1776.jpg", 'rarity': "Super Rare", 'score': 1200 } cards = [card_1234, card_1235, card_1776] """ assigning dictionaries for each card for n in range(len(cards)): cards[n] = { 'names': "xyz", 'set': "Signature", 'count': 100, 'image': "1235.jpg" } print cards[n] """ import random num_cards = range(len(cards)) card_index_1 = random.choice(num_cards) num_cards.remove(card_index_1) card_index_2 = random.choice(num_cards) card1 = cards[card_index_1] print cards[card_index_1]['names'] + " (" + str(cards[card_index_1]['count']) + ") " + cards[card_index_1]['set'] + " Series" print "or" print cards[card_index_2]['names'] + " (" + str(cards[card_index_2]['count']) + ") " + cards[card_index_2]['set'] + " Series" print "" answer = raw_input("Which Card Would You Rather Own? Card 1 or Card 2?") print "" print answer # if click 1: do calc one way cards[card_index_1]['score'] = new calc # elif click 2: do calc the other way, update cards[card_index_2]['score'] = new calc # on click outline card, show +- calc, +- rank and Overall rank
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question