Advanced Python development environment with ZA School's professional tools
Executing your Python code...
Save your code history, track statistics, and access advanced features!
No recent executions found.
# Data Structures data = { "students": ["Alice", "Bob", "Charlie"], "grades": [85, 92, 78] } # List comprehension high_grades = [grade for grade in data["grades"] if grade >= 85] print(f"High grades: {high_grades}") # Function example def calculate_average(grades): return sum(grades) / len(grades) avg = calculate_average(data["grades"]) print(f"Average grade: {avg:.2f}") # Error handling try: result = 10 / 0 except ZeroDivisionError: print("Cannot divide by zero!")