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
By using password-stealing software, ________ capture what is typed on a keyboard and easily obtain enough personal information.
wariber [46]

Answer:

B) Keyloggers

Explanation:

Keyloggers are malicious softwares used by hackers to secretly record and capture keystrokes on a person's computer when they are using it. This enables the hackers steal sensitive data like passwords, bank details, address etc. Keyloggers are one of the oldest forms of cyber threats used by cybercriminals to spy on unsuspecting users. Keyloggers can be sent through links to access. computer o directly installed with access to the computer.

5 0
3 years ago
What is computer ? What is computer program? What is hard disk.
g100num [7]
A computer is a electronic that helps you access the internet/WiFi
4 0
3 years ago
Read 2 more answers
Rather than entering an IP address into our browser, we use a text-based address known as a(n
zalisa [80]

Answer:

url

Explanation:

7 0
2 years ago
Which of the following is a command shell with a built-in scripting language?1. The Server Manager’s Roles and Features wizard2.
IgorLugansk [536]
Your kinda right but wrong
4 0
3 years ago
Read 2 more answers
I'll give brainlist to right answers
xeze [42]
I think it’s number 1. Check the answer first.
5 0
2 years ago
Other questions:
  • An important advantage of using GUI data-entry objects is that you often can control what users enter by limiting their options?
    6·1 answer
  • Kumar was working on his term paper and had not saved his work before the battery died on his laptop. He panics because the pape
    12·1 answer
  • What will be returned when the following SQL statement is executed?
    5·2 answers
  • Yellow and blue light are projected on a white screen. what color will the screen appear to be?
    6·2 answers
  • Match each term to the appropriate definition. DBMS data mining hash file index key field locking protocol relation roll back sc
    10·1 answer
  • Can change the tab colors of the worksheets in excel
    13·1 answer
  • Discuss seven multimedia keys​
    8·1 answer
  • What is the output of this program? age=4 if age >5: print (“more”) else: print (“less”)
    7·1 answer
  • A start-up is expanding overseas and spends an excessive amount of time on recruiting and hiring activities, hindering its abili
    12·1 answer
  • Live footage refers to:
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!