mayatatum98681 mayatatum98681
  • 06-09-2022
  • Computers and Technology
contestada

Write code that sets the value of the variable num_cards to seven if its current value is less than seven. otherwise, don't change the value. assume that num_cards already has an initial value.

Respuesta :

topeadeniran2 topeadeniran2
  • 14-09-2022

The program to illustrate the information is given below.

How to express the code?

num_cards = 5 #Assuming value of num_cards is 5 (You can take any value you want)

if num_cards<7 :

num_cards=7

print(num_cards)

def dice_eval(x,y):

if (x+y== 7)|(x+y== 11) :

return "Winner!"

elif (x+y== 2)|(x+y== 3)|(x+y== 12) :

else:

a = x+y

if a<10:

return "Point is 0"+ str(a)

else :

return "Point is " + str(a)

Example -

dice_eval(0,8) returns 'Point is 08'

Learn more about programs on:

https://brainly.com/question/26642771

#SPJ1

Answer Link

Otras preguntas

Is 15.07 a rational or irrational numbers
The rate for one unit of a given quantity is called....
How did Henry Hudson die on the Hudson River
Evolution is change in a population over time and includes the gene pools of that population. How does biogeographic isolation allow for the change of gene pool
Explain how mumps vaccine makes someone immune to mumps
37 pumpkins each weighs 48 ounces Distributed into 3 baskets The weight of basket A is 3 times the weight of basket C Basket B is twice the weight of basket C B
a car wash charges a flat rate for the first 8 minutes of washing time and also charges a certain amount for each additional minute of washing time. Gina took 1
what is a method of planting crops that disturbed the soil and its plant cover as little as possible called?
How did Henry Hudson die on the Hudson River
name an unusual fruit that is not common