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
7nadin3 [17]
3 years ago
12

What is wrong with this code and correct it.

Computers and Technology
1 answer:
balandron [24]3 years ago
8 0

Answer:

What's wrong?

The line_str variable needs to be re-initialized at the end of each printing

The correction

Include the following line immediately after the print statement

       line_str = ""

Explanation:

Required

Correct the code

The conditions are correct. However, the string variable line_str needs to be set to an empty string at the end of every of the iteration loop.

This will allow the code to generate a new string.

So, the complete function is:

<em>def swapping_stars(): </em>

<em>    line_str = "" </em>

<em>    for line in range(0, 6): </em>

<em>        for char in range(0,6): </em>

<em>            if line % 2 == char%2: </em>

<em>                line_str += "*" </em>

<em>            else: </em>

<em>                line_str += "-" </em>

<em>        print(line_str) </em>

<em>        line_str = ""</em>

You might be interested in
Se puede crear un campo electromagnetico con corriente continua?
Rama09 [41]

Answer:

A Direct Current (DC) electromagnetic field refers to a constant or static DC electric or DC magnetic field emission which has a frequency of 0 Hz. DC magnetic fields can also be created from a DC power source of electricity such as battery power, solar power, and wind power.

3 0
3 years ago
In an array list the time complexity of the remove function is identical to the time complexity of the ____ function.
yaroslaw [1]

Answer:

C. is Full

Explanation:

In an array list the time complexity of the remove function is identical to the time complexity of the ''isFull'' function.

3 0
4 years ago
Read 2 more answers
With the development of IEEE 802.1x port security, the _________ authentication server has seen even greater usage.
Licemer1 [7]

Answer:

RADIUS.

Explanation:

RADIUS:- It's full form is Remote Authentication Dial-In User Service.It is a software and a protocol for client/server that lets the servers having remote access to communicate with the central server so that it can validate dial-in users and it can authorize their accessibility to the system or service they requested .

It provides better security.It lets an organisation or a company to maintain profiles of the users in a central database so that it can be shared by the remote servers.

6 0
4 years ago
1. Discuss why it is so important for all application builders to always check data received from unknown sources, such as Web a
Ivan

Answer:

1. It is so important for all application builders to always check data received from unknown sources before using that data. This is because of the Security related reasons and vulnerabilities .For example the data received might contain harmful hidden viruses.  Web applications are accessed by internet and these are the most vulnerable to attacks by hacker or intruders using harmful data containing malware. This can cause security breaches due to the security flaws or bugs in Web applications. So to overcome such security risks which can cause damage in the Web applications, data from unknown sources should be checked.

Explanation:

2. When the Website is being used and running, there is a room for possible glitches or other bugs and issues. To understand, handle and address  issues successfully, the website operators carefully and consistently patch and configure their systems. The administrators collect the user data which enables them to have enough data in order to make the requisite alterations or improvements in the website. This also helps to improve the website performance. The patching and configuring of systems fix problems in the website which reduces the risk of website damage and the website works smoothly this way. Moreover it identifies vulnerabilities, solve configuration issues and upgrades in website features provide additional capabilities to the website.

8 0
3 years ago
Create a pseudocode program that asks students to enter a word. Call a function to compute the different ways in which the lette
Arte-miy333 [17]

Answer:

The pseudocode is given below

Explanation:

<u>Pseudocode</u>

  • Prompt user to enter string
  • Pass it to combination function which will calculate the total combination and will return it in array
  • In combination method -
  • Check if the string is length 2 size ie of 0 or 1 length then return string itself
  • Else iterate through string user entered
  • Get the current character in variable and check if the variable is already used than skip
  • Create a string from 0 to ith index + (concatencate) i+1 to length and recursive call combination function and pass this string and store result in subpermutation array
  • For each recursive call push character + subPermutation in totalArrangement array .
6 0
3 years ago
Other questions:
  • Word offers a multitude of picture formatting options that allow you to flip, rotate, and make many other adjustments to inserte
    15·1 answer
  • What are the advantages and disadvantages of it?
    14·1 answer
  • It is not possible to use keywords to search for themes
    5·1 answer
  • What are the three types of network topologies used today?
    13·1 answer
  • Explain what it means to have good file management skills.
    10·1 answer
  • This project involves writing a program that encodes and decodes messages. The program should prompt the user to select whether
    15·1 answer
  • Which of the following will display a string whose address is in the dx register: a.
    12·1 answer
  • Engineers use science to ______ things that people use.
    13·1 answer
  • Olivia wants to change some settings in Outlook. What are the steps she will use to get to that function? open Outlook → File →
    7·2 answers
  • modern managed cloud service providers will often use secure keyboard/video/mouse (kvm) devices within their data centers. these
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!