1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Debora [2.8K]
3 years ago
12

What is the output of the following program?

Computers and Technology
1 answer:
Natasha2012 [34]3 years ago
6 0

Answer:

Output of the program is following

sum=45

Explanation:

The execution of the program in the "for" loop  will be following

For k=0

=> val=1 and sum=0+1=1

For k=1

=> val=2 and sum=1+2=3

For k=2

=> val=3 and sum=3+3=6

For k=3

=> val=4 and sum=6+4=10

For k=4

=> val 5 and sum=10+5=15

For k=5

=> val=6 and sum=15+6=21

For k=6

=> val =7 and sum=21+7=28

For k=7

=> val=8 and sum=28+8=36

For k=8

val=9 and sum=36+9=45

So all the iterations of for loop are completed and the output is 45.

I hope it will help you!

You might be interested in
#Write a function called "replace_all" that accepts three #arguments: # # - target_string, a string in which to search. # - find
gulaghasi [49]

Answer:

Here is the function replace_all:

def replace_all(target_string,find_string,replace_string):

   result_string = replace_string.join(target_string.split(find_string))  

   return result_string

#if you want to see the working of this function then you can call this function using the following statements:

target_string = "In case I don't see ya, good afternoon, good evening, and good night!"

find_string = "good"

replace_string = "bad"

print(replace_all(target_string, find_string, replace_string)

Explanation:

The above program has a function called replace_all that accepts three arguments i.e target_string, a string in which to search ,find_string, a string to search for and replace_string, a string to use to replace every instance of the value of find_string. The function has the following statement:

replace_string.join(target_string.split(find_string))  

split() method in the above statement is splits or breaks the target_string in to a list of strings based on find_string. Here find_string is passed to split() method as a parameter which works as a separator. For example above:

target_string = In case I don't see ya, good afternoon, good evening, and good night!

find_string = good

After using target_string.split(find_string) we get:

["In case I don't see ya, ", ' afternoon, ', ' evening, and ', ' night']

Next join() method is used to return a string concatenated with the elements of target_string.split(find_string). Here join takes the list ["In case I don't see ya, ", ' afternoon, ', ' evening, and ', ' night'] as parameter and joins elements of this list by 'bad'.

replace_string = bad

After using replace_string.join(target_string.split(find_string))  we get:

In case I don't see ya, bad afternoon, bad evening, and bad night!  

The program and output is attached as a screenshot.

7 0
3 years ago
Digital cameras always create great photographs. <br>True <br>False
Pavel [41]

True..they do take great photography..

8 0
3 years ago
Read 2 more answers
You have recently installed Windows Server 2019 Desktop Experience on a server. Your manager informs you that he needs to extens
Korolek [52]

To meet the manager requirement, you need to format the server, then after that install Server Core. This process is now followed by rebooting the server in the Server Core mode.

<h3>How do you install a Windows server?</h3>

Whenever you want to install Windows Server by using setup wizard settings, you have the choice of installing Server Core or Server with a graphical user interface known as the Desktop Experience installation method.

Since the GUI is not usually installed with Server Core; you control the server via the command line by using:

  • PowerShell,
  • The Server Configuration tool (SConfig), or
  • Remote methods. 

Now, if your manager informs you that he needs to extensively use the command line and PowerShell but not the use of graphical interface, the best way to meet the requirements are:

  • Format the server and install server core
  • Reboot the server in the Server Core mode

Learn more about Windows server installation here:

brainly.com/question/26175904

5 0
3 years ago
The limitation of trade secret protection for software is that it is difficult to prevent the ideas in the work from falling int
Lubov Fominskaja [6]

Answer:

The answer is "Option B".  

Explanation:

The main drawback of commercial security is, that the software may not protect digital technology against data mining, and they are not known to be the  imperial tools, that's why the only option B is correct, and certain options are wrong, which can be explained as follows:

  • In option A, It used to provide a sequence of instructions, which is used in security.  
  • In option C, It doesn't use in security, that's why it is wrong.
  • Option D and Option E are wrong because in software there is no use of court and new software, it only upgrades the software.
4 0
3 years ago
You have many drugs that you want to store electronically along with their purchase dates and prices, what kind of software woul
Doss [256]

Answer:

Database

Explanation:

To store a variety of drugs electronically, along with displaying their purchase dates and prices, the kind of software that would be used is database.

5 0
3 years ago
Other questions:
  • If you purchase a software suite for personal use, you can install the software how many times on how many different machines?
    6·1 answer
  • Oday's color display devices represent color using the ______ color model.â
    13·1 answer
  • In regards to storing folders the computer can be described as a ________________.
    7·1 answer
  • Tamara has $500 she is looking to save for a class trip. She wants to earn the most possible interest and will not need access t
    7·1 answer
  • What PowerShell command can be used to clean up old update files on a WSUS server, including unused update files, old revisions,
    10·1 answer
  • IT specialists must display technical expertise and collaborative proficiency in the workplace. Select the IT specialist who dem
    7·1 answer
  • ou use productivity apps on your iPad tablet device while traveling between client sites. You're concerned that you may lose you
    11·1 answer
  • Whats the difference between Input and Output? Give and example of an example on a M:B​
    15·1 answer
  • Which two features offered by SharePoint
    12·1 answer
  • Active directory and 389 directory server are both compatible with which directory access protocol?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!