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
Code a call to the function anotherFunc passing the array myints.
mario62 [17]

Answer:

d)anotherFunc(myints);

Explanation:

When we call a function we just have to pass the names of the arguments to the function.In case of arrays we also just have to pass the name of the array.We don't have to worry about the square brackets.So the function call will be like this.

anotherFunc(myints);

Hence the answer is option d.

4 0
2 years ago
Two friends can share 100 songs from their Bluetooth enabled mobile devices
Umnica [9.8K]

Answer:

A

Explanation:

If they are connected via bluetooth, you can share unlimited amounts of anything.

6 0
2 years ago
Write the logical Expression and Draw the Truth table for the <br> following questions
Alja [10]

The logical expressions are

  • (X NOR Y ) OR Z ⇒ (\bar X  \bar + \bar Y) + Z
  • (A NAND B) AND NOT C ⇒ (\bar A \bar \cdot\bar B) \cdot \bar C

<h3>How to determine the logical expressions?</h3>

<u>Logical expression 1</u>

X and Y are linked by the NOR gate.

So, we have:

X NOR Y

The X NOR Y is linked to Z by the OR gate.

So, we have:

(X NOR Y) OR Z

Hence, the logical expression is (X NOR Y ) OR Z ⇒ (\bar X  \bar + \bar Y) + Z

<u>Logical expression 2</u>

A and B are linked by the NAND gate.

So, we have:

A NAND B

The A NAND B is linked to C by the AND gate.

So, we have:

(A NAND B) AND C

Hence, the logical expression is (A NAND B) AND NOT C ⇒ (\bar A \bar \cdot\bar B) \cdot \bar C

See attachment for the truth tables

Read more about truth tables at:

brainly.com/question/27989881

#SPJ1

6 0
1 year ago
Why are medical coders using encoded software
EastWind [94]
To keep the medical records confidential otherwise, hackers would take advantage of them and sell them to the highest bidder 
3 0
3 years ago
How does a cloud-first strategy differ from other approaches to cloud?
Irina18 [472]

Cloud-first strategy differ from other approaches as It keeps all the services performed by legacy systems while moving to the Cloud in a staggered approach.

<h3>What is a cloud first strategy?</h3>

The change of cloud computing has brought about  “cloud-first” strategy.

This  is known to be a way to computing that tells that a firm should look first to cloud solutions when creating new processes or taking in old processes before taking in non-cloud-based solutions.

Note that Cloud-first strategy differ from other approaches as It keeps all the services performed by legacy systems while moving to the Cloud in a staggered approach.

See options below

it enables an organization to completely move to the cloud without infrastructure or support requirement

it keeps all the services performed by legacy systems while moving to the cloud in a staggered approach.

it partners technology with multiple other disciplines for comprehensive business transformation.

it uses artificial intelligence to automate all business processes and completely eliminate human error.

Learn more about cloud from

brainly.com/question/19057393

#SPJ1

6 0
2 years ago
Other questions:
  • Nadia would like to find text in her current document that differentiates CompanyABC from companyabc. Which option should she us
    8·2 answers
  • A computer application such as Microsoft Access that is used to store data and convert it into information is a ________________
    6·1 answer
  • Determine the number of bytes necessary to store an uncompressed RGB color image of size 640 × 480 pixels using 8, 10, 12 and 14
    11·1 answer
  • Describe software as a service. what features distinguish it from application software installed on a personal computing device
    11·2 answers
  • Compare and contrast the following network types: Personal Area Network (PAN) Local Area Network (LAN) Metropolitan Area Network
    14·1 answer
  • How does the use of the computer impact businesses
    13·1 answer
  • Hide Time Remaining A
    11·1 answer
  • Arrange these steps of creating a presentation in the correct order. (notice that the given order is incorrect other than the ba
    13·1 answer
  • What is the purpose of the Subtotal feature?
    9·1 answer
  • 1. A _______ causes the computer program to behave in an incorrect or unexpected way.
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!