I need some coding help, newbie here

Hey, I am trying to have three LEDS hooked up and be able to turn them on and off using a potentiometer. This is homework from Paul Mcwhorter Arduino series episode 13. This is the code I've made however only the redLed is turning on. Is there a mistake in the code or is just faulty LEDs on my part?

Thanks in advance!

int myPin=A2;
int readVal;
int delayT=250;
float V2;
int redPin=9;
int greenPin=8;
int bluePin=7;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(myPin, INPUT);
pinMode(redPin,OUTPUT);
pinMode(greenPin,OUTPUT);
pinMode(bluePin,OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
readVal=analogRead(myPin);
V2=(5./1023.)*readVal;
Serial.print("Potentiometer Voltage is ");
Serial.println(V2);

if (V2<=3.0){
digitalWrite(greenPin,HIGH);
}
if (V2>=3.0){
digitalWrite(greenPin,LOW);
}

if (V2>3 && V2<4){
digitalWrite(bluePin,HIGH);
}
if (V2<3 || V2>4){
digitalWrite(bluePin,LOW);
}

if (V2>4.0){
digitalWrite(redPin,HIGH);
}
if (V2<4.0){
digitalWrite(redPin,LOW);
}

delay(delayT);
}

Check your wiring.

Your code works: 0v - 3v = LED1 (green), 3v - 4v = LED2 (blue), > 4v = LED3 (red).

Would you "format" your code, and paste it between three "tick marks" found under the tilde on the keyboard ( ``` ) like this:

``` <- three ticks

void setup() {
 // things
}
void loop() {
  // other
}

``` <- three ticks

Your result will look like this:

int myPin = A2;
int readVal;
int delayT = 250;
float V2;
int redPin = 9;
int greenPin = 8;
int bluePin = 7;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(myPin, INPUT);
  pinMode(redPin, OUTPUT);
  pinMode(greenPin, OUTPUT);
  pinMode(bluePin, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  readVal = analogRead(myPin);
  V2 = (5. / 1023.) * readVal;
  Serial.print("Potentiometer Voltage is ");
  Serial.println(V2);

  if (V2 <= 3.0) {
    digitalWrite(greenPin, HIGH);
  }
  if (V2 >= 3.0) {
    digitalWrite(greenPin, LOW);
  }

  if (V2 > 3 && V2 < 4) {
    digitalWrite(bluePin, HIGH);
  }
  if (V2 < 3 || V2 > 4) {
    digitalWrite(bluePin, LOW);
  }

  if (V2 > 4.0) {
    digitalWrite(redPin, HIGH);
  }
  if (V2 < 4.0) {
    digitalWrite(redPin, LOW);
  }

  delay(delayT);
}

@reefy29 And also, please include a copy of your schematic. The old-timers will be asking for both your software code (auto formatted and within code tags!) plus the circuit diagram. It makes things a lot easier to understand what's going on!
Thank you!

why don't you add some prints to show which case is being exercised

why not use if/else statements, start at one end of the range of values and work toward the other

    if (4 < V2)  {
        Serial.println (4);
        ...
    }
    else if (3 < V2)
        ...
    else if (2 < V2)
        ...
    else if (1 < V2)
        ...
    else
        ...

???