Python Forum
card dealer school project
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
card dealer school project
#3
okey but the problem is that i cant get it go give diffrent cards(random) to the players. it gives out the same 5 cards for the chooosen players. I want it to give 5 random cards to the players. "card dealer"

rank = ""
 
suit = ""
import random
r = random.randint(1,13)
s = random.randint(1,4)
 
 
 
if s == 1:
    suit = "spades"
elif s == 2:
    suit = "heart"
elif s == 3:
    suit = "diamond"
elif s == 4:
    suit = "clubs"
 
if r == 11:
    rank = "jack"
 
elif r == 12:
    rank = "queen"
 
elif r == 13:
    rank = "King"
 
elif r > 1 and r < 11:
    rank = r
i=int(input('how many players are gonna play poker?'))
def poker (i):
    if i>0:
        print('player', +i, 'gets the cards')
        print(suit, rank)
        print(suit, rank)
        print(suit, rank)
        print(suit, rank)
        print(suit, rank)
        i-=1
        r = random.randint(1,13)
        s = random.randint(1,4)
    print(poker(i))
 
 
 
 
print(poker(i))
Reply


Messages In This Thread
card dealer school project - by kalle1234 - Jan-05-2019, 05:52 PM
RE: card dealer school project - by Larz60+ - Jan-05-2019, 05:55 PM
RE: card dealer school project - by kalle1234 - Jan-05-2019, 06:38 PM
RE: card dealer school project - by ichabod801 - Jan-05-2019, 07:15 PM
RE: card dealer school project - by kalle1234 - Jan-05-2019, 07:40 PM
RE: card dealer school project - by ichabod801 - Jan-05-2019, 09:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  my python project for school vavervirus 2 678 Oct-12-2023, 03:28 AM
Last Post: buran
Shocked School project -- need help with it it says syntax error XPGKNIGHT 6 3,360 Aug-11-2022, 08:43 PM
Last Post: deanhystad
  School project janivar91 3 2,753 Jan-23-2021, 06:31 AM
Last Post: KonohaHokage
  Python School Project andreas30298 2 2,165 Nov-12-2020, 09:58 AM
Last Post: Axel_Erfurt
  I need help for a school project IndyNeerhoff 1 2,121 Sep-28-2019, 08:28 PM
Last Post: Gribouillis
  Turtle Graphics Card Values in a List Muzz 0 2,364 Apr-11-2019, 12:55 PM
Last Post: Muzz
  [Tkinter] Tkinter project school Kersow 2 2,506 Apr-08-2019, 08:45 PM
Last Post: Larz60+
  Playing Card Sorting ness828 4 83,834 Feb-05-2018, 09:01 PM
Last Post: sparkz_alot
  Small game (school project) Ganesh 7 5,690 Nov-08-2017, 09:04 PM
Last Post: Ganesh
  card 21 trick SummoningZ 21 15,982 Aug-24-2017, 12:42 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020