Write a python program to automatically extract the following grade scores from the…
- User
Write a python program to automatically extract the following grade scores from the given text. Text: “Johnny got 85 in Maths and 63 in English”
Assistant
Problem: Write a python program to automatically extract the following grade scores from the given text. Text: “Johnny got 85 in Maths and 63 in English”
Approach: Regular Expressions
Let me implement this solution.
The most robust and standard way to solve this in Python is by using Regular Expressions (the module). This allows you to find specific patterns (like sequences of digits) within a string, regardless of where they are located.