<｜begin▁of▁sentence｜>### Instruction:
Generate a planted l-partition graph using NetworkX with 4 groups, 3 vertices in each group, a within-group connection probability of 0.5, and a between-group connection probability of 0.1. Set the random seed to 42 and create an undirected graph. How many nodes does the resulting graph have?
### Response:
import networkx as nx

# Generate a planted l-partition graph
l = 4  # Number of groups
k = 3  # Number of vertices in each group
p_in = 0.5  # Probability of connecting vertices within a group
p_out = 0.1  # Probability of connected vertices between groups
seed = 42  # Seed for random number generator
directed = False  # Flag to create an undirected graph

G = nx.planted_partition_graph(l, k, p_in, p_out, seed=seed, directed=directed)

print('Planted l-partition graph has been created with', len(G), 'nodes')
<|EOT|>
