Status: Not Started
  • scratchpad.py
  • Unit Test
Font Size
14
Parentheses autocomplete
Wrap lines
Editor
Theme
Code with blocks by default
Console Font Size
12
Console Theme
Display Server Graphics Screen
Show File Tab Bar
Debug Mode
Calculator
Unit Test
def perform_operations(operations, values):
return
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output
Grading
Docs
Exercise
More
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Pass Test Message

Errors:

This student is viewing this assignment in English. View this page in English?

5 points

You will be provided with two lists: one list of strings and one list of integer tuples. Each string in the first list represents an operation (“Add”, “Subtract”, “Multiply”, or “Divide”), and each tuple in the second list contains two integers.

Return a list where each index contains the result of applying the corresponding operation to the integers in the tuple at the same index.

The two input lists will be the same size.

Example:
If the input is:

operations = ["Add", "Subtract", "Multiply", "Divide"]
numbers = [(3, 5), (10, 4), (2, 7), (8, 2)]

The expected output would be:

[8, 6, 14, 4.0]
Reset Code

Slides and Notes

No slides available for this video

About

Python 3 Practice
3.11.9 (default, Apr 6 2024, 17:59:24)
[GCC 6.4.0]