<｜begin▁of▁sentence｜>### Instruction:
Given a pseudograph with edge set [(1, 2), (1, 3), (2, 3), (3, 4), (4, 2), (5, 1), (5, 4)], can you use the is_pseudographical function to check if the degree sequence of this graph is pseudographical? And what if we alter the last degree in the sequence by adding 1 to it?
### Response:
import networkx as nx

# Create a pseudograph
G = nx.MultiGraph([(1, 2), (1, 3), (2, 3), (3, 4), (4, 2), (5, 1), (5, 4)])
# Get degree sequence
sequence = [d for _, d in G.degree()]
# Check if the degree sequence is pseudographical
print(nx.is_pseudographical(sequence))

# Test a non-pseudographical sequence
sequence[-1] += 1
print(nx.is_pseudographical(sequence))
<|EOT|>
