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
import java.util.Scanner; public class TeenagerDetector { public static void main (String [] args) { Scanner scnr = new Scanner(
Sonja [21]

Answer:

import java.util.Scanner;

public class TeenagerDetector {

   public static void main (String [] args) {

       Scanner scnr = new Scanner(System.in);

       boolean isTeenager;

       int kidAge;

       kidAge = scnr.nextInt();

       

       /* Your solution goes here */

       isTeenager = (kidAge >= 13) && (kidAge <= 19);

       if (isTeenager) {

           System.out.println("Teen");

           

       } else { System.out.println("Not teen"); } } }

Explanation:

A condition which check for the teenager age and return a boolean is assigned to isTeenager.

isTeenager = (kidAge >=13) && (kidAge <= 19);

So, if the kidAge is greater than/equal to 13 and less than/19, the boolean isTeenager will be true and the program will output "Teen" else "false" will be output.

The range of age for a teenager is 13 - 19.

5 0
4 years ago
Read 2 more answers
Describe the purpose and user requirements for the website.​
dezoksy [38]

Answer:

The purpose and user requirements for the website is described below in details.

Explanation:

User Requirements represent how user expectations and wherewith they will communicate with the outcome. Use the characteristics, functions, and content expressed in your summaries to elaborate on your requirements. Your user synopses should describe the responsibilities your users want to perform on your site.

6 0
3 years ago
Which part of the water cycle is most affected by a sunny day with few clouds?
nirvana33 [79]
Increase in evaporation
8 0
3 years ago
Read 2 more answers
Using a custom animation effect, how do you make text appear on a slide letter by letter?
solong [7]

Answer:

Apply an entrance effect, and then set it to By letter in the Effect Options dialog box.

Explanation:

PowerPoint application can be defined as a software application or program designed and developed by Microsoft, to avail users the ability to create various slides containing textual and multimedia informations that can be used during a presentation. Some of the features available on Microsoft PowerPoint are narrations, transition effects, custom slideshows, animation effects, formatting options etc.

To format an image on PowerPoint, you can either use the Artistic Effects or Picture Effects.

Some of the features available on Microsoft PowerPoint are narrations, transition effects, custom slideshows, animation effects, formatting options etc.

Basically, the views that are available on the Microsoft PowerPoint application includes;

1. Slide Sorter.

2. Notes Page.

3. Reading Pane.

4. Presenter view.

Using a custom animation effect, in order to make text appear on a slide letter by letter, you should apply an entrance effect, and then set it to By letter in the Effect Options dialog box.

3 0
3 years ago
What EFC number will enable a student to receive the full amount of a Pell<br> Grant?
Eddi Din [679]

Answer:

I'm pretty sure to get the absolute maximum amount the EFC has to be 0 or really close to it. The EFC, or Expected Family Contribution, is mainly determined by your family's income. If your family has multiple students who will be enrolled in college, the number may be lower. It's not really about what number a student "should" have though, because the only way for you to lower it yourself is to lie, and you really don't want to do that-if you are found to have lied on your FAFSA there can be some serious legal consequences.

5 0
3 years ago
Other questions:
  • The technology that identifies people through bodily characteristics is known as
    10·1 answer
  • 40 POINTS I NEED THESE ANSWERS ASAP GIVE ME THE RIGHT ASNWER AND ILL PUT YOU AS THE BRAINLIEST
    13·1 answer
  • How should you decide what to wear to an interview? What kind of things should be considered?
    5·1 answer
  • Which of the following mountain ranges stretches from Alabama to Canada?
    10·1 answer
  • Access data is _______ in a Word document.
    10·1 answer
  • What is an example of a use for an icon set?
    6·1 answer
  • write a java program to accept three item names and prices, and output them. Also output the average price if one of the items i
    14·1 answer
  • Why should you avoid the use of sarcasm, clichés, and idioms in business letters?
    11·2 answers
  • 1st person to answer gets brainliest for free after 5 mins I wont be handing out brainliest
    11·1 answer
  • There is a population of owls in a forest. In one year there are 20 new owls born and 10 owls die. In this same year, 5 owls ent
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!