Deck of cards - Python
1. Shuffle the deck of cards after the instructions and description are output to the user HINT: Research importing and utilizing modules (Links to an external site.) in your code, specifically examining the random (Links to an external site.) module
2. Output a welcome message describing the application for the user and any/all instructions
3. Output a description of the deck of cards (e.g., this deck contains X number of cards and Y number of suits); do this programmatically and professionally.
4. Ask the user for the number of cards to be dealt to them from the deck
5. Check to ensure they've given you a valid number that can be dealt (if you want, you can limit it to a set of numbers -- but be sure to tell the user in the instructions if this is the case)
6. If the number is valid, store their request in a variable and name the variable appropriately
7. Output a few blank lines using the special code to insert a new line
8. Output the results from the user's request, displaying each card number and suit in a list-like fashion.
9. Ask them if they want to be dealt another hand or if they would like to quit
10. Upon quitting, thank them for playing in a professional manner
Criteria for :
• • Programmatically check to ensure they've given you a valid number of cards to be dealt
• • Output all instructions and appropriate information at the appropriate time
• • Import and utilize the random module
• • Utilize the list and/or tuple sequence type to store your deck of card information
• • Utilize the for control flow statement to iterate through your list and/or tuple
• • Utilize the try:except for error control and to exit the program gracefully
• • Utilize at least one user-defined function (you can use one you've already written if it fits!)
Get Free Quote!
278 Experts Online