Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Assignment Mix-Up | Variable and Assignment Mistakes
Common Python Mistakes and How to Fix Them

bookChallenge: Assignment Mix-Up

In this challenge, you will apply your understanding of variable naming, assignment, and scope to identify and fix multiple errors in a Python script. The code provided below contains several mistakes that prevent it from running as intended. Your task is to carefully review the script, correct all variable-related issues, and ensure the output matches the intended result.

Завдання

Swipe to start coding

You are given a Python script that is supposed to calculate the area of a rectangle and print a summary message. However, the script contains several mistakes related to variable naming, assignment, and scope. Your goal is to fix all the issues so that the script works as intended and prints the correct message.

  • Correct all variable naming errors.
  • Fix assignment mistakes so that variables hold the intended values.
  • Ensure variables are properly scoped and accessible where needed.
  • The final output should be: Rectangle: width=5, height=10, area=50.

Рішення

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

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

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

Секція 2. Розділ 5
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Can you show me the Python script that needs fixing?

What is the intended output of the script?

Can you explain more about the errors you want me to look for?

close

Awesome!

Completion rate improved to 5.26

bookChallenge: Assignment Mix-Up

Свайпніть щоб показати меню

In this challenge, you will apply your understanding of variable naming, assignment, and scope to identify and fix multiple errors in a Python script. The code provided below contains several mistakes that prevent it from running as intended. Your task is to carefully review the script, correct all variable-related issues, and ensure the output matches the intended result.

Завдання

Swipe to start coding

You are given a Python script that is supposed to calculate the area of a rectangle and print a summary message. However, the script contains several mistakes related to variable naming, assignment, and scope. Your goal is to fix all the issues so that the script works as intended and prints the correct message.

  • Correct all variable naming errors.
  • Fix assignment mistakes so that variables hold the intended values.
  • Ensure variables are properly scoped and accessible where needed.
  • The final output should be: Rectangle: width=5, height=10, area=50.

Рішення

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

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

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

Секція 2. Розділ 5
single

single

some-alt