Edhesive 9.7 question 3
w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]
s=[]
for word in w:
l = len(word)
s.append(l)
print(l,":",word)
Can someone help me fix this i dont know whats wrong
Answers
Indentation is a must in python.
For every inner statement, give 4 head spaces than the previous major statement.
And the options clearly stated to have one space after ':'. We should maintain it.
The program should go as follow:
w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]
s=[]
for word in w:
l = len(word)
s.append(l)
print(l,": ",word)
However, if your motto is to print the length and the word only, you can conveniently skip s=[] and s.append(l) statements.
Learn more:
1. Write statement to call the function. def Add(): X = 10 + 20 print(X) _____
https://brainly.in/question/18547516
2. Python program to find absolute difference between the odd and even numbers in the inputted number.
https://brainly.in/question/11611140