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
The benefits of voice mail include eliminating unnecessary chit chat, telephone tag, inaccurate messages, and a. the need for wr
jonny [76]

Answer:

The correct answer to the following question is option c.) time zone barriers.

Explanation:

When the maximum length of voice mails is set then, the calls that are sent to the voice mail will only recorded up to the that limit. We can also specify the any value from 1 to 60 minutes.

Note: When the voice mails transcription option is enable then, we can specify the any value between from 1 and 2 minutes.

4 0
3 years ago
How can you best integrate a website into a excel spreadsheet and allow it to link back to the website
Ivahew [28]
To import and connect a website in an Excel sheet, you can do as these:

1. Click Data > From Web.
doc import connect website 1

2. Then in the New Web Query dialog, type the website address you want to import into Address textbox, and click Go to display the website.
doc import connect website 2

3. Click Import, and the Import Data dialog pops out for selecting a cell or a new sheet to place the webpage content. See screenshot:
doc import connect website 3

4. Click OK. Now all webpage content excluding images have been imported in the sheet.
doc import connect website 4

5. Then select the whole worksheet, and then click Data > Properties in the Connections group. See screenshot:
doc import connect website 5

6. In the External Data Range Properties dialog, check the options as you need in Refresh control section and click OK.
doc import connect website 6

7. Also you can refresh the sheet contents by manually clicking on Refresh All > Refresh All/Refresh.
8 0
3 years ago
Create a Trip class. Include as data members destination, distance traveled, total cost of gasoline, and number of gallons consu
Gnom [1K]

Answer:

Technical issues

Unable to add question please find the question attached

Explanation:

Download docx
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> docx </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> txt </span>
4 0
3 years ago
Agape was asked to make a recommendation regarding short-range wireless technologies to be supported in a new conference room th
Bess [88]

Answer:

C. Infrared

Explanation:

According to my experience in the field of information technology, I can say that the one technology that she would not consider is infrared. Even though infrared is used in for many applications such as remote controls and sensors it is not that good for wireless communications. This is because compared to the other options available, infrared is only short range, the speeds at which it can transmit are very low, and any physical object can immediately block the signal and cause interference.

5 0
3 years ago
Issues in plagiarism and copyright when blogging can be prevented. True or false​
hammer [34]

Answer:

It’s false

Explanation:

I can’t explain it’s too confusing

8 0
3 years ago
Other questions:
  • Which word most strongly appeals to pathos?
    15·1 answer
  • When you take a multiple-choice test, you are relying on ________, a means of retrieving information out of your long-term memor
    8·1 answer
  • Don't pat any attention to this
    7·2 answers
  • Example of personal professional highlights of styles of communication
    11·1 answer
  • While doing online research you enter this keyword search with a truncation character: man* Which of the following would not be
    15·1 answer
  • Network Architecture and Topology: Mastery Test
    15·1 answer
  • When breaking a problem down, you often encounter elements that you want to use repeatedly in your code. Sometimes it's appropri
    5·1 answer
  • Stephanie would like to know the average number of regular hours worked by her employees. In cell B11, create a formula using th
    8·1 answer
  • Which sentence uses parallel structure correctly?
    12·1 answer
  • A microwave is the only electric device in a 120-volt circuit. If the circuit has 7. 5 amps of current, what is the electric pow
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!