Computers and Technology, 25.02.2021 21:30, irene003
What is wrong with this piece of code? I am trying to create a list given specific strings and an input, then find the largest word and return/print it.
def largest(words):
Length = 0
Word = ""
largest_word = ""
num_Words = len(words)
for x in range(0, num_Words, 1):
largest_word = words[x]
largest_length = len(largest_word)
if (largest_length >= Length):
largest_length = Length
largest_word = Word
return largest_word
user_pet = input("Enter a pet: ")
y = ["cat", "dog", "hamster", user_pet]
largest_petname = largest(y)
print(largest_petname)
Answers: 1
Computers and Technology, 22.06.2019 19:00, dadonelson2109
If your accelerator suddenly gets stuck what should you do
Answers: 2
Computers and Technology, 23.06.2019 09:30, blake2001
Which of the following tasks is an audio technician most likely to perform while working on a nature documentary? (select all that apply). eliminating potentially distracting background noise adding sound effects making sure the lighting is adequate for a particular scene changing the narration to better match the mood of the documentary
Answers: 3
What is wrong with this piece of code? I am trying to create a list given specific strings and an in...
Mathematics, 21.08.2019 14:30
Mathematics, 21.08.2019 14:30
Social Studies, 21.08.2019 14:30
History, 21.08.2019 14:30