First, I would like to say that I'm happy to be apart of the community
. I'm University student, that have recently been having trouble with my program for my assignment. I have spent hours on this without much success. The program is suppose to include two functions, one the defines a function that creates a deck, and another that defines a function that shuffles the deck of cards. I am not allowed to use the built in python function to shuffle the deck of cards. My code is below:
My createDeck function works find, but can't seem to pass the deck through my shuffleDeck() to get it to shuffle.

import random import math def createDeck(): spades = ["2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s", "Ts", "Js", "Qs", "Ks", "As"] clubs = ["2c", "3c", "4c", "5c", "6c", "7c", "8c", "9c", "Tc", "Jc", "Qc", "Kc", "Ac"] diamonds = ["2d", "3d", "4d", "5d", "6d", "7d", "8d", "9d", "Td", "Jd", "Qd", "Kd", "Ad"] hearts = ["2h", "3h", "4h", "5h", "6h", "7h", "8h", "9h", "Th", "Jh", "Qh", "Kh", "Ah"] deck = spades + clubs + diamonds + hearts print(deck) return deck def shuffleDeck(deck): amnt_to_shuffle = len(deck) while amnt_to_shuffle > 1: i = int(math.floor(random() * amnt_to_shuffle)) amnt_to_shuffle -= 1 deck[i], deck[amnt_to_shuffle] = deck[amnt_to_shuffle], deck[i] def main(): shuffleDeck(createDeck()) return print(shuffleDeck(createDeck()))
My createDeck function works find, but can't seem to pass the deck through my shuffleDeck() to get it to shuffle.