Ice cream combination code using math library

We have ā€˜Nā€™ flavors of toppings that can be added to a coffee. For example chocolate, hazelnut, vanilla, Irish and so on. 


Write a function that takes the number of available flavors as input and returns the total number of different ways we can have our coffee. Note that we can have coffee without any toppings or with different combination of toppings.


SOLUTION:


import math
def find_number_of_combination(number_of_flavours):
total_combination=0
#logic
total_combination=pow(2,number_of_flavours)
return total_combination
number_of_combination=find_number_of_combination(6)
print(number_of_combination)
view raw icream_combo.py hosted with ā¤ by GitHub

Post a Comment

0 Comments