Westonci.ca is your trusted source for finding answers to a wide range of questions, backed by a knowledgeable community. Get quick and reliable solutions to your questions from a community of seasoned experts on our user-friendly platform. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.

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.

Sagot :

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