Computer Science, asked by divyashreer, 4 days ago

Write a program that simulates a card game. The user inputs a card number from 1 to 13 repeatedly. If the input card number is 13 or negative, the user does not get another card and the program displays a message such as ‘Terminating execution’. For all other valid cards, the card number can be displayed back.

Answers

Answered by jaig80
5

Answer:

card = (int(input("enter card from 1-13:", )

if card > 13 or < 0:

           print

else:

   print ("Terminating Execution")

Answered by surajnegi0600
2

Answer:

while True:

   card_number = int(input("Enter a card number from 1 to 13 (or -1 to quit): "))

   if card_number == 13 or card_number < 0:

       print("Terminating execution.")

       break

   else:

       print("You have drawn card number:", card_number)

Explanation:

This program uses a while loop to repeatedly prompt the user to enter a card number. Inside the loop, the program checks the value of the card number. If it is 13 or negative, the loop is broken and the program displays a message "Terminating execution.". If the card number is a valid input (1 to 12) the program will display the input number.

More question and answers:

https://brainly.in/question/54812489

https://brainly.in/question/49639138

#SPJ3

Similar questions