how to create a code in pyton to ask the user to enter the number of switches and calculate the possible outcomes that can come from those many numbers of switches(on/off). Please help me with this​

Respuesta :

amount = int(input("How many switches? "))

if amount == 0:

   print("There are no outcomes for 0 switches")

else:

   print("With {} switch(es), there are {} outcomes.".format(amount, 2**amount))

Ver imagen Cytokine
ACCESS MORE
ACCESS MORE
ACCESS MORE
ACCESS MORE