Question: Disclaimer: I am a first time "programmer" and this is my first project. Please be patient as I am still learning terminology along with everything else that goes with it.

I am trying to capture specific data from my CSV and input that data into my python script to tweet it out. (Im making a Twitter bot).

This is the code I have so far:

```
import csv

with open('data.csv') as csvDataFile:
    data = list(csv.reader(csvDataFile))

print(data[25][2])

```

This lets me import my CSV and then select the column and row to which my tweet quote is. 

Here is what my data looks like:

```
id_serial,id_season,quote,file_path,id_group,trigger_time
1,S1E01,"People say I am the best boss. They go ""god we've never worked at a place like this before. You're hilarious. And you get the best out of us.""",,001,09:00 AM EST
2,S1E01,I think this pretty much sums it up,/home/pi/Desktop/OfficialDundies/media/001.png,001,11:00 AM EST

```

I would like to be able to grab the "printed" quote and store it as a variable so I can recall it later. Ideally, my bot will grab the quote and check the "trigger\_time" to see if it is time to tweet.

Answer: 
I would recommend using a `while` loop. A `for` loop is best when you know how many times you need to repeat the operation, but a `while` loop is good for repeating an unknown amount of times. It could run 0 to many times.

As for the condition of your `while` loop, you just want to check if the email address is invalid. So, check `!emailAddress.contains("@")` to see if it does not include an `@`, `!emailAddress.contains(".")` if it does not include a `.`. 

You can use `||` to see if either condition is true.

```
// Prompt the user
System.out.println("Please enter an email address");

String emailAddress =  // read in their email adress 

while(!emailAddress.contains("@") || !emailAddress.contains(".")) {
    System.out.println("You have entered an invalid email address, please enter another.");

    emailAddress = // read in their email address again
}

// Email address now contains "@" and "."

```
Something like this should work:

```
// While email does not contain the two characters..
// Keep asking the user to enter the correct email.
while(!emailAddress.contains("@") || !emailAddress.contains(".")){ 
    System.out.print("\nYou have entered an invalid email address.");
    // Add line of code here to ask for email address.
    // Update emailAddress of course
}
//prompt user for major & classification code
System.out.print("\nPleast enter two characters (Character #1: Major Code and Character #2: Classification 
// ...

```