Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Виклик: Написання Першої Function | Функції
Вступ до Python

book
Виклик: Написання Першої Function

Завдання

Swipe to start coding

Час написати вашу першу функцію.

  • Напишіть функцію під назвою greeting, яка прийматиме параметр name.
  • Функція повинна виводити привітання у форматі: "Hello, {name}!"

Рішення

# Write your code here
def greeting(name):
return f"Hello, {name}!"

# Testing the function with the example name
print(greeting('Albert'))
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 6. Розділ 4
# Write your code here
___ greeting(___):
___

# Testing the function with the example name
greeting('Albert')
toggle bottom row
some-alt