Let's calculate the expenses

Report a typo

You need to write a program that takes an input string that contains Alex's weekly expenses and returns how much he's spent this week. Pay attention to the input and output format in the example.

Sample Input 1:

2 meals $20, groceries $120, 1 month rent $500

Sample Output 1:

This week you have spent: 640 dollars
Write a program in Python 3
import re

string = input()
# your code here
___

Create a free account to access the full topic