✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
What is the cyclomatic complexity of the following code?
def calculate_discount(price, is_member, season): discount = 0 if price > 100: if is_member: if season == ‘summer’: discount = 0.2 else: discount = 0.1 else: if season == ‘winter: discount = 0.15 else: discount = 0.05 return price * (1 – discount)
Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!