+ 1
Python 35.2 hashtag generator
Getting a lot of python work in today! If someone could help me figure out where my code went wrong that would be great! The SoloLearn material is great but they don’t teach how to handle input in the lessons groups often, then tell us to do all input stuff with it in their challenge problems. Tough sometimes, like this! The input is a word or string and it removes spaces and prefixes with a hashtag. How can I fix my code to do that? https://code.sololearn.com/cPRDt8HQR46M/?ref=app
6 Antworten
+ 6
Steve Barone
Return text1
or do like this
s = input()
def hashtagGen(text):
#your code goes here
return ("#" + text.replace(" ", ""))
print(hashtagGen(s))
+ 3
Your function does not return text1, that's why there is no output.
+ 1
ah thanks Lisa, the simple mistakes always seem to get ya!
I Am AJ ! appreciate the input, i will try your method as well!
0
I do not understand the logic behind the answer to this question. I also think the question is extremely poorly worded relative to the content that proceeded it. The designers are making the assumption that the student is able to "try" every exercise and complete every practice. Not all of us can afford to pay-to-play.
0
s = input()
def hashtagGen(text):
#your code goes here
tws = text.replace(" ", "")
tws2 = "#" + tws
return tws2
print(hashtagGen(s))
Ask if u need help!