๐Ÿ PyQuest๐Ÿญ Function Factory ยท ๐Ÿงช More Than One Ingredient
โญ 0 XP๐Ÿ Python is waking upโ€ฆ

More Than One Ingredient ๐Ÿงช

Functions can take as many parameters as you want โ€” just separate them with commas:

def order(drink, size):
    print(f"One {size} {drink}, coming right up!")

order("hot chocolate", "large")   # โžœ One large hot chocolate, coming right up!

Order matters! The first thing you pass lands in the first parameter, the second in the second. Swap them and you get:

order("large", "hot chocolate")   # โžœ One hot chocolate large, coming right up! ๐Ÿคจ

Same function, silly result. Python does exactly what you say, not what you meant. ๐Ÿ˜„

Your mission

Open a potion shop!

  1. Build a function make_potion with two parameters: def make_potion(color, power):
  2. Inside, print one sentence that uses both of them (f-string!)
  3. Call it 3 times with 3 different color-and-power combos

Your code

Press โ–ถ Run to see what your code does!