<｜begin▁of▁sentence｜>### Instruction:
Given a directed graph with edge set [('A', 'B', 3), ('B', 'C', -4), ('C', 'A', 2)], how can you check if the graph has negatively weighted edges or if a specific edge has a negative weight using NetworkX?
### Response:
import networkx as nx

# Create a directed graph
G = nx.DiGraph()

# Add edges with weights
G.add_weighted_edges_from([('A', 'B', 3), ('B', 'C', -4), ('C', 'A', 2)])

# Check if the graph has negatively weighted edges
print(nx.is_negatively_weighted(G))

# Check if a specific edge has negative weight
print(nx.is_negatively_weighted(G, edge=('B', 'C')))
<|EOT|>
