# Social Networks | NPTEL 2022 | Week 1 Assignment Solutions

This set of MCQ(multiple choice questions) focuses on the Social Networks NPTEL Week 1 Assignment Solutions.

### Course layout

Week 1:Â Introduction
Week 2: Handling Real-world Network Datasets
Week 3: Strength of Weak Ties
Week 4: Strong and Weak Relationships (Continued) & HomophilyÂ
Week 5:Â Homophily Continued and +Ve / -Ve Relationships
Week 7:Â Cascading Behaviour in Networks
Week 9:Â Power Laws and Rich-Get-Richer Phenomena
Week 10:Â Power law (contd..) and Epidemics
Week 11: Small World Phenomenon
Week 12: Pseudocore (How to go viral on web)

NOTE: You can check your answer immediately by clicking show answer button. Social Networks NPTEL 2022 Week 1 Assignment Solution” contains 10 questions.

Now, start attempting the quiz.

### Social Networks NPTEL 2022 Week 1 Assignment Solutions

Q1. Let L = [“one”, “two”, [“three”, “four”, “five”, “six”], “seven”, [“eight”], []] be the list. What will be the output of len(L) (written in Python3)?

a) 5
b) 6
c) 8
d) 9

Q2. Which of the following functions is used to create a directed graphs with self loops and parallel edges in NetworkX?

a) networkx.MultiDirectedGraph()
b) networkx.Multi_Di_Graph()
c) networkx.MultiDiGraph()
d) networkx.Graph(create_using = ‘Multi Directed’)

Q3. If string = ‘Mississippi’, what will be the output of string[0:6] (written in Python3)?

a) ‘Missis’
b) ‘Mississ’
c) ‘Mississi’
d) TypeError

Q4. Total number of possible edges on a graph (undirected and without loops) on n vertices is not:

a) n(nâˆ’1)/2
b) n/2
c) 1+2+3+â‹…â‹…â‹…+(nâˆ’1)+n
d) 1+2+3+â‹…â‹…â‹…+(nâˆ’1)

Q5. If d = {0:’a’, 1:’b’, 2:’c’, 3:’d’} is the dictionary then which among the following codes (written in Python3) would reverse keys and values of d?

a) {v:k for k,v in d.items()}
b) {d[i]:i for i in range(4)}
c) {d[i]:i for i in d}
d) All of the above

Answer: d) All of the above

Social Networks NPTEL Week 1 Assignment Solutions

Q6. Let the number of atoms in the explored universe be 10801080. Pick the smallest number of nodes from the below given options such that the number of possible graphs on that many nodes is greater or equal to the number of atoms in the explored universe. (Assume log2log210 = 3.3)

a) 23
b) 24
c) 25
d) 26

Q7. What is the output of the following code snippet (written in Python3):

``````import networkx
G = networkx.Graph()
G.add_edges_from([(1, 2), (1, 3), (4, 1), (1, 5)])
G.remove_node(1)
print(len(G.edges()))``````

a) 0
b) 1
c) 2
d) 3

Social Networks NPTEL Week 1 Assignment Solutions

Q8. Let t be a tuple (“social”, “networks”, “IIT”). What will be the output of t.append((“Ropar”)), written in Python3?

a) (“social”, “networks”, “IIT”, “Ropar”)
b) (“social”, “networks”, “IIT”, (“Ropar”))
c) (“social”, “networks”, (“IIT”, “Ropar”))
d) Attribute Error

Social Networks NPTEL week 1 Assignment Solutions

Q9. Which of the following is correct?

(A) A variable name must start with a letter or the underscore character
(C) A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _)
(D) Variable names are case-sensitive (ropar, Ropar and ROPAR are three different variables)

a) Only A and B
b) Only A, B and C
c) Only B and D
d) Only A, C and D

Answer: d) Only A, C and D

Q10. For integers n>1, let Gn be a complete graph on n vertices such that each vertex is labeled by a distinct number 1,2,3,â‹…â‹…â‹…,n, and each edge is labeled by the sum of its endpoint labels. The sum of all the edge labels is:

a) n(nâˆ’1)2/2
b) n(nâˆ’1)(n+1)/2
c) n(nâˆ’1)(n+1)
d) n(n+1)/2

Social Networks NPTEL week 1 Assignment Solutions

<< Prev- Social Networks Week 0 Assignment Solutions

>> Next- Social Networks Week 2 Assignment Solutions

NPTEL answers: Problem solving through programming in C

Programming in Java NPTEL week 1 quiz answers

Nptel – Deep Learning assignment solutions

The above question set contains all the correct answers. But in any case, you find any typographical, grammatical or any other error in our site then kindly inform us. Donâ€™t forget to provide the appropriate URL along with error description. So that we can easily correct it.