Home > Back-end >  Students python problem, solving, be urgent!!!!!!
Students python problem, solving, be urgent!!!!!!

Time:09-25

In a Python list comprehensions using multiple if else do the following:
Here is one class exam score
,50,65,78,95,100 score=[25]
Cycle between 0 to 10, if the value is less than 60 failed the output, if the value is between 60 and 80 output is good, more than 80 when the output score
The correct output is "pass", "pass", "good", "good", 95100]

CodePudding user response:

Don't use Java to write you?

CodePudding user response:

Print ([" pass "if x<=60 else" good "if x<=80 else for x x in,50,65,78,95,100 [25]])

CodePudding user response:

reference 1st floor chaimhao response:
Java write to you?

You can try it, thank you

CodePudding user response:

refer to the second floor of H_ wind response:
print ([" pass "if x<=60 else" good "if x<=80 else for x x in,50,65,78,95,100 [25]])

This code doesn't work, have an error

CodePudding user response:

reference 4 floor JWENIU response:
Quote: refer to the second floor of H_ wind response:
print ([" pass "if x<=60 else" good "if x<=80 else for x in x,50,65,78,95,100 [25]])

This code doesn't work, there are an error

I here is no problem, you paste the error message I see, and the topic "cycle between 0 to 10" this sentence is I didn't understand, and less than 60 minutes not fail in the exam, you put the correct output result is pass, I hit code according to the correct result,

CodePudding user response:

That should be a scale of 0-100, the teacher may have the wrong number

CodePudding user response:

reference 5 floor H_ wind machine reply:
Quote: refer to 4th floor JWENIU response:

Quote: refer to the second floor of H_ wind response:
print ([" pass "if x<=60 else" good "if x<=80 else for x x in,50,65,78,95,100 [25]])

This code doesn't work, there are an error

I here is no problem, you paste the error message I see, and the topic "cycle between 0 to 10" this sentence is I didn't understand, and less than 60 minutes not fail in the exam, you put the correct output result is pass, I code according to the correct result, playing

Should be to fail, is good

CodePudding user response:

refer to 7th floor JWENIU response:
Quote: refer to fifth floor H_ wind machine reply:
Quote: refer to 4th floor JWENIU response:

Quote: refer to the second floor of H_ wind response:
print ([" pass "if x<=60 else" good "if x<=80 else for x x in,50,65,78,95,100 [25]])

This code doesn't work, there are an error

I here is no problem, you paste the error message I see, and the topic "cycle between 0 to 10" this sentence is I didn't understand, and less than 60 minutes not fail in the exam, you put the correct output result is pass, I code according to the correct result, playing

Should be to fail, good

The File "& lt; Ipython - input - 1-5 bbbae33c1cc & gt;" , line 1 print ([" pass "if x<=60 else" good "if x<=80 else for x in x,50,65,78,95,100 [25]]) ^ SyntaxError: invalid character in the identifier
  • Related