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
topjm [15]
3 years ago
12

In python, Create a conditional expression that evaluates to string "negative" if user_val is less than 0, and "non-negative" ot

herwise.
Computers and Technology
1 answer:
marshall27 [118]3 years ago
6 0

I am assuming that user_val is an inputted variable and a whole number (int)...

user_val = int(input("Enter a number: "))

if user_val < 0:

   print("negative")

else:

   print("non-negative")

You might be interested in
.) Write a complete C program in one file which takes a double value from the user, cubes it, and prints the result. Your progra
Ket [755]

Answer:

Explanation:

#include <iostream>

using namespace std;

double cube(double);

int main()

{

   double ci=0;

   cout << "Enter avalue :";

   cin >> ci;

   cout << "Cube of " << ci << "is =" << cube(ci) << endl;

   return 0;

}

double cube(double i)

{

   return(i*i*i);

}

8 0
3 years ago
What setting in Word keeps single lines of a new
Gre4nikov [31]

Answer:

C (Window/Orphan control)

Explanation:

An "orphan" in formatting is a single line of text that is left alone/separated from the rest of the paragraph. Orphan control prevents this from happening by keeping lines together.

3 0
3 years ago
A _____ is one in which the size of the web page and the size of its elements are set regardless of the screen resolution..
mixas84 [53]

Answer: Fixed layout

Explanation:

Fixed layout  is the arrangement of any website page or webpage that is featured with fixed size on any screen resolution .Fixed layout displays all the components and tools of the page with a fixed percentage.

  • The width or percentage cannot be changed or altered as it is fixed.The user experiences same width of the page and elements in any computing resolution.

7 0
3 years ago
// This pseudocode segment is intended to compute and display
Finger [1]

The pseudocode to calculate the average of the test scores until the user enters a negative input serves as a prototype of the actual program

<h3>The errors in the pseudocode</h3>

The errors in the pseudocode include:

  • Inclusion of unusable segments
  • Incorrect variables
  • Incorrect loops

<h3>The correct pseudocode</h3>

The correct pseudocode where all errors are corrected and the unusable segments are removed is as follows:

start

Declarations

     num test1

     num test2

     num test3

     num average

output "Enter score for test 1 or a negative number to quit"

input test1

while test1 >= 0

     output "Enter score for test 2"

     input test2

     output "Enter score for test 3"

     input test3

     average = (test1 + test2 + test3) / 3

     output "Average is ", average

     output "Enter score for test 1 or a negative number to quit"

     input test1

endwhile

output "End of program"

stop

Read more about pseudocodes at:

brainly.com/question/11623795

3 0
2 years ago
Assuming that s and t are Strings, which of the following code fragments are such that the value returned by s.indexOf( t ) befo
KengaRu [80]

Answer:

What programming language is this

Explanation:

5 0
2 years ago
Other questions:
  • Submit your 300-word essay describing the equipment usedI in a well-equipped studio’s audio department and the training and expe
    8·2 answers
  • Which of the following characters is not allowed for java variable names
    7·1 answer
  • A method's name and parameter list constitute the method's ____.
    13·1 answer
  • Your mom is trying to save room on her hard drive and wants to uninstall some of her applications. She asks you how to do this.
    9·2 answers
  • Select the correct answer.
    13·1 answer
  • What is the result when you run the following program?
    12·1 answer
  • Which is an example of synchronous communication?
    9·2 answers
  • True or false a computer with a high efficiency rating should stay cooler than one with a low effiency rating
    9·1 answer
  • Mention the generation we have in computer​
    7·1 answer
  • Who Likes K-pop? Which group or groups do you like
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!