[Solved]Input err! | SoloLearn: Learn to code for FREE!

-1

[Solved]Input err!

Adding c. Adding h. Adding e. Adding e. Adding s. Adding e. Finished making your pizza! Expected Output Adding cheese. Finished making your pizza! https://code.sololearn.com/cd4zLbTwGAKO/?ref=app

10/23/2019 9:44:50 AM

Subham

33 Answers

New Answer

+7

Your question is unclear ?

+3

Subham, have you taken a look at how input on Sololearn works? (It is a bit strange.) If not, watch this: https://code.sololearn.com/WhiNb9BkJUVC/?ref=app

+3

Subham, that are just regular for loops. How about you calmly read all the recommendations now (everything you need has been said! ) and invest a bit of work to figure this out?

+2

Subham I do honestly suggest you go back to your first code, and try to fix it with only code that you understand. so if you do not know what elif means and does, don’t use it (just an example of course) that or scrap the code and start fresh preferably tomorrow :) this will give you a new look at the things and helps you refresh you can also go through the first code choe sent (solve) and go through every line. then look every statement/function/variable/object/etc you don’t understand. read about and code with it until you get it. then continue to the next line and do the same thing. understanding truly is key

+2

gheghe Subham you are most probably not going to get an answer from downvoters :) when you downvote something you don’t get any updates from that post (thank whatever deity!). plus you basically ordering them to tell will probably not prompt them to do so, even if the were listening in. It sure as “underworld of choosing” would not prompt me to answer you, quite the opposite. but I think the reason it has been downvoted is because you didn’t really put a lot of thought in your question. - the topic wasn’t correct (it wasn’t an input err) - then you posted some output from your code, which we can run ourselves thank you, so it seemed as if your code was working - you didn’t state any problems and, maybe worst of all in a q and a :) - you didn’t ask any question please don’t take this ‘lecture’ as criticism, but rather as feedback from which to learn. also, when people take time, effort, and energy out of their busy lives to help you out, it is generally a good idea to thank people for their help :)

+2

I want to add that for a while it looked like you weren't even trying to understand the answers - you just kept asking and asking. That probably didn't help either.

+1

it works for me :)

+1

yes but split() is a function performed on the string. it looks at your string and instead of taking every single character it watches out for (white)spaces and bundles everything not separated by spaces as 1 entity. now you for loop works because before it would just take every single character and use that in the iteration.

+1

so it did work before, just not as you wanted it to :) a big difference :) so to elaborate: blah = input() for i in blah: do something something to every i in blah (every i is every letter in a normal input string) bluh = input().split() for i in bluh: do something for every i in bluh (every i is every set of characters separated by whitespaces in the input string, this works this way because of split() )

+1

“multiline” without enter it does work. just not enter. for that you would need to use several inputs for example a = input() b = input()

+1

Subham, what is missing? I think, Brave Tea laid it all out clearly.

+1

Brave Tea explained that as well.

+1

Solved!!! 😁 https://code.sololearn.com/cdhp4KJHHHIs/?ref=app

0

I am trying to create list using user input What is the Error in logic? Works for no input but Testing with input as cheese creates unwanted Output!

0

requested_toppings = input().split() seperate every topping by a whitespace when given the prompt example: cheese mushroom

0

Solved but why? What did split do here & why it didn't work without split? Isn't input taking things as strings Split also does the same job!

0

It only works for one input, doesn't take multiple line input altho works if given using space!

0

HonFu ! Any ideas

0

requested_toppings = [] for _ in range(int(input("specify # of toppings"))): requested_toppings.append(input())

0

Can we make it multiline input!