<｜begin▁of▁sentence｜>### Instruction:
Given a food web with the relationships represented by directed edges [('Grass', 'Rabbit'), ('Rabbit', 'Fox')], can you compute the trophic levels of each species using NetworkX?
### Response:
import networkx as nx

# Compute the trophic levels of nodes in a food web
G = nx.DiGraph()
G.add_edges_from([('Grass', 'Rabbit'), ('Rabbit', 'Fox')])
trophic_levels = nx.algorithms.trophic_levels(G)
print('Trophic levels:', trophic_levels)
<|EOT|>
