<｜begin▁of▁sentence｜>### Instruction:
Given a list of edges [(0, 1), (1, 2), (2, 3), (3, 4)], how can you create and visualize a NetworkX graph using the 'from_edgelist' function?
### Response:
import networkx as nx

# Define the list of edges
edgelist = [(0, 1), (1, 2), (2, 3), (3, 4)]

# Create a graph from the edge list
G = nx.from_edgelist(edgelist)

# Draw the graph
import matplotlib.pyplot as plt
nx.draw(G, with_labels=True)
plt.show()
<|EOT|>
