+ 3
Help me in python
I need to enter a text string separated by spaces and each space must have a value in another string, for example. A = "One" B = "Two" C = "Three" D = "Four" Input Format: A B C D Output Format: One Two Three Four Input Format: A A Output Format: One One I am importing re module in python #I receive the text string text = input () if re.search (text, "A"): Â Â Â Â print ("One") but it is very long and in the end I can't get the expected result. Please if you give me an idea or what module to use.
5 Answers
+ 3
Josshual A. Toro M. here is a simple method based on your instructions.
https://code.sololearn.com/crEneKsVYSBQ/?ref=app
+ 13
Here's a simple solution
https://code.sololearn.com/c3VJ3mSp9fLh
+ 5
It is quite simple bro just make a dictionary, take input then split it create a range of list then acces the value using dictionary print it and use end="" statement to print in same line .
d = {' ':'', 'A':'one','B':'two','C':'three'}
a=" A B C "
b=a.split()
for i in b:
k=d[i]
print(k,end=" ")
See the above e example
+ 1
Thanks all, i Clear my question.
+ 1
there is a challenge here called no numerals and the approach is similar to what you need, here is my solution to see if it helps you
https://code.sololearn.com/cc4lZ7WC7mOj/?ref=app