Challenge: Snake and Sum
Tarea
Swipe to start coding
Implement the function that can take optional arguments and keyword arguments. This function should return the snake string and summary of integer values.
- Define the 
snake_and_sum()function that should take many arguments and keyword arguments. - Create a loop for iteration on optional arguments:
- if the argument is a string, append this value to the 
snakelist. - if the argument is an integer, add this argument to the 
summaryvariable. 
 - if the argument is a string, append this value to the 
 - Create a loop for iteration on keyword arguments:
- all keywords are string, append it to the 
snakelist. - if the value is an integer, add this value to the 
summaryvariable. 
 - all keywords are string, append it to the 
 - The 
snake_and_sum()function returns a tuple with two values (string and integer). Unpack these values to the variablesstringandresult. 
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 6
single
Pregunte a AI
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla
Suggested prompts:
Resumir este capítulo
Explicar el código en file
Explicar por qué file no resuelve la tarea
Awesome!
Completion rate improved to 4.35
Challenge: Snake and Sum
Desliza para mostrar el menú
Tarea
Swipe to start coding
Implement the function that can take optional arguments and keyword arguments. This function should return the snake string and summary of integer values.
- Define the 
snake_and_sum()function that should take many arguments and keyword arguments. - Create a loop for iteration on optional arguments:
- if the argument is a string, append this value to the 
snakelist. - if the argument is an integer, add this argument to the 
summaryvariable. 
 - if the argument is a string, append this value to the 
 - Create a loop for iteration on keyword arguments:
- all keywords are string, append it to the 
snakelist. - if the value is an integer, add this value to the 
summaryvariable. 
 - all keywords are string, append it to the 
 - The 
snake_and_sum()function returns a tuple with two values (string and integer). Unpack these values to the variablesstringandresult. 
Solución
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 6
single