Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Inventory Sorting Capstone | Section
Python Fundamentals for Data Science
Seção 1. Capítulo 10
single

single

bookChallenge: Inventory Sorting Capstone

Deslize para mostrar o menu

Tarefa

Deslize para começar a programar

Manage a grocery store inventory by extracting item names and categories using string slicing, assigning prices, and printing formatted statements.

  1. Slice the items string to extract:
  • "Bubblegum"candy1.
  • "Chocolate"candy2.
  • "Pasta"dry_goods.
  1. Slice the categories string to extract:
  • "Candy Aisle"category1.
  • "Pasta Aisle"category2.
  1. Create price variables:
  • bubblegum_price = "$1.50".
  • chocolate_price = "$2.00".
  • pasta_price = "$5.40".
  1. Use print() to display item names, prices, and categories.

Output Requirements

Print the following:

  • We have <candy1> for <bubblegum_price> in the <category1>.
  • We have <candy2> for <chocolate_price> in the <category1>.
  • We have <dry_goods> for <pasta_price> in the <category2>.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 10
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

some-alt