8.7 Code Practice Question 3

One latest schools question and answer enquired students to claim what they assume is the most crucial important thing for a student to do in order for you to obtain success. Of the numerous results, the one that that stood out was practice. People who are definitely successful do not become successful by being born. They work hard and persistence their lives to succeeding. If you want to accomplish your goals, keep this in mind! following some question and answer examples that you could possibly work with to develop your knowledge and gain insight that will guide you to preserve your school studies.

Question:

8.7 Code Practice Question 3

Use the following initializer list:
w = [“Algorithm”, “Logic”, “Filter”, “Software”, “Network”, “Parameters”, “Analyze”, “Algorithm”, “Functionality”, “Viruses”] Create a second array named s. Then, using a loop, store the lengths of each word in the array above. In a separate for loop, print on separate lines the length of the word followed by the word

Answer:

The for loop that can be used to loop through the array s and get the length and the word is a follows:

s = [“Algorithm”, “Logic”, “Filter”, “Software”, “Network”, “Parameters”, “Analyze”, “Algorithm”, “Functionality”, “Viruses”]

for i in s:

   print(len(i), “:”, i)

The variable s is used to store the array of strings

The for loop is used to loop through the array .

The length of each string and the string is printed out.  

When the code is run, you will get exactly like the sample Run.  

They can hopefully guide the student deal with the question by make use of the questions and answer examples. Then will possibly have some sharing in a group discussion and also learning with the classmate about the topic, so another student also own some enlightenment and still keeps up the school learning.

READ MORE  A jar of alphabet tiles contains 10 unique consonant tiles an 5 unique vowel tiles. If 5 tiles are picked randomly, the probability that 3 are consonants and 2 are vowels is

Leave a Reply

Your email address will not be published.