<｜begin▁of▁sentence｜>### Instruction:
Given a number of vertices (num_nodes) and a degree (k), can you generate a k-regular graph where each vertex has degree k, plot the graph, and ensure that num_nodes multiplied by k is an even number before generating the graph?
### Response:
import igraph as ig

# Generate a k-regular graph where each vertex has degree k
k = 3
num_nodes = 10

# It's important that a k-regular graph with n vertices can only be generated if n*k is even
if num_nodes * k % 2 == 0:
    graph = ig.Graph.K_Regular(n=num_nodes, k=k)
    ig.plot(graph, vertex_label=range(num_nodes))
else:
    print('Cannot create a k-regular graph with these parameters')
<|EOT|>
