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

Sample output with input: -9
-9 is negative

here is the code:
user_val = int(input())

cond_str = 'negative' if user_val < 0 else cond_str

print(user_val, 'is', cond_str)

Answers

Answer 1

Answer:

The modified program is as follows:

user_val = int(input())

cond_str = 'non-negative'  

if user_val < 0:

   cond_str = 'negative'  

print(user_val, 'is', cond_str)

Explanation:

This gets input for user_val

user_val = int(input())

This initializes cond_str to 'non-negative'

cond_str = 'non-negative'

If user_val is less than 0

if user_val < 0:

cond_str is updated to 'negative'

   cond_str = 'negative'  

This prints the required output

print(user_val, 'is', cond_str)


Related Questions

What is the meaning of negative impact in technology

Answers

Answer:

the use of criminal thought by the name of education

Which of the following examples can be solved with unsupervised learning?

Group of answer choices

A list of tweets to be classified based on their sentiment, the data has tweets associated with a positive or negative sentiment.

A spam recognition system that marks incoming emails as spam, the data has emails marked as spam and not spam.

Segmentation of students in ‘Technical Aspects of Big Data’ course based on activities they complete. The training data has no labels.

Answers

Answer:

Explanation:

Segmentation of students in ‘Technical Aspects of Big Data’ course based on activities they complete. The training data has no labels.

Of the following is a principle of total quality management?

A. Continuous defect elimination

B. Continuous process improvement

C. Continuous value enhancement

D. Continuous productivity improvement

Answers

Option b the continuous process improvement

Through the use of computational thinking techniques, models and algorithms can be created. A(n)

Answers

Answer:

1.) Model

2.) Algorithm

Explanation:

Using computational thinking, problems are represented or framed as model simulation on a computer. This computer generated model is a representation of the real world problem. This computer model gives a conceptualized idea of the problem. This will enable engineers and other involved stakeholders to work and solve this problem using this conceptualized model before coming up with the solution in the real world.

To create a model or other proffer computational solution, a defined sequence of steps is written for the computer to follow in other to solve a problem. This written sequential steps gives the instructions which the computer should follow during problem solving.

Answer:

Model, algorithm

Explanation:

got it right on the test

Any help , and thank you all

Answers

Answer:

There are 28 chocolate-covered peanuts in 1 ounce (oz). Jay bought a 62 oz. jar of chocolate-covered peanuts.

Problem:

audio

How many chocolate-covered peanuts were there in the jar that Jay bought?

Enter your answer in the box.

Explanation:

Caleb Co. owns a machine that had cost $42,400 with accumulated depreciation of $18,400. Caleb exchanges the machine for a newer model that has a market value of $52,000. 1. Record the exchange assuming Caleb paid $30,000 cash and the exchange has commercial substance. 2. Record the exchange assuming Caleb paid $22,000 cash and the exchange has commercial substance.

Answers

Answer: See explanation

Explanation:

1. Record the exchange assuming Caleb paid $30,000 cash and the exchange has commercial substance.

Dr Machine (new) $52000

Dr Loss on exchange of asset $2000

Dr Accumulated Depreciation $18400

Cr Equipment (Old) $42400

Cr Cash $30000

Nite that loss was calculated as:

= Market value of new machine - (Book value if old machine - Depreciation) - Cash paid

= $52000 - ($42400 - $18400) - $30000

= $52000 - $24000 - $30000

= -$2000

2. Record the exchange assuming Caleb paid $22,000 cash and the exchange has commercial substance

Dr Machine (new) $46000

Dr Accumulated Depreciation $18400

Cr Equipment (Old) $42400

Cr Cash $22000

Note that the value of the new machine was calculated as:

= Original cost + Cash paid - Accumulated Depreciation

= $42000 + $22000 - $18400

= $46000

whatis a node (or a device) that connects two different networks together and allows them to communicate.

Answers

Answer:

Router

Explanation:

A router can be defined as a network device that is designed typically for forwarding data packets between two or more networks based on a well-defined routing protocol.

Hence, a router is a node (or a device) that connects two different networks together and allows them to communicate.

Generally, routers are configured using a standard routing protocol with an IP address as the default gateway.

A routing protocol can be defined as a set of defined rules or algorithms used by routers to determine the communication paths unto which data should be exchanged between the source router and destination or host device.

Additionally, in order for packets to be sent to a remote destination, these three parameters must be configured on a host.

I. Default gateway

II. IP address

III. Subnet mask

After a router successfully determines the destination network, the router checks the routing table for the resulting destination network number. If a match is found, the interface associated with the network number receives the packets. Else, the default gateway configured is used. Also, If there is no default gateway, the packet is dropped.

use terms of interection model and norman model for ATM?

Answers

Answer:

ther you are

Explanation:

. HCI Technology Application in ATMHuman computer interface (HCI) is a term used todescribe the interaction between users and computer-s; in other words, the method by which a user tellsthe computer what to do, and the responses which thecomputer makes. Even more, HCI is about designingcomputer systems to support people’s use, so that theycan carry out their activities productively and safely.All of this can be summarized as ”to develop or im-prove the safety, utility, effectiveness, efficiency andusability of systems that include computers” [1].

MAKE ME BRAINLIEST PLEASE I NEED IT TO PASS AMBITIOS STAGE ON HERE THANKS

Internal monitoring is accomplished by inventorying network devices and channels, IT infrastructure and applications, and information security infrastructure elements. Group of answer choices True False

Answers

Answer:

True

Explanation:

It is TRUE that Internal monitoring is accomplished by inventorying network devices and channels, IT infrastructure and applications, and information security infrastructure elements.

The above statement is true because Internal Monitoring is a term used in defining the process of creating and disseminating the current situation of the organization’s networks, information systems, and information security defenses.

The process of Internal Monitoring involved recording and informing the company's personnel from top to bottom on the issue relating to the company's security, specifically on issues about system parts that deal with the external network.

which is not a characteristic of software:
A) virtual
B) application
C) physical
D) computer programs​

Answers

Answer:

C) physical

Explanation:

Virtual, Applications, and Computer Programs are all characteristics of software, except Physical.

1.               The smallest unit in a digital system is a​

Answers

Answer:

a bit

Explanation:

<3

JAVA CHALLENGE ZYBOOKs
ACTIVITY
2.18.3: Fixed range of random numbers.
Type two statements that use nextInt() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:
112 102
My Previous Incorrect Attempt :
import java.util.Scanner;
import java.util.Random;
public class RandomGenerateNumbers {
public static void main (String [] args) {
Random randGen = new Random();
int seedVal;
seedVal = 4;
randGen.setSeed(seedVal);
/* Your solution goes here */
int first = randGen.nextInt(10);
int second = randGen.nextInt(10);
System.out.println(first*seedVal*14);
System.out.println(second*seedVal*(51/4)+6);
}
}
MUST BE USED CODE TEMPLATE:
import java.util.Scanner;
import java.util.Random;
public class RandomGenerateNumbers {
public static void main (String [] args) {
Random randGen = new Random();
int seedVal;
seedVal = 4;
randGen.setSeed(seedVal);
/* Your solution goes here */
}
}

Answers

Answer:

Replace  /* Your solution goes here */ with:

System.out.println(randGen.nextInt(49) + 100);

System.out.println(randGen.nextInt(49) + 100);

Explanation:

Required

Statements to print two random numbers between 100 and 149 (both inclusive)

First, the random numbers must be generated. From the template given, the random object, randGen, has been created.

The syntax to then follow to generate between the interval is:

randGen.nextInt(high-low) + low;

Where:

high = 149 and low = 100

So, the statement becomes:

randGen.nextInt(149 - 100) + 100;

randGen.nextInt(49) + 100;

Lastly, print the statements:

System.out.println(randGen.nextInt(49) + 100);

System.out.println(randGen.nextInt(49) + 100);

Which of the following statements regarding the SAP Hana product implemented by Under Armour is NOT true?
A. All of the statements are true.
B. The program allows legacy silos to remain intact.
C. The program can run across platforms and devices.
D. The program provides real-time results.

Answers

Answer:A

Explanation:i need points

some machine/items/gadget having only hardware​

Answers

Yeh it’s becoz they work with hardware that’s why

Write an application that inputs a five digit integer (The number must be entered only as ONE input) and separates the number into its individual digits using MOD, and prints the digits separated from one another. Your code will do INPUT VALIDATION and warn the user to enter the correct number of digits and let the user run your code as many times as they want (LOOP). Submit two different versions: Using the Scanner class (file name: ScanP2)

Answers

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

 int n, num;

 Scanner input = new Scanner(System.in);

 System.out.print("Number of inputs: ");

 n = input.nextInt();

 LinkedList<Integer> myList = new LinkedList<Integer>();

 for(int i = 0; i<n;i++){

     System.out.print("Input Integer: ");

     num = input.nextInt();

     while (num > 0) {

     myList.push( num % 10 );

     num/=10;

     }

     while (!myList.isEmpty()) {

         System.out.print(myList.pop()+" ");

     }

     System.out.println();

     myList.clear();

 }

}

}

Explanation:

This declares the number of inputs (n) and each input (num) as integer

 int n, num;

 Scanner input = new Scanner(System.in);

Prompt for number of inputs

 System.out.print("Number of inputs: ");   n = input.nextInt();

The program uses linkedlist to store individual digits. This declares the linkedlist

 LinkedList<Integer> myList = new LinkedList<Integer>();

This iterates through n

 for(int i = 0; i<n;i++){

Prompt for input

     System.out.print("Input Integer: ");

This gets input for each iteration

     num = input.nextInt();

This while loop is repeated until the digits are completely split

     while (num > 0) {

This adds each digit to the linked list

     myList.push( num % 10 );

This gets the other digits

     num/=10;

     }

The inner while loop ends here

This iterates through the linked list

     while (!myList.isEmpty()) {

This pops out every element of thelist

         System.out.print(myList.pop()+" ");

     }

Print a new line

     System.out.println();

This clears the stack

     myList.clear();

 }

In this module you learned about advanced modularization techniques. You learned about the advantages of modularization and how proper modularization techniques can increase code organization and reuse.
Create the PYTHON program allowing the user to enter a value for one edge of a cube(A box-shaped solid object that has six identical square faces).
Prompt the user for the value. The value should be passed to the 1st and 3rd functions as arguments only.
There should be a function created for each calculation
One function should calculate the surface area of one side of the cube. The value calculated is returned to the calling statement and printed.
One function should calculate the surface area of the whole cube(You will pass the value returned from the previous function to this function) and the calculated value results printed.
One function should calculate the volume of the cube and print the results.
Make a working version of this program in PYTHON.

Answers

Answer:

Following are the code to the given question:

def getSAOneSide(edge):#defining a method that getSAOneSide that takes edge patameter

   return edge * edge#use return to calculate the edge value

def getSA(SA_one_side):#defining a method that getSA that takes SA_one_side patameter

   return 6 * SA_one_side#use return to calculate the SA_one_side value

def volume(edge):#defining a method that volume that takes edge patameter

   return edge * edge * edge#use return to calculate edge value

edge = int(input("Enter the length of edge of the cube:\n"))#defining edge variable that input value

SA_one_side = getSAOneSide(edge)#defining SA_one_side that holds getSAOneSide method value

print("Surface area of one side of the cube:", SA_one_side)

surfaceArea = getSA(SA_one_side)#defining a surfaceArea that holds getSA method value

print("Surface area of the cube:", surfaceArea)#print surfaceArea value

vol = volume(edge)#defining vol variable that holds Volume method value

print("Volume of the cube:", vol)#print vol Value

Output:

Please find the attached file.

Explanation:

In the code three method "getSAOneSide, getSA, and volume" method is declared that takes a variable in its parameters and use a return keyword that calculates and return its value.

In the next step,edge variable is declared that holds value from the user and defines three variable that holds method value and print its value with the message.

What does the abbreviation BBC stands for?

Answers

Answer:

British Broadcasting Corporation Microcomputer System

Explanation:

The British Broadcasting Corporation Microcomputer System, or BBC Micro, is a series of microcomputers and associated peripherals designed and built by the Acorn Computer company in the 1980s for the BBC Computer Literacy Project.

Answer:

British Broadcasting Corporation

Explanation:

This is a UK company which provides television and radio news in over 40 languages. This is the computer related meaning, there are other meanings to the abbreviation but they seem irrelevant in this case.

Hope this information was of any help to you. (:

Write a program that reads the balance and annual percentage interest rate and displays the interest for the next month. Python not JAVA

Answers

Answer:

Explanation:

The following code is written in Python. It asks the user to enter the current balance and the annual interest rate. It then calculates the monthly interest rate and uses that to detect the interest that will be earned for the next month. Finally, printing that to the screen. A test output can be seen in the attached picture below.

balance = int(input("Enter current Balance: "))

interest = int(input("Enter current annual interest %: "))

interest = (interest / 12) / 100

next_month_interest = balance * interest

print('$ ' + str(next_month_interest))

How do you find the average length of words in a sentence with Python?

Answers

Answer:

split() wordCount = len(words) # start with zero characters ch = 0 for word in words: # add up characters ch += len(word) avg = ch / wordCount if avg == 1: print "In the sentence ", s , ", the average word length is", avg, "letter." else: print "In the sentence ", s , ", the average word length is", avg, "letters.

Write a program that estimates how many years, months, weeks, days, and hours have gone by since Jan 1 1970 by calculations with the number of seconds that have passed.

Answers

Answer:

Explanation:

The following code is written in Java. It uses the LocalDate import to get the number of seconds since the epoch (Jan 1, 1970) and then uses the ChronoUnit import class to transform those seconds into years, months, weeks days, and hours. Finally, printing out each value separately to the console. The output of the code can be seen in the attached picture below.

import java.time.LocalDate;

import java.time.temporal.ChronoUnit;

class Brainly {

   public static void main(String[] args) {

       LocalDate now = LocalDate.now();

       LocalDate epoch = LocalDate.ofEpochDay(0);

       System.out.println("Time since Jan 1 1970");

       System.out.println("Years: " + ChronoUnit.YEARS.between(epoch, now));

       System.out.println("Months: " + ChronoUnit.MONTHS.between(epoch, now));

       System.out.println("Weeks: " + ChronoUnit.WEEKS.between(epoch, now));

       System.out.println("Days: " + ChronoUnit.DAYS.between(epoch, now));

       System.out.println("Hours: " + (ChronoUnit.DAYS.between(epoch, now) * 24));    

   }

}

Which of the following are incident priorities?

Answers

Answer:

what are the options?

reply in comment so i can help:)

As a CISO, you are responsible for developing an information security program based on using a supporting framework. Discuss what you see as some major components of an information security program.

Answers

Answer:

The CISO (Chief Information Security Officer) of an organization should understand the following components of an information security program:

1) Every organization needs a well-documented information security policy that will govern the activities of all persons involved with Information Technology.

2) The organization's assets must be classified and controlled with the best industry practices, procedures, and processes put in place to achieve the organization's IT objectives.

3) There should be proper security screening of all persons in the organization, all hardware infrastructure, and software programs for the organization and those brought in by staff.

4) Access to IT infrastructure must be controlled to ensure compliance with laid-down policies.

Explanation:

As the Chief Information Security Officer responsible for the information and data security of my organization, I will work to ensure that awareness is created of current and developing security threats at all times.  I will develop, procure, and install security architecture, including IT and network infrastructure with the best security features.  There will good management of persons' identity and controlled access to IT hardware.  Programs will be implemented to mitigate IT-related risks with due-diligence investigations, and smooth governance policies.

Unlike the collapse of Enron and WorldCom, TJX did not break any laws. It was simply not compliant with stated payment card processing guidelines.
a) true
b) false

Answers

I think the answer is A) true

The statement "Unlike the collapse of Enron and WorldCom, TJX did not break any laws. It was simply not compliant with stated payment card processing guidelines" is definitely true.

What was the cause of the TJX data breach?

The major cause of the TJX data breach was thought to be the hack that wasn't discovered until 2007, hackers had first gained access to the TJX network in 2005 through a WiFi connection at a retail store.

These situations were eventually able to install a sniffer program that could recognize and capture sensitive cardholder data as it was transmitted over the company's networks. They should be required to change the encryption methodology of the data they are using to save the personal identification information of their customers.

Therefore, the statement "Unlike the collapse of Enron and WorldCom, TJX did not break any laws. It was simply not compliant with stated payment card processing guidelines" is definitely true.

To learn more about, TJX data, refer to the link:

https://brainly.com/question/22516325

#SPJ2

By comparing the time out mechanism used in TCP to that used in a data link layer protocol, outline why it is necessary for the TCP timeout mechanism to implement an adaptive timeout duration

Answers

Answer:

When there are network flows within the wireless link that experience prolonged poor transmission it can impact on the network, leading to the stalling of the source while waiting for the arrival of ACKS, due to the filling of the TCP source congestion window. More time is lost as the source waits for a timeout to be caused by the expiration of the RTO timer which results in lower efficiency and network throughput by the TCP that requires an adaptive timeout duration to be implemented

Explanation:

Write a program whose input is two integers. Output the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. Ex: If the input is: - 15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last. 5.17 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. Ex: If the input is: Hello there Hey done then the output is: ereht olleh уен 275344.1613222

Answers

Answer:

Following are the code to the given question:

For code 1:

start = int(input())#defining a start variable that takes input from the user end

end = int(input())#defining a end variable that takes input from the user end

if start > end:#use if that checks start value greater than end value

   print("Second integer can't be less than the first.")#print message

else:#defining else block

   while start <= end:#defining a while loop that checks start value less than equal to end value

       print(start, end=' ')#print input value

       start += 5#incrementing the start value by 5

   print()#use print for space

For code 2:

while True:#defining a while loop that runs when its true

   data = input()#defining a data variable that inputs values

   if data == 'Done' or data == 'done' or data == 'd':#defining if block that checks data value

       break#use break keyword

   rev = ''#defining a string variable rev

   for ch in data:#defining a for loop that adds value in string variable  

       rev = ch + rev#adding value in rev variable

   print(rev)#print rev value

Explanation:

In the first code two-variable "first and end" is declared that takes input from the user end. After inputting the value if a block is used that checks start value greater than end value and use the print method that prints message.

In the else block a while loop is declared that checks start value less than equal to end value and inside the loop it prints input value and increments the start value by 5.

In the second code, a while loop runs when it's true and defines a data variable that inputs values. In the if block is used that checks data value and use break keyword.

In the next step, "rev" as a string variable is declared that uses the for loop that adds value in its variable and prints its values.

which function would ask excel to average the values contained in cells C5,C6,C7, and C8

Answers

Answer:

=AVERAGE(C5:C8)

Explanation:

The function calculates the average of the values in the cell range C5:C8 - C5, C6, C7, C8.

move down one screen​

Answers

Answer:

k(kkkkkkkkkkklkkkkkkkkkk(

okay , I will


step by step explanation:

Write a function:
class Solution { public int solution (int) A); }
that, given a zero-indexed array A consisting of N integers representing the initial test scores of a row of students, returns an array of integers representing their final test scores in the same order).
There is a group of students sat next to each other in a row. Each day, students study together and take a test at the end of the day. Test scores for a given student can only change once per day as follows:
• If a student sits immediately between two students with better scores, that student's score will improve by 1 when they take the test.
• If a student sits between two students with worse scores, that student's test score will decrease by 1.
This process will repeat each day as long as at least one student keeps changing their score. Note that the first and last student in the row never change their scores as they never sit between two students.
Return an array representing the final test scores for each student once their scores fully stop changing. Test Ou
Example 1:
Input: (1,6,3,4,3,5]
Returns: (1,4,4,4,4,5]
On the first day, the second student's score will decrease, the third student's score will increase, the fourth student's score will decrease by 1 and the fifth student's score will increase by 1, i.e. (1,5,4,3,4,5). On the second day, the second student's score will decrease again and the fourth student's score will increase, i.e. (1,4,4,4,4,5). There will be no more changes in scores after that.

Answers

Answer:

what are the choices

:"

Explanation:

How could you use your technology skill and Microsoft Excel to organize, analyze, and compare data to decide if a specific insurance is a good value for the example you gave

Answers

Answer:

The summary of the given question would be summarized throughout the below segment.

Explanation:

"Insurance firms voluntarily assume our charge probability," implies assurance undertakings will compensate including all our devastations throughout respect of products for something we have health coverage and that the vulnerability for both would be equivalent.If somehow the client receives significant losses, the firm must compensate that kind of money as well as, if there are no failures, it can invest earnings or rather an investment.

TP1. लेखा अभिलेखको अर्थ उल्लेख गर्नुहोस् । (State the mea
TP2. लेखाविधिलाई परिभाषित गर्नुहोस् । (Define accounting.
TP 3. लेखाविधिको कुनै तीन महत्वपूर्ण उद्देश्यहरू लेख्नुहोस्
accounting.)​

Answers

Explanation:

TP1. लेखा अभिलेख भनेको ज्ञानको त्यस्तो शाखा हो, जुन व्यवसायको आर्थिक कारोबारहरूलाई नियमित, सु-व्यवस्थित र क्रमबद तरिकाले विभिन्न पुस्तिकाहरूमा अभिलेख गर्ने कार्यसँग सम्बन्धित छ।

Other Questions
Answer in 6 min plz .............. What is the MEDIAN or Q2 of the data set: 24, 25, 29, 30, 31, 31, 32, 34, 34? The cross elasticity of demand for good X with respect to the price of good Y is 3, the price of goodIf Y increases by 2%, how does quantity demanded change?describe how to do it What are the three things the plant needs in order to do photosynthesis?A. sunlight, oxygen, and carbon dioxideB. sunlight, carbon dioxide, and waterC. sunlight, oxygen, and water Because there isn't one single measure of inflation, the government and researchers use a variety of methods to get the most balanced picture of how prices fluctuate in the economy. Two of the most commonly used price indexes are the consumer price index (CPI) and the GDP deflator. The GDP price index for this year is calculated by dividing the ______________using __________ by the_____________ using _______________ and multiplying by 100. Indicate whether each scenario will affect the GDP deflator or the CPI for the United States.a. A decrease in the price of a Waterman Industries deep-water reel, which is a commercial fishing product used for deep-sea fishing b. An increase in the price of a Japanese-made television that is popular among U.S. consumers Solve for y.3= y+7 divided by 3 Y= Complete the following equations (note that the equations are not balanced). Use the actnecessary03Li > K> Ba > Sr> Ca > Na > Mg > Al > Mn > Zn > Cr> Fe > Cd >Co > Ni > Sn > Pb > H > Sb> Bi > Cu > Ag > Pd > Hg > Pt > AuK1+Pb(NO3)2 ?O KNO3 + Pbl2O KNO3 + PblOKNI + PbO2 answer as fast as posible 5(x+y)-3(x-y) A. 2x B. 2x+2y C. 2x+8y D. 8x+8y ANSWER ASAP!! Use the substitution method to solve the system of equations. 3x+7y=1 and y=x-7 )Which statement best describes the area of the triangle shown below?A coordinate grid is shown with a triangle.. The base is 4 units, and the height is 4 units. It is one-half the area of a rectangle of length 4 units and width 2 units. It is one-half the area of a square of side length 4 units. It is twice the area of a rectangle of length 4 units and width 2 units. It is twice the area of a square of side length 4 units. i need help please help estion 2 OT 10What could a human living now and a horse living thousands of years agohave in common?A. They have the exact same DNA.B. They need the same amount of energy to survive.C. They both get their energy directly from the sun.D. They are made of some of the same matter. Can anyone help me out Can somone help me solve this analyze the effects of price ceilings and price floors How do I solve a system of equations algebraically with a substitution method and then write it as a coordinate point?y = 3x -17 and y = -2x + 8 please helpppppi am v stuck which of the following is the correct graph of the linear equation below? y+2=1/5(x+1) A police officer orders an unarmed person running away from a burglary to stop. The suspect keeps running and is shot and killed by the officer. Has the officer committed a crime? Explain