Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Create a More Complex Function | What is a Function?
Python Functions: From Zero to Hero
course content

Зміст курсу

Python Functions: From Zero to Hero

Python Functions: From Zero to Hero

1. What is a Function?
2. Arguments or Parameters
3. Assigning a Default Value to a Parameter
4. An Unknown Number of Arguments
5. Functions within Functions
6. Recursion

Challenge: Create a More Complex Function

Python 3.6 has a way to format strings that allows you to use built-in expressions inside string constants. This approach is called f-strings. Let's look at the examples.

12
string = 'world' print(f'Hello, {string}')
copy

Let's look at the syntax. All text you want to print must be enclosed in quotation marks preceded by an f, and any variables you want to print within that text must be enclosed in curly braces. You will also need to use f-strings in the task.

Завдання

Let's complicate the task. You have to create a function named function(), and create a variable inside a function as capital, assign a value like London; use f-strings and print() function to display the following text: London is the capital and largest city of England and the United Kingdom

Завдання

Let's complicate the task. You have to create a function named function(), and create a variable inside a function as capital, assign a value like London; use f-strings and print() function to display the following text: London is the capital and largest city of England and the United Kingdom

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 2
toggle bottom row

Challenge: Create a More Complex Function

Python 3.6 has a way to format strings that allows you to use built-in expressions inside string constants. This approach is called f-strings. Let's look at the examples.

12
string = 'world' print(f'Hello, {string}')
copy

Let's look at the syntax. All text you want to print must be enclosed in quotation marks preceded by an f, and any variables you want to print within that text must be enclosed in curly braces. You will also need to use f-strings in the task.

Завдання

Let's complicate the task. You have to create a function named function(), and create a variable inside a function as capital, assign a value like London; use f-strings and print() function to display the following text: London is the capital and largest city of England and the United Kingdom

Завдання

Let's complicate the task. You have to create a function named function(), and create a variable inside a function as capital, assign a value like London; use f-strings and print() function to display the following text: London is the capital and largest city of England and the United Kingdom

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 2
toggle bottom row

Challenge: Create a More Complex Function

Python 3.6 has a way to format strings that allows you to use built-in expressions inside string constants. This approach is called f-strings. Let's look at the examples.

12
string = 'world' print(f'Hello, {string}')
copy

Let's look at the syntax. All text you want to print must be enclosed in quotation marks preceded by an f, and any variables you want to print within that text must be enclosed in curly braces. You will also need to use f-strings in the task.

Завдання

Let's complicate the task. You have to create a function named function(), and create a variable inside a function as capital, assign a value like London; use f-strings and print() function to display the following text: London is the capital and largest city of England and the United Kingdom

Завдання

Let's complicate the task. You have to create a function named function(), and create a variable inside a function as capital, assign a value like London; use f-strings and print() function to display the following text: London is the capital and largest city of England and the United Kingdom

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Python 3.6 has a way to format strings that allows you to use built-in expressions inside string constants. This approach is called f-strings. Let's look at the examples.

12
string = 'world' print(f'Hello, {string}')
copy

Let's look at the syntax. All text you want to print must be enclosed in quotation marks preceded by an f, and any variables you want to print within that text must be enclosed in curly braces. You will also need to use f-strings in the task.

Завдання

Let's complicate the task. You have to create a function named function(), and create a variable inside a function as capital, assign a value like London; use f-strings and print() function to display the following text: London is the capital and largest city of England and the United Kingdom

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 2
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt