What's wrong in my code?


#1

Hi,
I’m stucked in the Computer Science path at Python Control Flow
13. Review

Here are the instructions :
The admissions office at Calvin Coolidge’s Cool College has heard about your programming prowess and wants to get a piece of it for themselves. They’ve been inundated with applications and need a way automate the filtering process. They collect three pieces of information for each applicant:

  1. Their high school GPA, on a 0.0 - 4.0 scale.
  2. Their personal statement, which is given a score on a 1 - 100 scale.
  3. The number of extracurricular activities they participate in.

The admissions office has a cutoff point for each category. They want students that have a GPA of 3.0 or higher, a personal statement with a score of 90 or higher, and who participated in 3 or more extracurricular activities.

Write a function called applicant_selector which takes three inputs, gpa , ps_score , and ec_count . If the applicant meets the cutoff point for all three categories, have the function return the string:

"This applicant should be accepted."

Here is my code :

def applicant_selector(gpa,ps_score,ec_count):
  if (gpa >= 3.0) and (ps_score >= 90) and (ec_count >= 3): 
    return "This applicant should be accepted"

When I press Run, this red message appear below in script.py :
Expected the test values GPA = 3.0, Personal Statement Score = 90, and Extracurricular count = 3 to return the response This applicant should be accepted., instead it return the response This applicant should be accepted.

What’s wrong ? What is the correct code to write ? I didn’t understand. English isn’t my mother tongue, so perhaps have i misunderstood some word.
Thanks for any help.


#2

the string returned needs to be an exact match, see:

How does Codecademy check my answer?

recommendation: copy and paste strings to not waste time with these kind of errors


#3

Ok I get it. Thanks :slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.