Python Challenge: Social Media Pro [Solved] | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Python Challenge: Social Media Pro [Solved]

In the Python Regular Expressions Special Sequences lesson thereā€™s a challenge called Social Media Pro. Using the pattern r"#\w+" only test 4 does not pass, but its details are hidden. Anyone have any idea what this test is looking for? EDIT: For anyone who searches this problem later, I figured out that Test 4 will pass if you allow for hyphens (- symbol) to be found in the pattern. Link to challenge (only works on mobile): https://sololearn.com/coach/274/?ref=app

18th Oct 2020, 9:33 AM
Brylram
Brylram - avatar
4 Respostas
+ 1
āœŒļø
22nd Oct 2020, 3:29 AM
É“ÉŖį“›ŹœŹį“€É“į“€É“į“…į“€
É“ÉŖį“›ŹœŹį“€É“į“€É“į“…į“€ - avatar
+ 1
import re text = input() #your code goes here #use re.findall() with r"#\w+" as the regex list = re.findall(r"#\w+", text) for i in list: print(i)
8th Feb 2022, 9:42 AM
Silvie SkalickĆ”
0
Looking for this solution as well
11th Jan 2022, 7:45 AM
AndrƩ Marion
AndrƩ Marion - avatar
0
Im on this one now and stuck, i cant figure out how to output the whole hashtag
13th Jan 2022, 3:22 PM
William Alley
William Alley - avatar