Useful Lists Functions task (python) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Useful Lists Functions task (python)

Hi! I am trying to solve the exercise in the Lists Useful Functions. But I get a test case 4 failed. And its hidden. Any ideas why? txt = input() #your code goes here if any([i == "#" for i in txt]): print (txt.replace("#", " "))

8th Sep 2021, 11:24 PM
Rami Muleys
5 Answers
+ 2
Hi Rami! That's because it prints nothing if there is no "#" in input variable. For that, you can add an else statement to print the input as output.
9th Sep 2021, 12:59 AM
Python Learner
Python Learner - avatar
+ 5
Rami Muleys , please mention the exact python tutorial name, as well as the lesson number. thanks!
8th Sep 2021, 11:34 PM
Lothar
Lothar - avatar
+ 4
a = txt.replace("#", " ") print(a)
8th Sep 2021, 11:59 PM
Abs Sh
Abs Sh - avatar
+ 2
its Python Core lesson 59.2. thanks
8th Sep 2021, 11:36 PM
Rami Muleys
+ 2
thank you guys
9th Sep 2021, 6:01 AM
Rami Muleys