+ 1
s = input() def hashtagGen(text): s1 = s.replace(" " , "") return "#"+s1 print(hashtagGen(s))
Please I am stuck with this error
8 Answers
+ 2
Raj Jaiswal185
Remove your return statement and rewrite it. I think it having some invalid characters..
edit:
if not work or further...
This may help you, to share links 👇
https://www.sololearn.com/post/75089/?ref=app
+ 3
s = input()
def fn(txt):
s1 = txt.replace(" ", "")
return '#' + s1
print(fn(s))
see s1 = txt.replace... not s.replace
(parameter there, you pass the s argument to it later on when you print call)
Buut for some reason, it didn't work at first when I changed your func this way. I got a new tab and did this and it worked. I don't know why.
+ 2
Jayakrishna🇮🇳
Thank you so much is worked 👍✨😍
+ 1
Ok. But as already said, share code link by saving it. Identation is very important in python, that's you can't find it by above copy paste code if any..
Also share full task description.. Hashtag generator is not enough.. Python has 5+ courses.. If I am not sovled it , then I can't open it.
+ 1
You're welcome..
0
Save code and share link here along with clear details of your task description, doubts, error details, difficulty.. Etc,..
Code is truncated...
Don't add code in question place..
0
I want to make a hastag generator for the lesson end project and I have also tried the solution given there but it is not working
0
We are creating our own social network application and need to have a hashtag generator program.
Complete the program to output the input text starting with the hashtag (#).
Also, if the user entered several words, the program should delete the spaces between them.
Sample Input
code sleep eat repeat
Sample Output
#codesleepeatrepeat
Hint
You can use the replace() function to replace the spaces (" ") with empty strings (""). See how it works:
I don't know how to share the link of code but the course is python core lesson 34