Some time ago you were asked to write a program that returns a string if there is the @ character before it. However, your code raises an error even though it is obvious that the strings match the pattern. Can you correct the code and solve this issue?
Preconditions and postconditions
What's the problem?
Report a typo
Sample Input 1:
@Jane123Sample Output 1:
Jane123Write a program in Python 3
import re
string = input()
pattern = "(?<=@)\w+"
results = re.match(pattern, string)
print(results.group())
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.