Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge | Other Data Types
Introduction to Python Video Course
course content

Contenido del Curso

Introduction to Python Video Course

Introduction to Python Video Course

1. Getting Started
2. Variables and Types
3. Conditional Statements
4. Other Data Types
5. Loops
6. Functions

Challenge

Your grocery store's system is designed to track the inventory of items on different shelves using tuples, as tuples provide a way to ensure the data is immutable once set.

However, the store needs to monitor certain items and track their quantities or positions to assist in restocking or rearranging.

You are tasked with analyzing and managing inventory data using tuples to determine certain metrics and take actions based on specific criteria.

Tarea

  1. Count the number of times "apples" appears on the shelf and print the result.
  2. Find the index of the first occurrence of "bananas" on the shelf and print it.
  3. If the number of apples is less than 5, print a message indicating that apples need to be restocked. If there are enough apples, print a message saying no restocking is needed.
  4. If "grapes" appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes.
  5. Find out if "oranges" exist on the shelf. If they do, print their index. If they don't, print that oranges are out of stock.

Note

You can also use the in and not in operators with both tuples and lists.

Tarea

  1. Count the number of times "apples" appears on the shelf and print the result.
  2. Find the index of the first occurrence of "bananas" on the shelf and print it.
  3. If the number of apples is less than 5, print a message indicating that apples need to be restocked. If there are enough apples, print a message saying no restocking is needed.
  4. If "grapes" appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes.
  5. Find out if "oranges" exist on the shelf. If they do, print their index. If they don't, print that oranges are out of stock.

Note

You can also use the in and not in operators with both tuples and lists.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 4. Capítulo 6
toggle bottom row

Challenge

Your grocery store's system is designed to track the inventory of items on different shelves using tuples, as tuples provide a way to ensure the data is immutable once set.

However, the store needs to monitor certain items and track their quantities or positions to assist in restocking or rearranging.

You are tasked with analyzing and managing inventory data using tuples to determine certain metrics and take actions based on specific criteria.

Tarea

  1. Count the number of times "apples" appears on the shelf and print the result.
  2. Find the index of the first occurrence of "bananas" on the shelf and print it.
  3. If the number of apples is less than 5, print a message indicating that apples need to be restocked. If there are enough apples, print a message saying no restocking is needed.
  4. If "grapes" appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes.
  5. Find out if "oranges" exist on the shelf. If they do, print their index. If they don't, print that oranges are out of stock.

Note

You can also use the in and not in operators with both tuples and lists.

Tarea

  1. Count the number of times "apples" appears on the shelf and print the result.
  2. Find the index of the first occurrence of "bananas" on the shelf and print it.
  3. If the number of apples is less than 5, print a message indicating that apples need to be restocked. If there are enough apples, print a message saying no restocking is needed.
  4. If "grapes" appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes.
  5. Find out if "oranges" exist on the shelf. If they do, print their index. If they don't, print that oranges are out of stock.

Note

You can also use the in and not in operators with both tuples and lists.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 4. Capítulo 6
toggle bottom row

Challenge

Your grocery store's system is designed to track the inventory of items on different shelves using tuples, as tuples provide a way to ensure the data is immutable once set.

However, the store needs to monitor certain items and track their quantities or positions to assist in restocking or rearranging.

You are tasked with analyzing and managing inventory data using tuples to determine certain metrics and take actions based on specific criteria.

Tarea

  1. Count the number of times "apples" appears on the shelf and print the result.
  2. Find the index of the first occurrence of "bananas" on the shelf and print it.
  3. If the number of apples is less than 5, print a message indicating that apples need to be restocked. If there are enough apples, print a message saying no restocking is needed.
  4. If "grapes" appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes.
  5. Find out if "oranges" exist on the shelf. If they do, print their index. If they don't, print that oranges are out of stock.

Note

You can also use the in and not in operators with both tuples and lists.

Tarea

  1. Count the number of times "apples" appears on the shelf and print the result.
  2. Find the index of the first occurrence of "bananas" on the shelf and print it.
  3. If the number of apples is less than 5, print a message indicating that apples need to be restocked. If there are enough apples, print a message saying no restocking is needed.
  4. If "grapes" appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes.
  5. Find out if "oranges" exist on the shelf. If they do, print their index. If they don't, print that oranges are out of stock.

Note

You can also use the in and not in operators with both tuples and lists.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Your grocery store's system is designed to track the inventory of items on different shelves using tuples, as tuples provide a way to ensure the data is immutable once set.

However, the store needs to monitor certain items and track their quantities or positions to assist in restocking or rearranging.

You are tasked with analyzing and managing inventory data using tuples to determine certain metrics and take actions based on specific criteria.

Tarea

  1. Count the number of times "apples" appears on the shelf and print the result.
  2. Find the index of the first occurrence of "bananas" on the shelf and print it.
  3. If the number of apples is less than 5, print a message indicating that apples need to be restocked. If there are enough apples, print a message saying no restocking is needed.
  4. If "grapes" appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes.
  5. Find out if "oranges" exist on the shelf. If they do, print their index. If they don't, print that oranges are out of stock.

Note

You can also use the in and not in operators with both tuples and lists.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 4. Capítulo 6
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt