Assignment 1: Assignment Submitted On 2020-09-21, 12:42 IST
Assignment 1: Assignment Submitted On 2020-09-21, 12:42 IST
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
Course
outline Assignment 1
The due date for submitting this assignment has passed.
How does an Due on 2020-09-30, 23:59 IST.
NPTEL online
course work?
Assignment submitted on 2020-09-21, 12:42 IST
Week 1 1) Which of the following is true about a computer program? 1 point
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 1/10
3/29/2021 The Joy of Computing using Python - - Unit 2 - Week 1
languages? 3) Choose the best command to be used at the start of your code, to locate the sprite at 1 point
(unit? an initial position every time you play the animation.
unit=17&lesson=23)
change x to val
How to go
about set x to val / set y to val
programming? point in direction 90
(unit?
point towards mouse pointer
unit=17&lesson=24)
No, the answer is incorrect.
Why to learn Score: 0
programming?
Accepted Answers:
(unit?
set x to val / set y to val
unit=17&lesson=25)
4) Assume the sprite is a ball and predict the output of the following control structure. 1 point
What is
programming?
(unit?
unit=17&lesson=26)
How to give
instructions?
(unit?
unit=17&lesson=27)
Introduction to
Scratch (unit?
unit=17&lesson=28)
Introduction to
Loops (unit?
unit=17&lesson=29)
Scratch :
Animation 3
(unit?
unit=17&lesson=34)
More on
Scratch (unit?
unit=17&lesson=35)
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 2/10
3/29/2021 The Joy of Computing using Python - - Unit 2 - Week 1
Quiz :
Assignment 1
(assessment?
name=274)
Week 1
Feedback
Form : The Joy
of Computing
using Python
(unit?
unit=17&lesson=282)
Assignment 1
solutions (unit?
unit=17&lesson=300)
Week 2
Week 3
week 4
Week 5
Week 6
Week 7
Week 8
Week 9
Week 10
Week 11
Week 12
Text Transcripts
Download Videos
Books
December 13
Programming
test - Session 1
(10AM to 11AM)
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 3/10
3/29/2021 The Joy of Computing using Python - - Unit 2 - Week 1
December 13
Programming
test - Session 2
(8PM to 9PM)
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 4/10
3/29/2021 The Joy of Computing using Python - - Unit 2 - Week 1
1, 2, 3, . . , 19
1, 3, 5, . . , 19
3, 5, 7, . . , 19
1, 2, 3, . . , 20
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 5/10
3/29/2021 The Joy of Computing using Python - - Unit 2 - Week 1
Accepted Answers:
1, 3, 5, . . , 19
7) Consider a road inclined at an angle of 30∘ and we have a car sprite to be driven over 1 point
this road. Pick the code that helps to perform the same.
Hint: The initial direction of the sprite is 90∘ .
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 6/10
3/29/2021 The Joy of Computing using Python - - Unit 2 - Week 1
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 7/10
3/29/2021 The Joy of Computing using Python - - Unit 2 - Week 1
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 8/10
3/29/2021 The Joy of Computing using Python - - Unit 2 - Week 1
say message
play sound
Broadcast message
touching color
9) Pick out the scratch library that provides the functionality to switch backdrop? 1 point
Motion
Control
Looks
Sensing
10) Imagine a Magic wand sprite and predict the output for the following set of instructions. 1 point
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 9/10
3/29/2021 The Joy of Computing using Python - - Unit 2 - Week 1
The Magic wand flies to a random position takes 1 sec pause and then reaches another
random position.
The Magic wand flies to a random position in 1 sec and after a 0.25 sec pause, it repeats the
same until it is stopped.
The Magic wand reaches all edges of the screen in a uniform pattern
The Magic wand flies between the top and bottom edges repeatedly.
https://onlinecourses.nptel.ac.in/noc20_cs83/unit?unit=17&assessment=274 10/10
Assignment 2
The due date for submitting this assignment has passed. Due on 2020-09-30, 23:59 IST.
print(“Stay Safe!”,“Friends”)
print(“Stay Safe! Friends”)
print(‘Stay Safe! Friends’)
print(Stay Safe Friends)
Yes, the answer is correct.
Score: 1
Accepted Answers:
print(Stay Safe Friends)
Predict the output for the following code that checks the eligibility to vote. 1 point
−1 × n −1×n
−1 + n −1+n
(−1) n (−1)n
n (−1) n(−1)
Yes, the answer is correct.
Score: 0
Accepted Answers:
(−1) n (−1)n
For the given code, what is the value of ‘total’ variable at the end of execution? 1 point
syntax error
264
988779
987987
Yes, the answer is correct.
Score: 1
Accepted Answers:
987987
Replace the given set of instructions with a for loop. 1 point
Yes, the answer is correct.
Score: 1
Accepted Answers:
Which of the following is the output for the given code? 1 point
Loop terminates
Continues execution
Program restarts execution
None of the above
Yes, the answer is correct.
Score: 1
Accepted Answers:
Loop terminates
What is the output of the following code? 1 point
Infinite loop
-20 20
20
-20
Yes, the answer is correct.
Score: 1
Accepted Answers:
20
Assignment 3
The due date for submitting this assignment has passed. Due on 2020-10-07, 23:59 IST.
[ ' coffee ' , ' jaggery ' , ' cheese ' , ' butter ' ]
[' coffee ' , ' sugar ' , ' cheese ' , ' butter ' ]
coffee
jaggery
cheese
butter
coffee jaggery cheese butter
Yes, the answer is correct.
Score: 1
Accepted Answers:
coffee
jaggery
cheese
butter
Which of the following code prints the sum of weights of people in the lift? 1 point
Yes, the answer is correct.
Score: 1
Accepted Answers:
Consider a python list named ‘book titles’. Pick the statement to add ‘Who moved my cheese?’ as 1 point
the third item.
Given: book titles = [‘Exam Warriors’, ‘Evil in the Mahabharata’, ‘6 TIMES THINNER’, ‘The Driver in the
Driverless Car’, ‘Evolution’]
m=stats.trim_mean(marks,0.2)
m=stats.trim_mean(marks,0.03)
m=stats.trim_mean(30,0.02)
m=stats.trim_mean(marks,0.02)
Yes, the answer is correct.
Score: 1
Accepted Answers:
m=stats.trim_mean(marks,0.02)
How will you simulate ‘Rolling a Dice’ with six faces by making use of ‘random’ library? 1 point
roll= random.choice(1,2,3,4,5,6)
roll= random.range(1,5)
roll= random.randint(1,6)
roll= random.random(6)
Yes, the answer is correct.
Score: 1
Accepted Answers:
roll= random.randint(1,6)
Consider a python list named ‘book_titles’. 1 point
Given: book_titles = [‘Exam Warriors’, ‘Evil in the Mahabharata’, ‘6 TIMES THINNER’, ‘The Driver in the
Driverless Car’, ‘Evolution’]
book_titles[4:]
[‘Evolution’]
[‘Exam Warriors’,‘Evil in the Mahabharata’, ‘6 TIMES THINNER’,
‘The Driver in the Driverless Car’]
[]
[‘Exam Warriors’, ‘Evil in the Mahabharata’, ‘6 TIMES THINNER’]
Yes, the answer is correct.
Score: 1
Accepted Answers:
[‘Evolution’]
Assuming, there is no file named ‘file.txt’ on my computer, what does the following code do? 1 point
Shows error
Displays: Hey I am writing the second line
Displays: Hey! I am writing.Hey I am writing the second line.
Displays: Hey! I am writing.
Yes, the answer is correct.
Score: 1
Accepted Answers:
Displays: Hey I am writing the second line
Predict the output 1 point
continue
break
try
catch
Yes, the answer is correct.
Score: 1
Accepted Answers:
break
You are supposed to code your ‘To do’ list that contains all the activities that you plan to perform in a 1 point
day. Assume you recharged your mobile and want
to delete it from the list. Identify the statement to perform the same.
Given: to_do=[‘Send Email’, ‘Recharge Mobile’, ‘Workshop preparation’]
to_do.delete(“Recharge Mobile ”)
to_do.clear(“Recharge Mobile”)
to_do.remove(“Recharge Mobile”)
to_do.pop()
Yes, the answer is correct.
Score: 1
Accepted Answers:
to_do.remove(“Recharge Mobile”)
Simulate a ‘Lot Box’ that contains all alphabets from ‘A’ to ‘Z’. Draw and Display. 0 points
print(random.choice(list(string.ascii_letters)))
print(random.choice(list(string.ascii_uppercase)))
print(random.choice(list(string.ascii_lowercase)))
print(random.choice(string.ascii_uppercase))
Yes, the answer is correct.
Score: 0
Accepted Answers:
print(random.choice(list(string.ascii_uppercase)))
The following snippet produces TypeError: int object not callable. Pick out the correct code. 1 point
r e s u l t=a ( b+(c * * 2 ) ) where a , b and c a r e any i n t e g e r s
result=ax(b+(c**2))
result=a//(b+(c**2))
result=a*(b+(c**2))
result=a.(b+(c**2))
Yes, the answer is correct.
Score: 1
Accepted Answers:
result=a*(b+(c**2))
How will you display the current date in ‘mm/dd/yy’ format? 1 point
print(datetime.datetime.now().strftime(‘%c’))
print(datetime.datetime.now().strftime(‘%B’))
print(datetime.datetime.now().strftime(‘%C’))
print(datetime.datetime.now().strftime(‘%x’))
Yes, the answer is correct.
Score: 1
Accepted Answers:
print(datetime.datetime.now().strftime(‘%x’))
What does the following code do? 0 points
returns true for century year and false for non century year
returns true for leap year and false for non leap year
returns false for century year and true for non century year
none of the above
Yes, the answer is correct.
Score: 1
Accepted Answers:
returns true for leap year and false for non leap year
Given a n × n n×n square matrix mx in the form of list of lists in figure, what is the output of the 1 point
statement func(mx,2) given n=7?
32185676
321678765
321185567763
367772185
Yes, the answer is correct.
Score: 1
Accepted Answers:
32185676
Pick out the snippet to perform integer division. 1 point
a // b
a/b
a mod b
a%b
Yes, the answer is correct.
Score: 1
Accepted Answers:
a // b
Pick out the valid function call to the definition given below: 1 point
is_participating(‘Raji’,‘Shiva’,‘Raji’,‘Priya’)
is_participating(‘Raji’,[‘Shiva’,‘Raji’,‘Priya’])
is_participating[‘Raji’,{‘Shiva’,‘Vani’,‘Priya’}]
is_participating(’Raji’,{‘Shiva’,‘Raji’,‘Priya’})
Yes, the answer is correct.
Score: 1
Accepted Answers:
is_participating(‘Raji’,[‘Shiva’,‘Raji’,‘Priya’])
Assignment 5
The due date for submitting this assignment has passed. Due on 2020-10-21, 23:59 IST.
del employee
del employee[0:2]
employee.remove()
employee.clear()
Yes, the answer is correct.
Score: 1
Accepted Answers:
employee.clear()
Which of the following code represents creating a dictionary from a list where keys are the unique 1 point
elements from the list and the value corresponding to a key is the number of times that key occurs in the
list.
none of these
Yes, the answer is correct.
Score: 1
Accepted Answers:
Identify the audio file format that is NOT supported by Python Speech Recognition Module. 1 point
FLAC
AIFF
WAV
MP3
Yes, the answer is correct.
Score: 1
Accepted Answers:
MP3
Which of the following exception can be used to handle the error that occurs when Google cannot 1 point
understand the audio content in speech recognition?
UnknownValueError
RequestError
ValueError
RunTimeError
Yes, the answer is correct.
Score: 1
Accepted Answers:
UnknownValueError
Which of the following statements is correct for the Monte Hall problem? 1 point
Statement I: If you choose the correct door on the first try, then switching loses
Statement II: Contestants who switch have 2/3 chances to win whereas contestants who donot switch have
1/3 chances of win.
I only
II only
Both I & II
None
Yes, the answer is correct.
Score: 1
Accepted Answers:
Both I & II
Which of the random experiments from the options does the code represent? 1 point
Prints a success when both people select the same object
Prints a success when both people select “rock”
Prints a success when both people select different objects
None of the above
Yes, the answer is correct.
Score: 1
Accepted Answers:
Prints a success when both people select the same object
What does the following code represent? 1 point
A drunkard moving on a straight line, moving one step forward with probability 0.4, one step
backward with probability 0.4 and staying at the same place with probability 0.2
A drunkard moving on a XY plane, moving right with probability 0.4, upwards with probability 0.8 and
diagonally up-right with probability 1.
A drunkard moving on a XY plane, moving right with probability 0.4, upwards with probability 0.4 and
diagonally up-right with probability 0.2.
A drunkard moving on a XY plane, moving left with probability 0.4, downwards with probability 0.8
and diagonally down-left with probability 1.
Yes, the answer is correct.
Score: 1
Accepted Answers:
A drunkard moving on a XY plane, moving right with probability 0.4, upwards with probability 0.4 and
diagonally up-right with probability 0.2.
The following code takes a list as input and prints the sorted list as an output. The outer for loop is to 1 point
count the number of iterations. What is the purpose of the inner for loop?
To fetch the pair of consecutive elements to be compared
Index of the element for which the right position is to be found
To identify the max element
To check if the list is sorted
No, the answer is incorrect.
Score: 0
Accepted Answers:
To fetch the pair of consecutive elements to be compared
The following code to its best, represents a scenario: 1 point
1000, 10
10, 2
1000, 2
10, 10
Yes, the answer is correct.
Score: 1
Accepted Answers:
1000, 10
Assignment 6
The due date for submitting this assignment has passed. Due on 2020-10-28, 23:59 IST.
Which of the following set of statements correctly represent encryption and decryption using substitution
cipher?
It is also given that the set of characters for substitution is chosen from the plain text.
Generates the secret code for the given mobile number with every digit coded with the next digit.
Generates the secret code for the given mobile number with every digit coded with the previous
digit.
Generates the secret code for the given mobile number with every digit coded with a random digit.
Generates the secret code for the given mobile number with every digit coded with a special
character.
Yes, the answer is correct.
Score: 1
Accepted Answers:
Generates the secret code for the given mobile number with every digit coded with the previous digit.
What is the output for the given code? 1 point
15
9
6
24
No, the answer is incorrect.
Score: 0
Accepted Answers:
6
Which of the following can be used to see the dimension of a numpy array named ‘arr’ ? 1 point
dim(arr)
shape(arr)
arr.shape
arr.shape()
Yes, the answer is correct.
Score: 1
Accepted Answers:
arr.shape
What happens if we fail to check the anchor case in a recursive function? 1 point
True
False
None
Error
Yes, the answer is correct.
Score: 1
Accepted Answers:
True
If GOLD is encoded as FNKC, then how is PLATINUM encoded? 1 point
NKYRGLSK
OKZSHMUL
NJYRGLSK
OKZSHMTL
Yes, the answer is correct.
Score: 1
Accepted Answers:
OKZSHMTL
Which of these statements is true? 1 point
Max-max
Min-max
Max-min
Min-min
Yes, the answer is correct.
Score: 1
Accepted Answers:
Min-max
Assignment 7
The due date for submitting this assignment has passed. Due on 2020-11-04, 23:59 IST.
A snakes and ladders game with one snake whose position remains constant while the player is
playing. The position also remains the same during any subsequent plays (i.e. the game board does
not change while you sleep and play again the next day).
A snakes and ladders game with one snake whose position remains constant while the player is
playing. However, the position can change during any subsequent plays (i.e. the game board might
change while you sleep and play again the next day).
A snakes and ladders game with one snake where the snake can change its position during the
game and also during any subsequent plays (a board game where the snakes keep moving). Further,
the snake can bite you any number of times.
A snakes and ladders game with one snake where the snake can change its position during the
game and also during any subsequent plays (a board game where the snake keeps moving). Further,
the snake can bite you only once when you play.
Yes, the answer is correct.
Score: 1
Accepted Answers:
A snakes and ladders game with one snake where the snake can change its position during the game and
also during any subsequent plays (a board game where the snake keeps moving). Further, the snake can
bite you only once when you play.
Consider the code given below. Assume your current position being 19 and what happens when you 1 point
roll 2?
You climb up the ladder to reach 42
You are bitten by a snake to reach 42
You win
You Quit
Yes, the answer is correct.
Score: 1
Accepted Answers:
You climb up the ladder to reach 42
Imagine a single player snakes and ladders game. The code below represents 1 point
A snakes and ladders game with one snake whose position remains constant while the player is
playing. The position also remains the same during any subsequent plays (i.e. the game board does
not change while you sleep and play again the next day).
A snakes and ladders game with one snake whose position remains constant while the player is
playing. However, the position can change during any subsequent plays (i.e. the game board might
change while you sleep and play again the next day).
A snakes and ladders game with one snake where the snake can change its position during the
game and also during any subsequent plays (a board game where the snakes keep moving). Further,
the snake can bite you any number of times.
A snakes and ladders game with one snake where the snake can change its position during the
game and also during any subsequent plays (a board game where the snake keeps moving). Further,
the snake can bite you only ones when you play.
Yes, the answer is correct.
Score: 1
Accepted Answers:
A snakes and ladders game with one snake where the snake can change its position during the game and
also during any subsequent plays (a board game where the snakes keep moving). Further, the snake can
bite you any number of times.
Predict the output of the calling function func(mx) for a given square matrix, mx of dimension 70 × 1 point
70.
Yes, the answer is correct.
Score: 1
Accepted Answers:
Predict the output of the calling function func() for a given square matrix mx of dimension 70 × 70. 1 point
Pandas
Scipy
PIL
numpy
Yes, the answer is correct.
Score: 1
Accepted Answers:
PIL
Given a n × n n×n square matrix mx in the form of list of lists in the following figure, what is the 1 point
output of the statement func(mx)?
Yes, the answer is correct.
Score: 1
Accepted Answers:
gmap=gmplot.GoogleMapPlotter(cent_lat,cent_long, zoom)
gmap=gmplot.GoogleMapPlotter(cent_long,cent_lat, zoom)
gmap=gmplot.GoogleMapPlotter(cent_lat,cent_long)
gmap=gmplot.GoogleMapPlotter(zoom,cent_lat,cent_long)
Yes, the answer is correct.
Score: 1
Accepted Answers:
gmap=gmplot.GoogleMapPlotter(cent_lat,cent_long, zoom)
Comment on the following code: 1 point
5
10
Error, because there is no len() function for Tuple
Error, because Tuples are immutable
Yes, the answer is correct.
Score: 1
Accepted Answers:
10
Which of the following instruction produces a tuple, Team with ‘Poonam’ as the sixth member? 1 point
Given:
Team=Team.append(‘Poonam’)
Team=Team+tuple(‘Poonam’)
Team=Team+(‘Poonam’)
Team=Team+(‘Poonam’,)
Yes, the answer is correct.
Score: 1
Accepted Answers:
Team=Team+(‘Poonam’,)
Which of the scenarios in the options does the following code represent? 1 point
A person going to the bar for a year. Daily he guesses a number from 1 to 10. If the guessed
number is equal to the number randomly generated by bar authority, he gains one gold coin.
A person going to the bar for a month. Daily he guesses a number from 1 to 10. If the guessed
number is equal to the number randomly generated by bar authority, he gains one gold coin.
A person going to the bar for a year. Daily he guesses a number from 1 to 10. If the guessed
number is equal to the number randomly generated by bar authority, he loses one gold coin.
A person going to the bar for a month. Daily he guesses a number from 1 to 10. If the guessed
number is equal to the number randomly generated by bar authority, he loses one gold coin.
Yes, the answer is correct.
Score: 1
Accepted Answers:
A person going to the bar for a year. Daily he guesses a number from 1 to 10. If the guessed number is
equal to the number randomly generated by bar authority, he gains one gold coin.
Consider the following two codes: 1 point
mirror_image=img.transpose(Image.FLIP_TOP_BOTTOM)
mirror_image=img.flip(Image.FLIP_LEFT_RIGHT)
mirror_image=img.transpose(Image.FLIP_LEFT_RIGHT)
mirror_image=img.composite(Image.FLIP_LEFT_RIGHT)
Yes, the answer is correct.
Score: 1
Accepted Answers:
mirror_image=img.transpose(Image.FLIP_LEFT_RIGHT)
Identify the technique that can be used to enhance image in cv2. 1 point
enh_img=clahe.apply(gray)
enh_img=canny.apply(gray)
enh_img=sobel.apply(gray)
enh_img=enhance.apply(gray)
Yes, the answer is correct.
Score: 1
Accepted Answers:
enh_img=clahe.apply(gray)
Identify the best instruction to debug the following code that checks if the given strings are 1 point
Anagrams:
if s1.sort()==s2.sort():
if s1.sorted()==s2.sorted():
if sorted(s1)==sorted(s2):
if sorted(s1)!=sorted(s2):
Yes, the answer is correct.
Score: 1
Accepted Answers:
if sorted(s1)==sorted(s2):
Which of the following libraries helps us to find the intensity of emotion in sentiment analysis? 1 point
vader
nltk
pandas
scipy
Yes, the answer is correct.
Score: 1
Accepted Answers:
vader
The isalpha() function in NLTK 1 point
returns true if any of the words in a sentence are composed of alphabetic characters and false
otherwise
returns true if all the characters in a word are alphabets and false otherwise
returns true if all the characters in a word are alphabets or numerics and false otherwise
None of the above
Yes, the answer is correct.
Score: 1
Accepted Answers:
returns true if all the characters in a word are alphabets and false otherwise
Every character, either alphabet or digit or special character has an ASCII value. Choose the 1 point
appropriate method to find the ASCII value of ‘f’.
ASCII(‘f’)
ord(‘f’)
int(‘f’)
ASC_val(‘f’)
Yes, the answer is correct.
Score: 1
Accepted Answers:
ord(‘f’)
Assignment 9
The due date for submitting this assignment has passed. Due on 2020-11-18, 23:59 IST.
G = nx.complete_graph(10)
G = nx.complete_graph(9)
G = nx.Graph(10)
G = nx.Digraph(10)
Yes, the answer is correct.
Score: 1
Accepted Answers:
G = nx.complete_graph(10)
Identify the option that best describes the graph output of the following code. 1 point
nx.build_gexf(g,‘Friendship.gexf’)
nx.create_gexf(g,‘Friendship.gexf’)
nx.write(g,‘Friendship.gexf’)
nx.write_gexf(g,‘Friendship.gexf’)
Yes, the answer is correct.
Score: 1
Accepted Answers:
nx.write_gexf(g,‘Friendship.gexf’)
What does p and q represent in the following instruction to find the shortest path length? 1 point
word_tokenize(text)
word_sent(text)
text.word_tokenizer()
text.sent_tokenizer()
Yes, the answer is correct.
Score: 1
Accepted Answers:
word_tokenize(text)
Predict the output for the given code: 1 point
nltk.FreqDist()
nltk.Freq_Dist()
nltk.Frequency_Dist()
nltk.FDist()
Yes, the answer is correct.
Score: 1
Accepted Answers:
nltk.FreqDist()
Which of the following commands is used to create an image for an array? 1 point
Image.array(array)
Image.fromarray(array)
Image.imagefromarray(array)
Image.imgarray(array)
Yes, the answer is correct.
Score: 1
Accepted Answers:
Image.fromarray(array)
What is the output of the following snippet? 1 point
Image of size 200 x 200 with Red on left and Blue on right
Image of size 200 x 3 with Red on top and Blue at the bottom
Image of size 200 x 200 with Red on top and Green at the bottom
Image of size 200 x 200 with Red on top and Blue at the bottom
Yes, the answer is correct.
Score: 1
Accepted Answers:
Image of size 200 x 200 with Red on top and Blue at the bottom
Consider the program to estimate the area calcuation of your state. How can you increase the 1 point
accuracy of the estimate?
len
size
dimension
length
Yes, the answer is correct.
Score: 1
Accepted Answers:
size
Predict the output. 1 point
1,4
[1, 4, 6, 12]
[1, 4]
[2, 3, 5, 6, 12]
Yes, the answer is correct.
Score: 1
Accepted Answers:
[1, 4]
What is the output for the following snippet? 1 point
Yes, the answer is correct.
Score: 1
Accepted Answers:
Chennai and Chennai are same. Chennai and Chennai are same. Chennai=Chennai,
Chennai=Chennai
Chennai and Chennai are same. Chennai and Chennai are same. Chennai=Madras,
Madras=Chennai
Madras and Madras are same. Madras and Madras are same. Chennai=Madras, Madras=Chennai
Chennai and Chennai are same. Chennai and Chennai are same. Chennai=Chennai,
Madras=Chennai
Yes, the answer is correct.
Score: 1
Accepted Answers:
Chennai and Chennai are same. Chennai and Chennai are same. Chennai=Madras, Madras=Chennai
Given: 1 point
array([5, 7, 9])
array([ 6, 15])
AxisError: axis 2 is out of bounds for array of dimension 2
array([15])
Yes, the answer is correct.
Score: 1
Accepted Answers:
AxisError: axis 2 is out of bounds for array of dimension 2
Pick out the correct output. 1 point
numpy . ones ( ( 3 , 3 ) )
Yes, the answer is correct.
Score: 1
Accepted Answers:
How will you create a blank image of the same size and type of a given image? 1 point
img=Image.new(im.mode,im.shape)
img=Image.new(im.mode,im.size)
img=Image.new(im.type,im.size)
img=Image.blank(im.mode,im.size)
No, the answer is incorrect.
Score: 0
Accepted Answers:
img=Image.new(im.mode,im.size)
Choose the relevant image for test3.png created by the given code. 1 point
Yes, the answer is correct.
Score: 1
Accepted Answers:
Predict the output. 1 point
13
38
14
39
Yes, the answer is correct.
Score: 1
Accepted Answers:
13
Which of the following options is a best description of the output for the following command? 1 point
find_element_by_id()
find_element_by_link_text()
find_element_by_class_name()
send_keys()
Yes, the answer is correct.
Score: 1
Accepted Answers:
send_keys()
Identify the python library required for Browser Automation. 1 point
Selenium
Time
Webdriver
Chromedriver
Yes, the answer is correct.
Score: 1
Accepted Answers:
Selenium
Pick out the driver method to open a website in selenium. 1 point
driver.getwebpage()
driver.get()
driver.request()
driver.open()
Yes, the answer is correct.
Score: 1
Accepted Answers:
driver.get()
What is the purpose of the given command when we request to open a web page? 1 point
login_box.send_keys(name + Keys.ENTER)
login_box.press_keys(name + Keys.ENTER)
login_box.send_keys(name + ENTER)
login_box.hot_key(name + Keys.ENTER)
Yes, the answer is correct.
Score: 1
Accepted Answers:
login_box.send_keys(name + Keys.ENTER)
Which of the following libraries can be used to print time according to different timezones? 1 point
datetime
date
calendar
pytz
Yes, the answer is correct.
Score: 1
Accepted Answers:
pytz
How will you find the day of the week, given a date? 0 points
nanoseconds
milliseconds
minutes
microseconds
Yes, the answer is correct.
Score: 0
Accepted Answers:
microseconds
How will you retrieve current date using date library? 1 point
date.today()
date.now()
date.current date()
date.date()
Yes, the answer is correct.
Score: 1
Accepted Answers:
date.today()
Assignment 12
The due date for submitting this assignment has passed. Due on 2020-12-09, 23:59 IST.
Which of the following commands is used to create the graph given below: 1 point
G = networkx.complete_graph(7)
G = networkx.cycle_graph(6)
G = networkx.star_graph(6)
G = networkx.star_graph(7)
Yes, the answer is correct.
Score: 1
Accepted Answers:
G = networkx.star_graph(6)
Comment on the purpose of the following command. 1 point
Which of the following real world networks represent an undirected graph? 1 point
Wikigraph
Citation network
Facebook Friendship network
World wide web
Yes, the answer is correct.
Score: 1
Accepted Answers:
Facebook Friendship network
What happens to the total Points with every iteration in the Points distribution method? 1 point
14
15
13
12
No, the answer is incorrect.
Score: 0
Accepted Answers:
14
Which of the sequence do you obtain by executing 3n+1 algorithm for n = 10? 1 point
31, 15, 7, 3, 1
5, 16, 8, 4, 2, 1
5, 3, 2, 1
doesnot converge
Yes, the answer is correct.
Score: 1
Accepted Answers:
5, 16, 8, 4, 2, 1
How will you choose the next node to traverse in a random walk method of Page Rank algorithm? 1 point