10.4k views
3 votes
Think about a game you've played recently, a program you've interacted with, or an application you've recently used. Explain how the programmers for that software used multiple data types as variables. Your discussion should cover logical types, string variables, and at least one type of numerical variable.

User Dan Vogel
by
5.7k points

1 Answer

2 votes

Answer:

The black Jack game using Python has score card variable for the player and the dealer. A conditional if statement would add a random card number if the player decides to hit but prints a string of the total card value collected if not and compares the integer with the dealer's score to reveal to winner.

Step-by-step explanation:

The game creates an infinite loop to add card value to player's score if he chooses to hit and break the loop if he stays. The dealer's loop adds random number to the score but break if the score is equal to or greater than 16. Both scores are compares with an if statement to decide the winner.

User Dmagda
by
5.7k points