Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am getting a syntax error from this dictionary, can someone help me find where the issue is?
Here's the dictionary:
Python
grade_gpas = {"A+":tuple(range(97,100)),"A":tuple(range(93,96)),"A-":tuple(range(90,92)),"B+":tuple(range(87,89)),"B":tuple(range(83,86)),"B-":tuple(range(80,82)),"C+":tuple(range(77,79)),"C":tuple(range(73,76)),"C-":tuple(range(70,72)),"D+":tuple(range(67,69)),"D":tuple(range(65,66))"F":tuple(range(0,65))}


What I have tried:

Checking the commas, the parenthesis, etc.
Posted
Updated 28-May-21 8:37am
Comments
Richard Deeming 28-May-21 10:13am    
And you plan to tell us what the error is? Or are we supposed to guess?

   grade_gpas = {"A+":tuple(range(97,100)),"A":tuple(range(93,96)),"A-":tuple(range(90,92)),"B+":tuple(range(87,89)),"B":tuple(range(83,86)),"B-":tuple(range(80,82)),"C+":tuple(range(77,79)),"C":tuple(range(73,76)),"C-":tuple(range(70,72)),"D+":tuple(range(67,69)),"D":tuple(range(65,66))"F":tuple(range(0,65))}


                                                                      ^
SyntaxError: invalid syntax

The comma is missing before "F".
 
Share this answer
 
Quote:
Checking the commas, the parenthesis, etc.

You need to check better.
Python
grade_gpas = {
"A+":tuple(range(97,100)),"A":tuple(range(93,96)),"A-":tuple(range(90,92)),
"B+":tuple(range(87,89)),"B":tuple(range(83,86)),"B-":tuple(range(80,82)),
"C+":tuple(range(77,79)),"C":tuple(range(73,76)),"C-":tuple(range(70,72)),
"D+":tuple(range(67,69)),"D":tuple(range(65,66))"F":tuple(range(0,65))}
# comma missing here                            ^
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900