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
vlada-n [284]
3 years ago
10

Consider the series of alternating 1s and 0s 1 0 1 0 1 0 1 0 1 0 ...... The user will enter a number n . And you have to output

the first n numbers of this sequence (separated by spaces) You may assume the user will enter n > 0 and an integer using two if statements

Computers and Technology
1 answer:
Vika [28.1K]3 years ago
8 0

Answer:

# user is prompted to enter the value of n

n = int(input("Enter your number: "))

# if statement to check if n > 0

if (n > 0):

   # for-loop to loop through the value of n

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

       # if digit is odd, print 1

       if((digit % 2) == 1):

           print("1", end=" ")

       # else if digit is even print 0

       else:

           print("0", end=" ")

Explanation:

The code is written in Python and is well commented.

A sample output of the code execution is attached.

You might be interested in
Moore’s law refers to?
puteri [66]

Answer:

Moore’s law states that processor speeds, or overall processing power for computers will double every two years.

Explanation:

  • Moore’s law is more than an observation than a law which was originated in 1970. The observation is about the number of transistors that is present in any system or an integrated system that will be doubled every couple of years.
  • The real-world application of Moore's law can be seen during computing your business taxes, piloting a spaceship, or changing the television station, etc.
7 0
2 years ago
Why is musical notation important? What benefits do musicians and others receive from being able to write down and note aspects
madreJ [45]
Most importantly, musicians can share their works with others.  Other people can see their musical ideas and can try and perform them too.   Nuances such as tempo, dynamics (loud soft, sweet, "harsh", are just some examples) can be understood even if the composer is not present and there is no recording to listen to.
Financial benefits can be realized from the sale of sheet music, scoring the piece, arranging the piece for bands, orchestras, etc. Conductors can lead an entire musical ensemble through the piece. 
4 0
3 years ago
When using a self-contained recovery device on a cfc, hcfc, or hfc system with an operating compressor, technicians must?
Neporo4naja [7]

When using a self-contained recovery device on a cfc, hcfc, or hfc system with an operating compressor. Technicians must recover 80% of the nameplate charge.

Compressor is a mechanical device used in many industries which has the function of increasing gas pressure by reducing its volume. The air compressor is a specific type of gas compressor.

Compressors can be characterized in a number of different ways, but are usually divided into types based on the functional method used to produce compressed air or gas. The following are common compressor types. Types covered include:

  • Pistons
  • Diaphragm
  • Helical Screw
  • Slide propeller
  • Scrolling
  • Rotary Lobe
  • Centrifugal
  • Axial

How to use an air compressor

  1. Position the Air Compressor
  2. Check the Oil Level
  3. Check the Drain Valve
  4. Set the PSI
  5. Prepare the Air Tank
  6. Connect the Air Hose
  7. Connect the Desired Tool
  8. Remove Excess Moisture

You can learn more about compressor here brainly.com/question/26581412

#SPJ4

7 0
1 year ago
What is the role of the digital cinematographer?
dlinn [17]
<span> is the person in charge of actually shooting the film. He is the head of the camera and lighting departments, and as such he has a big </span>role<span> in the making of any movie

</span>
3 0
3 years ago
Read 2 more answers
To assign the contents of one array to another, you must use ________.
iren [92.7K]

Answer:

Option c is the correct answer for the above question.

Explanation:

  • The array is used to holds multiple variables and the assignment operator can assign only a single variable at a time. So if a user wants to assign the whole array value into other array value then he needs to follow the loop.
  • The loop iteration moves on equal to the size of the array. It is because the array value moves into another array in one by one. It means the single value can move in a single time. So the moving processor from one array to another array takes n times if the first array size is n.
  • The above question asked about the processor to move the element from one array to another and the processor is a loop because the loop can execute a single statement into n times. So the C option is correct while the other is not because--
  1. Option 'a' states about one assignment operator which is used for the one value only.
  2. Option b states about the equality operator which is used to compare two values at a time.
  3. Option d states any of these but only option c is the correct answer.
  4. Option 'e' states none of these but option c is the correct.
8 0
2 years ago
Other questions:
  • Adam would like to reduce the size of an image that he inserted into a document. He selects the image and chooses the Crop optio
    11·2 answers
  • You are able to change the formatting of a table after it is inserted into a placeholder. True or false
    9·2 answers
  • Which of the following is a school-to-work program that provides the student with paid employment, school credit, and school gra
    7·2 answers
  • Select four programs that make up system software.Select four programs that make up system software.
    8·1 answer
  • A computer's hard disk drive holds 8 x 10^10 bytes of information. If Jill buys an extra memory stick that holds 5.1 X 10^8 byte
    10·1 answer
  • Which of the following extends a network over a large geographic area by connecting local area networks together?
    14·2 answers
  • List four significant differences between a file-processing system and a database management system (DBMS).
    5·1 answer
  • URGENT!!!
    9·1 answer
  • A host is on the 192.168.146.0 network that has a subnet mask of 255.255.255.0. The binary value of the host portion is 11010101
    8·1 answer
  • Classroom content transaction <br> examples use of IT
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!