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
Lapatulllka [165]
4 years ago
8

Wrtie a program in which we will pass a value N. N can be positive or negative. If N is positive then output all values from N d

own to and excluding 0. If N is negative, then output every value from N up to and excluding 0.
Computers and Technology
1 answer:
Triss [41]4 years ago
5 0

Answer:

Following are the answer to this question:

x=int(input("Enter number: "))#defining x variable that input value from user end

if x< 0:#defining if block that check x value is less then 0

   while x<0:#defining while loop print up to the value

       print(x)#print value

       x+= 1#add values by 1

elif x>0:#defining elif block to check value x is greater than 0

   while x>0:#defining while loop to print down to value

       print(x)#print value

       x-= 1#subtract value by 1

Output:

when input is a positive value

Enter number: 5

5

4

3

2

1

when input is a negative value

Enter number: -5

-5

-4

-3

-2

-1

Explanation:

  • In the given python code, x variable is declared that input the value from the user end, in the next step if and elseif block is declared that calculates and prints its value.
  • In the if block, it checks value is negative it uses the while loop to prints its values in the down to value form.
  • In the elif block, it checks the positive it uses the while loop to prints its values into the up to values form.  
You might be interested in
What makes Darth Vader's sound so sinister, menacing and evil?
olganol [36]

Answer:

The volume, special effects, and the content of the speech.

Explanation:

The volume and special effects make all video productions's tone clearer. The words that Darth Vader speaks also adds to his "bad guy" character.

3 0
4 years ago
Read 2 more answers
Give a common business example that mimics the differences between a shared
Serhud [2]

An  business example that mimics the differences between a shared network segment and a dedicated network segment is that of connection of work station transmission.

<h3>What is Shared segment network?</h3>

In this type of network,  local area network or an aspect of the local area network is said to have a lot of workstations and the multiple workstations are linked by using a hub

Note that all the workstation do not need to share the network capacity with other workstations but  an  business example that mimics the differences between a shared network segment and a dedicated network segment is that of connection of work station transmission.

Learn more about network segment from

brainly.com/question/7181203

#SPJ1

6 0
2 years ago
When setting quotas for disk space, what are the two tools for enabling and configuring quotas? and which of the two are the mor
lora16 [44]
NTFS quotas
File server resource manager.

A system admin has rights to set NTFS quotas if he or she is concerned with some users monopolizing a small amount of disk space. Activating NTFS quotas helps set a storage limit for users using a particular volume. Out of the two, file server resource manager is the most effective and flexible. It is best recommended to use file server resource manager if you need quotas. It comes with file-type filtering and includes folder-level quotas.
8 0
3 years ago
What is the right thing to do when you spot fake news​
LUCKY_DIMON [66]

Answer:

to tell the truth

Explanation:

l mean there is no reason to keep it secret

6 0
3 years ago
Cybersecurity is defined as the set of techniques to protect the secrecy, integrity, and availability of computer systems and da
natka813 [3]

Answer:

<h3>The answer is true because it protects our secret account </h3>
7 0
2 years ago
Other questions:
  • ASAP ε=ε=ᕕ(°□°)ᕗ<br> Sorry if you can't see it but please help me if you can!
    6·1 answer
  • This diagram shows who is responsible in preventing cyberbullying. A flowchart. Top box is labeled Cyberbullying can be prevente
    14·2 answers
  • Which of the file names below follows standard file naming convention?
    12·2 answers
  • You are contacted by a project organizer for a university computer science fair. The project organizer asks you to hold a forum
    10·1 answer
  • Haigy Paigy is as a children's invented language which sounds exactly like English, except that "aig" is inserted before the vow
    12·1 answer
  • Do you think<br> brain uploading<br> is a good idea?
    7·1 answer
  • A file named "dogs.txt" exists and has 60 lines of data. You open the file with the following line of code.
    5·1 answer
  • 22. (a) List two arithmetic
    7·1 answer
  • So has anyone opened the link/file those people are giving out as answers? Like what are they, viruses, answers, nothing??? Some
    9·2 answers
  • Can you show me how to code this is GDBonline? explaining each statement with notes//
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!