Social Networks | Week 1
Social Networks | Week 1
Course Link: Social Networks | Week 1
Q1. Which function will you use to find the number of edges drawn in the Graph?
order( )
edges( )
edge_size( )
number_of_edges( )
Q2. What will be the maximum number of edges for a graph with 10 vertices?
10
45
55
100
Q3. What does items() function for a dictionary return?
Dictionary with all keys and values
List with tuples having keys and values
List containing all keys and values
Tuples containing all keys and values
Q4. What will be the output of the given code?
x = [i for i in range(10)]
plt.plot(x, x**2, 'r=')
plt.show()
Error displaying unsupported operand types for ** in plot
It plots the x with its exponential value with points and lines in the plot
It plots x with exponential value with points in the plot
It plots x with exponential value with red line in the plot
Q5. What does the value ‘ys-’ as the third parameter in plot function indicate?
It helps to plot square with line connecting the points
It helps to plot yellow color square with dotted line connecting the points
It helps to plot yellow color square with line connecting the points
It helps to plot yellow color dotted line
Q6. Choose the correct statement to convert a list ‘List1’ to array in numpy.
List1.numpy()
List1.numpy array()
List1=numpy.array(List1)
List1.numpy.array()
Q7. Use networkx package, and write the statement to add the edges between two nodes (1,2) of a graph G=nx.Graph().
G.add_edge()
G.add_edge(1,2)
G.addedge(1,2)
G.AddEdge(1,2)
Q8. If you want to generate a random number from an inclusive range which function is to be used?
randrange()
randint()
random.random()
rand_Int()
Q9. If a=‘Social’, b=‘Networks’ then which of the following operation would show ’SocialNetworks’ as output?
a+b
a+”+b
a+””+b
All of the above
Q10. In the command networkx.erdos_renyi_graph(a,b), the parameters ‘a’ and ‘b’ denote the following respectively:
Number of edges and the probability with which edges are to be placed between every pair of nodes
Number of nodes and the probability with which edges are to be placed between every pair of nodes
The probability with which edges are to be placed between every pair of nodes and Number of edges
Number of edges and Number of nodes