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
larisa86 [58]
3 years ago
9

Ask the user to enter a number n >= 1. There after the user will enter n-1 distinct integers between 1 and n. Thus, the enter

ed numbers contain all numbers between 1 and n except one. Output the missing number. You are not allowed to use lists. You are also not allowed to use dictionaries or any programming concept more advanced that a loop. The numbers entered can be in any order.
Computers and Technology
1 answer:
snow_tiger [21]3 years ago
3 0

Answer:

Code below

Explanation:

n = int(input('Please enter n: '))#take input n

print('please enter the numbers')#print enter the numbers

total = 0 #intially take total as 0

original_total = 1 #intially take original_total=1

for i in range(2, n+1): #take the range 2 to n+1

total += int(input('Please enter a number: ')) # add total and enter the number

original_total += i

missing = original_total - total #you got missing number original_total - total

print('The missing number is: ' + str(missing)) # print missing number in the given data

You might be interested in
Discuss why mtv initially had a difficulty securing enough ads
Alexxx [7]
MTV couldn't get enough ads because they didn't have enough distribution. MTV came up with the advertising campaign called “I want my MTV”. MTV executive named Les Garland got famous rock musicians to go on MTV, film a commercial spot and say, “I want my MTV”. And when these famous rockerstold the viewers to call their cable company and demand their MTV, the phones rang off the<span>hook.</span>
7 0
3 years ago
I ate five M&amp;Ms: red, green, green, red and yellow. Only these three colors are possible. I assume that p(yellow)=3p(green)
Rina8888 [55]

Answer:

Below is code written in a free CAS (WxMaxima):

The above code creates the probability of 19 or more brown in the sample of 48 for population sizes from 5*19 to 10000 in steps of 5.

Here’s a plot of that data:

The horizontal blue line is the probability for an infinite population size (or, choosing each of the 48 M&Ms with replacement, which I infer is not what you meant). It is calculated using the binomial cdf:

The red curve approaches the blue line asymptotically as the population gets larger.

At population 10000, the red curve is

.

5 0
2 years ago
When did outdoor air pollution first become a significant problem?
zmey [24]
Out door air pollution has been a problem since ancient Romans...but the industrial revouloution was when outdoor air pollution increased and it a significant problem...
hope this helps
6 0
3 years ago
Write steps to Delete data from ‘Datagridview’
julsineya [31]

Explanation:

private void btnDelete_Click(object sender, EventArgs e)

{

if (this.dataGridView1.SelectedRows.Count > 0)

{

dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index);

}

}

8 0
3 years ago
Stores of data that are so large or complex that it is difficult to process them using traditional data base management applicat
OverLord2011 [107]

Answer: ....

Big Data

Explanation:

Big Data Technology can be defined as a Software-Utility that is designed to Extract,Analyse and  Process  the information from an extremely complex and large data sets which the Traditional Data Processing Software could never deal with. Big data is a field that treats ways to analyze, systematically extract information from, or otherwise deal with data sets that are too large or complex to be dealt with by traditional data-processing application software.

Predictive analytics assists enterprises in identifying future opportunities and likely risks by distinguishing specific patterns over the historical data. In general, prescriptive analytics is a predictive analytics which prescribes one or more courses of actions and shows the likely outcome/influence of each action.

6 0
3 years ago
Other questions:
  • What can a folder on a computer contain?
    13·2 answers
  • What does computer means?
    13·2 answers
  • True or false?
    13·1 answer
  • Person-name: String+setName(String name): void+getName(): String^Student-studentID: long+Student(String sname, long sid)+setID()
    10·1 answer
  • Should the existing system be replaced?This is a question that is asked during the _____ stage of the Systems Development Life C
    8·1 answer
  • Write a program that prints the numbers 1 to 4 on the sameline with each pair of adjacent numbers separated by a single space(1
    5·1 answer
  • What is used to accurately position objects on the slide using a single horizontal and vertical line that intersects in the cent
    5·2 answers
  • Can somebody tell me the Minecraft command to clear an entire world and destroy every block if u Dunno please don’t answer &gt;-
    13·1 answer
  • The getElementById DOM Method do?
    13·1 answer
  • The code on the side is a software solution to the mutual exclusion problem for two processes. It shares two variables:
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!