Contenido del Curso
Introduction to Python Video Course
Introduction to Python Video Course
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
- Count the number of times
"apples"
appears on the shelf and print the result. - Find the index of the first occurrence of
"bananas"
on the shelf and print it. - 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.
- If
"grapes"
appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes. - 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
andnot in
operators with both tuples and lists.
Tarea
- Count the number of times
"apples"
appears on the shelf and print the result. - Find the index of the first occurrence of
"bananas"
on the shelf and print it. - 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.
- If
"grapes"
appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes. - 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
andnot in
operators with both tuples and lists.
¿Todo estuvo claro?
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
- Count the number of times
"apples"
appears on the shelf and print the result. - Find the index of the first occurrence of
"bananas"
on the shelf and print it. - 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.
- If
"grapes"
appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes. - 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
andnot in
operators with both tuples and lists.
Tarea
- Count the number of times
"apples"
appears on the shelf and print the result. - Find the index of the first occurrence of
"bananas"
on the shelf and print it. - 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.
- If
"grapes"
appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes. - 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
andnot in
operators with both tuples and lists.
¿Todo estuvo claro?
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
- Count the number of times
"apples"
appears on the shelf and print the result. - Find the index of the first occurrence of
"bananas"
on the shelf and print it. - 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.
- If
"grapes"
appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes. - 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
andnot in
operators with both tuples and lists.
Tarea
- Count the number of times
"apples"
appears on the shelf and print the result. - Find the index of the first occurrence of
"bananas"
on the shelf and print it. - 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.
- If
"grapes"
appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes. - 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
andnot in
operators with both tuples and lists.
¿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
- Count the number of times
"apples"
appears on the shelf and print the result. - Find the index of the first occurrence of
"bananas"
on the shelf and print it. - 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.
- If
"grapes"
appear only once on the shelf, print a message that grapes need to be restocked. Otherwise, no action is needed for grapes. - 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
andnot in
operators with both tuples and lists.