Ask coding questions

← Back to all posts
what is wrong in code
rocky321 my replit for day4 for who is going to pay bill.what is wrong in my code that i have return


I don't see anything wrong with the code, you just need to have a comma and a space between the names.
Also, you don't need to get a random int and use that as the index for your list, you can just use random.choice(list) to get a random item from a list.
Shorten your code down to:



random.choice we can't use,see the result in replit,
on putting name in input cheak for len function it give 1 as ans but ir should be 3 if input name are 3


Ok, then just do this:



This is the error:

you need to make a space so it is a valid sentence!
You currently have Coder100will pay money
but it should be Coder100 will pay money

so the correct code is: