Hello to everyone. How can I get the output {} if an empty string is entered | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Hello to everyone. How can I get the output {} if an empty string is entered

Description in code. Please help.My brain is already burning.I did part of the task, but this part cannot be mastered in any way https://code.sololearn.com/c1M89nO9p3kO/?ref=app

13th Jul 2020, 6:51 AM
ŠœŠøхŠ°ŠøŠ»
7 Respostas
+ 3
remove comma first and split.. words = input().replace(',',"").split()
13th Jul 2020, 7:31 AM
Jayakrishna šŸ‡®šŸ‡³
+ 4
ŠœŠøхŠ°ŠøŠ» Don't think like that. It happens when you learn.
13th Jul 2020, 7:56 AM
AĶ¢J
AĶ¢J - avatar
+ 3
ŠœŠøхŠ°ŠøŠ» You can also do like this if you forgot to use replace. words = input() if words != '': words = words.split(', ')
13th Jul 2020, 7:46 AM
AĶ¢J
AĶ¢J - avatar
+ 2
ŠœŠøхŠ°ŠøŠ» in programming, you have to experience all things like this to get better programmer. (No need ashamed, Ofcouse in any matter, unless if it is intential mistake).. You're welcome...
13th Jul 2020, 7:48 AM
Jayakrishna šŸ‡®šŸ‡³
+ 2
JayakrishnašŸ‡®šŸ‡³ ,AJ Anant Thanks for the kind words
13th Jul 2020, 7:59 AM
ŠœŠøхŠ°ŠøŠ»
0
JayakrishnašŸ‡®šŸ‡³ thanks. How could I forget about replace. I am ashamed
13th Jul 2020, 7:40 AM
ŠœŠøхŠ°ŠøŠ»
0
AJ Anant I feel dumb myself
13th Jul 2020, 7:49 AM
ŠœŠøхŠ°ŠøŠ»