Can post a code but afraid of plagiarism

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Jan 24 03:13:44 EST 2014


On Thu, 23 Jan 2014 19:15:51 -0800, indar kumar wrote:

> What if I want to search for a particular value inside the lists of all
> keys except one that user inputs and also want to print that value.

Then go right ahead and do so. You are learning Python, so this should be 
covered in your course. Did you follow the advice to work through the 
Python tutorial?

http://docs.python.org/2/tutorial/
http://docs.python.org/3/tutorial/

depending on whether you are using Python 2 or 3.

This is supposed to be your work, not ours. Start by writing down how you 
would solve this problem as a human being:

for each key:
    if the key is the one the user inputted, skip this key
    otherwise:
        get all the lists for this key
        for each list:
            search for the value        


Now change that to Python code. Don't just ask us to solve the problem 
for you.


-- 
Steven



More information about the Python-list mailing list