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
The _____ component of a decision support system (DSS) includes mathematical and statistical models that, along with the databas
Ira Lisetskai [31]
Model Base. Hope it helps
5 0
3 years ago
What is the meaning of the word joystick
Roman55 [17]
<span>The meaning of Joystick is the control column of an aircraft</span>
4 0
3 years ago
Read 2 more answers
Question 16 (2 points) Question 16 Unsaved
strojnjashka [21]
I will help with as many as I can! :)
-
16. Slogans
17. Website Design and Development Process
18. Planning
19. (This question is the same as question 18 so I am at a loss here, sorry)
20. Confuse users, believing it is a hyperlink.

I apologize for the wait. I was trying to double check my sources. Also, I apologize in advance if something is wrong.
3 0
3 years ago
Sizing handles are used in Microsoft® Word® to _____.
Kamila [148]
<span>Sizing handles are used in Microsoft Word to resize an object.</span>
8 0
3 years ago
Who create and developed castlevania?
Ray Of Light [21]
The game was made by Nintendo. 
Developers: Koji Igarashi<span> </span>Hideo Kojima<span> </span>Michiru Yamane<span> </span><span>Yuzo Koshiro. </span>
6 0
3 years ago
Other questions:
  • Which of the following is a reason why the comments tool within PDF documents could be helpful? (Select all that apply.)
    5·1 answer
  • To copy text in a Word document to an Excel spreadsheet, you should first format the text as a Word table or as text separated b
    11·2 answers
  • The first computer (the eniac was how big
    8·1 answer
  • Implement RandMultipByVal function, which gets one integervariable as its argument
    12·1 answer
  • Examine the following algorithm.
    9·1 answer
  • How much RAM memory is recommended for your computer to be used as a digital darkroom?
    9·1 answer
  • Write a method that accepts a string as an argument and checks it for proper capitalization and punctuation. The method should d
    14·1 answer
  • _____ describes the layout of the screen. Block-based, Interface, Editor, Player
    11·2 answers
  • Who's hype for Halo Infinite?
    11·2 answers
  • What causes the hidden node problem in a wireless local area network (wlan)?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!