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
zavuch27 [327]
2 years ago
12

Given a number n, for each integer i in the range from 1 to n inclusive, print one value per line as follows:

Computers and Technology
1 answer:
monitta2 years ago
3 0

The program is an illustration of loops and conditional statements

<h3>Loops</h3>

Loops are used to perform repetitive operations

<h3>Conditional statements</h3>

Conditional statements are statements that are used to make decisions, depending on their truth values

<h3>Python program</h3>

The program written in Python where comments are used to explain each line is as follows:

#This gets input for n

n = int(input())

#This iterates through n

for i in range(1,n+1):

   #If the current number is not a multiple of 3 and 5

   if not(i%3 == 0 or i%5==0):

       #This prints the number

       print(i,end="")

   else:

       #This prints "Fizz", if the current number is a multiple of 3

       if i%3 == 0:

           print("Fizz",end="")

       #This prints "Buzz", if the current number is a multiple of 5

       if i%5==0:

           print("Buzz",end="")

   #This prints a new line

   print()

Read more about loops and conditional statements at:

brainly.com/question/26098908

You might be interested in
A monitor is a type of? CPU input memory output
aleksklad [387]

Answer:

Un monitor es un periférico de salida en el que la computadora muestra las acciones y ejecuciones que se realizan él.

Explanation:

:D

5 0
3 years ago
A file named numbers.txt contains an unknown number of lines, each consisting of a single positive integer. Write some code that
Reptile [31]

Answer:

  1. with(open("numbers.txt")) as file:
  2.    data = file.readlines()  
  3.    runsum = 0
  4.    largest = 0
  5.    
  6.    for x in data:
  7.        if(int(x) > largest):
  8.            largest = int(x)
  9.            runsum += largest  
  10.    
  11.    print(runsum)

Explanation:

The solution code is written in Python 3.

Firstly, open a filestream for numbers.txt (Line 1) and then use readlines method to get every row of data from the text files (Line 2).

Create a variable runsum to hold the running sum of number bigger than the maximum value read up to that iteration in a for loop (Line 3).

Use a for loop to traverse through the read data and then check if the current row of integer is bigger than the maximum value up to that point, set the current integer to largest variable and then add the largest to runsum (Line 6 - 9).

At last display the runsum to console terminal (Line 11).

8 0
3 years ago
Claudia has a bachelor's degree in computer information systems, and she has learned to use some popular software testing tools.
Studentka2010 [4]
She should be a great software programmer!
3 0
3 years ago
Read 2 more answers
What role does technology have in relationship to nuclear?
Scorpion4ik [409]
There is a growing relationship between technology and nuclear. This is called technology convergence - as technology converges with other disciplines in order to better improve the functionality of the specific task. Specifically, when thinking of the role technology plays with nuclear, it could control the temperature and gas levels of the nuclear power plant. There could perhaps be a control database which is used to monitor the patterns in behaviour of nuclear power plant. Thinking on a more Donald Trump level, technology would enable him to 'fire' the nuclear missiles, possibly in the form of a button or a terminal prompt. Technology has a huge role in the growing of nuclear. 
7 0
3 years ago
You live "out in the middle of nowhere" and feel there is no need to protect your internet connection because there is no one th
Anvisha [2.4K]

Potential uploaded viruses, personal information being lost, blackmail, identity theft.

7 0
3 years ago
Other questions:
  • What are the reasons why is it necessary to evaluate online sources and content?
    6·1 answer
  • Find the greatest common factor of 48 and 36.​
    6·1 answer
  • What was the original motivation for developing the internet?
    7·1 answer
  • Is iPhone better than android
    12·2 answers
  • Which step in the software development life cycle involves making improvements based on user feedback?
    15·1 answer
  • Wap in java to complete the following (16*1) +(14*2) +(12*3) +(10*4) +(8*5) +(6*6) +(4*7)​
    13·1 answer
  • OH NO THE HEAVY IS DEAD
    12·2 answers
  • Using a tag, set the color to orange for all tags
    13·2 answers
  • Implement the ArrayMethod application containing an array that stores eight integers. The application should call the following
    12·1 answer
  • PlanthelogicforLungi’sapplicationusingpseudocode.Thelogicneedstosatisfythefollowingneeds:TheapplicationwillneedtoallowLungitoen
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!