Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

variable referenced before assignment python

def calculate_grade(grade):
	if grade > 80:
		letter = "A"
	elif grade > 70:
		letter = "B"
	elif grade > 60:
		letter = "C"
    elif grade > 50:
        letter = "D"
    else:
        letter = "F"
    return letter
Source by careerkarma.com #
 
PREVIOUS NEXT
Tagged: #variable #referenced #assignment #python
ADD COMMENT
Topic
Name
6+2 =