a = []start = input("Hello, my name is Eliza. What would you like to talk about? ")while start != "Go away": if "feel" in start: start = input("""Do you often feel that way?""") else: start = input("""Please go on.""")

Um yeah.. my code is to have an input in a loop, and it ends when the user writes "Go away"..then if the line has the word feel, then yeah the response should be "Do you often feel that way?"

if "i am <something>" is in the input, then the program should respond" How long have you been <something>?."

Otherwise, if none of these rules apply, Eliza should just print Please go on.

i don't know how to print for example the word after i am???

Mekire: Merged a quintuple postalso:

If the input "<some words> me" appears in the line, the program should respond "<some words> ,no."

ALL THAT I DON't KNOW HOW TO DO IS TO PRINT <some words> or <something>

You really need to reconsider your tone. No one here is being paid to help you; we are all volunteers. Do not quintuple post. Do not even double post unless you have something really important to add. Ideally you would use the edit button but so far you have not engendered trust with that responsibility.

I am going to offer some ideas and then I am going to lock the thread for a few hours. When I unlock it, if you want more help, you need to post an updated attempt. It doesn't have to necessarily work, but it does need to show that you are trying to apply the ideas being suggested.

So... firstly let's talk about split. The method split takes a string and divides it into a list based on a separator (the separator defaults to a space if not given).

a = input("Python can get annoying sometimes huh? ")a.split() if "You Lost" in a: print(words.index('You' 'Lost')) # I cannot do this because you can't...but how can i find the position of these else: print("Thanks for the help.")

how can i find the position of these words in this input

and do you really have to lock the editing from my first posts???

i wouldn't get rid of it and you could just ban my ip and my account from the webpage if I did

the only one that I wanted to get rid of beofore was the STEMMING (but i don't care anymore)

i don't wanna do it this way...any ideas on how to print the word after "i am"???right now i have'nt written the full code ye,t I will do that later.....I wanna get the "i am" thing working

like to print the word after i am...i know it is not been converted to lower case i will do that after i figure this out... how can we find the index to the word after am...why is my code failing...doesn't it look like it should work

i wouldn't get rid of it and you could just ban my ip and my account from the webpage if I did

This is a decision from all of the mods/admin. It is forum etiquette to not post multiple times regarding the same situation and to be respectful to to each party. Mekire should not be having to merge multiple threads of yours because each thread you create is too similiar to the previous thread. If you cannot respect the rules, your privileges will be suspended until a time we see fit.

2) Your tone of your posts decides how many responses you get and the priviledges you maintain . You need to check out How to post good questions.

3) Stay calm. Slow down. Learning a new language takes time, even if you are already familiar with another language, let alone if not. Sometimes you just have to set something aside and say, that is too complex or complicated for me right now, its out of my field. Or sometimes you just need to take a break.

4) Your variable name choice is unacceptable. Names like:

gayAnnoyingI_HATEVery

Aside from the fact that we can see your stress in the variable names you chose, you need to make meaningful variable names. Names that describe what the content is in each one.

5) Everyone is here to help one another. Like Mekire said, no one is being paid to help you. We all do it because we love Python and programming in general.

6) The forum is to help everyone, not just you. That is the reason we do not delete posts. This is not reddit. We do not delete all the discussion and leave the answer post. This is a forum with discussion. People want to see not only the result but how it was obtained too. Each post provides information that supports the final result. When someone with the same problem google searches similar questions, they will come here, read the thread, and may help them also.

7) Your way, may not be the best way. You need to be open minded when programming. If the assistance is unfamilar, take what is unfamilar and make it known.

If all of the above was followed, i would be spending the time i have available on answering your questions instead of re-posting the forums rules and expectations.

You should familarize yourself in splicing, string methods, list methods. This is what you should do before attepting a project. Just play around with it in the interpreter with gibberish strings and lists. See what you can and cannot get away with. Google search unkown methods. Read the forum tutorials.

for the first one i would check if it starts with "i am" and if not, that there is a space before i am, " i am", which would cancal that out. And the second one i would put a space in the search "i am ", which would cancel that out.

However it looks like your copy and pasting each if statement with a small variance in the if statement, which is a sign of bad coding. Start putting the code into classes, or at least functions to avoid such behavior.

metulburr wrote:for the first one i would check if it starts with "i am" and if not, that there is a space before i am, " i am", which would cancal that out. And the second one i would put a space in the search "i am ", which would cancel that out.

However it looks like your copy and pasting each if statement with a small variance in the if statement, which is a sign of bad coding. Start putting the code into classes, or at least functions to avoid such behavior.

what does classes mean..And the second one i would put a space in the search "i am ", which would cancel that out.

if search in res_lower: if 'i' in res_split and 'am' in res_split: ind = res.find(search) + len(search) section = res[ind:] key = section.split()[0] print('How long have you been {}?'.format(key)) else: print(default()) else: print(default())

You can break this code if you do it right. But you can also fix it by adding more if conditions to counter the break. You can also check out the re module using regular expressions if you are going to delve deeper into it, to make it more precise. But i suggest you do not as, if you cannot do it with if statments and builtins, you shouldn't be doing it with regexp. You can also easily read if conditions whereas complex regular expressions look like greek

this is not going to ever execute as input_lower is already lower, so whats the point of checking it against something thats uppercase.

I actually understand that long line. But everything after the first "or" is not going to execute for the same reason, input_lower is already lowered. Regardless, a line should never be that long. Code needs to be readable. Even if you had to check that many conditions, which you dont, there are better ways of doing that than making a huge line of a condition. See lists and the "in" operator.

Better understanding of the Python language will suit you. Understand the basics first, which will allow you options into better ways to program.