BuildlyBuildly
DashboardExercisesProfileHelp
Back to all

Practice: Functions

Drills tagged with this skill, unpassed first. Pass them all to mark the skill ready for scenarios.

Module 1: Python Programming

0/3 done
Exercises (0/3)
  • 1
    Customizable Greeting
    Write greet(name, greeting="Hello") that returns "{greeting}, {name}!". The second parameter has a default value.
    5 min· 10 XP
  • 2
    Clamp a Value
    Write clamp(value, low, high) that returns value if it's between low and high (inclusive), low if it's below, high if it's above.
    5 min· 10 XP
  • 3
    Discounted Price With Tax
    Write discounted_price(price, discount_percent=10, tax_percent=5) that applies the discount first, then adds tax on the discounted amount. Both percentages have defaults.
    5 min· 10 XP