33 AnswersNew Answer
Your question is unclear ?
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
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?
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
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 :)
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.
it works for me :)
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.
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() )
“multiline” without enter it does work. just not enter. for that you would need to use several inputs for example a = input() b = input()
Subham, what is missing? I think, Brave Tea laid it all out clearly.
Brave Tea explained that as well.
Solved!!! 😁 https://code.sololearn.com/cdhp4KJHHHIs/?ref=app
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!
requested_toppings = input().split() seperate every topping by a whitespace when given the prompt example: cheese mushroom
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!
It only works for one input, doesn't take multiple line input altho works if given using space!
HonFu ! Any ideas
requested_toppings =  for _ in range(int(input("specify # of toppings"))): requested_toppings.append(input())
Can we make it multiline input!