Question: I have a list with a few hundred values which looks like this:

`(0.0021265099091875685, 0.0017700721644805513)
(0.0026319917728469086, 0.002632415013842871)`

I want to calculate the euclidean distance between each row.

The way I plan on calculating it is something like this:

```
sqrt(0.0021265099091875685 - 0.0026319917728469086)^2 + (0.0017700721644805513 -  0.002632415013842871)^2

```

I'm having trouble working out how I can access each value in order to do those calculations. If anyone has any ideas about doing this it would be very helpful. Thanks

EDIT: I'm pulling data from a MySQL db. Initially I had two lists, when printed out, a list would look like this:

`0.00212650990919
0.00263199177285
0.00332920813651
0.00268428300012
0.00245768768193`

I then created a new list by doing this: 

```
someList = zip(list1 , list2)

```

which gave me the output I have above.

Answer: 
Use the contains function to check if the string contains that piece of string.

```
for(int i = 0; i < commonPass.length; i++) 
{
  if (password.contains(commonPass[i])) 
  {
     System.out.println("Enter new password.");
     password = kb.nextLine();
  }
}

```

From the Java docs (<http://docs.oracle.com/javase/7/docs/api>):

contains(CharSequence s) : Returns true if and only if this string contains the specified sequence of char values.

I have tested the following code and that should work correctly. Good luck programming!

```
private void CheckPassword()
{
    String[] commonPass = new String[4];
    commonPass[0] = "testing";
    commonPass[1] = "stackoverflow";
    commonPass[2] = "coding";
    commonPass[3] = "userinput";

    Scanner s = new Scanner(System.in);

    System.out.println("Enter your password.");
    String password = s.nextLine();

    for(int i = 0; i < commonPass.length; i++) 
    {
        if (password.contains(commonPass[i])) 
        {
            CheckPassword();
        }
    }       

}

```
u want to match passwords so use .equals why u using indexOf.