Computer Science, asked by 4804176334, 8 months ago

Use the following initializer list:

w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

Write a loop that prints the words in uppercase letters.

#please someone that knows how to do this in python and add a print (" ") at the end of the program.

Answers

Answered by abhishekyadav61156
0

Answer:

Hii there

here is your answer

In Python, the capitalize() method converts the first character of a string to capital (uppercase) letter. If the string has its first character as capital, then it returns the original string. Syntax: string_name.capitalize() string_name: It is the name of string of whose first character we want to capitalize.

HOPE IT HELPED U

PLZ MARK AS BRIANLIEST

Read more on Brainly.in - https://brainly.in/question/14838000#readmore

Answered by poojan
14

To print the words in uppercase letters, all you need to do in python is, to use the function stringvariable.upper()

Language Using : Python Programming.

Program :

1. To print all the uppercase words in a line.

w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

for i in w:

   print(i.upper(), end=" ")

Output :

ALGORITHM LOGIC FILTER SOFTWARE NETWORK PARAMETERS ANALYZE ALGORITHM FUNCTIONALITY VIRUSES  

2. To print each uppercase word in a line.

w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

for i in w:

   print(i.upper())

Output :

ALGORITHM

LOGIC

FILTER

SOFTWARE

NETWORK

PARAMETERS

ANALYZE

ALGORITHM

FUNCTIONALITY

VIRUSES

Explanation :

Here, we used for loop to access each element of the list w, with an iterating variable i. On each iteration, i holds each string of a list in order, and passes it through the function i.upper() that converts the complete case of string to upper.

Coming to the printing style, to print the values in just a line, we need to add end=" " telling the interpreter to not terminate the line, and to print the next one with just a space gap. If you ignore it, the line terminates there and the print() on iteration, prints the next value on next line.

Note : I have added the attachments of the interpretation and the execution of programs with their outputs. Take a look!

Quick Tip :

In python, you must and should follow Indentation. Following the indentation property in any programming language will help you in quickly analysing the code, if an error occurs.

Find the code easy? Python has such a speciality that it can attract a non-coder too.

Want to know more about the language and the topic? These links may help you out.

  • What are the advantages of Python Programming?

         https://brainly.in/question/11007952

  • Function that takes string as an input and counts the no.of upper case letters and lower case letters present in it.

        https://brainly.in/question/10466213

Hope it helps! Thank you!

Attachments:
Similar questions