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
Likurg_2 [28]
3 years ago
9

4.2 Code Practice: Question 1 Can someone help me write the code in python language?

Computers and Technology
1 answer:
alekssr [168]3 years ago
8 0

Answer:

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

sum = number

c = 1

while (sum<=100):

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

   sum = sum + number

   c = c + 1

print("Sum: " + str(sum))

print("Numbers Entered: " + str(c))

Explanation:

Hope this helps lovely :)

You might be interested in
Persons who have been given access to an installation can be counted on to be of no threat. true or false? (antiterrorism scenar
aliya0001 [1]
<span>The statement that "Persons who have been given access to an installation can be counted on to be of no threat" is false. If they are not honest enough, they could become the dangerous staff the company could ever had because he or she has access to everything, files, information, etc. That is why, in selecting a person to be trusted with such responsibility, he or she undergoes an intensive training.</span>
4 0
3 years ago
Given four inputs: a, b, c &amp; d, where (a, b) represents a 2-bit unsigned binary number X; and (c, d) represents a 2-bit unsi
Amiraneli [1.4K]

Answer:

z = a.c' + a.b.d' + b.c'.d'

Explanation:

The truth table for this question is provided in the attachment to this question.

N.B - a' = not a!

The rows with output of 1 come from the following relations: 01 > 00, 10 > 00, 10 > 01, 11 > 00, 11 > 01, 11 > 10

This means that the Boolean expression is a sum of all the rows with output of 1.

z = a'bc'd' + ab'c'd' + ab'c'd + abc'd' + abc'd + abcd'

On simplification,

z = bc'd' + ab'c' + ac'd' + ac'd + abc' + abd'

z = ac' + abd' + bc'd'

Hope this helps!

6 0
3 years ago
What is a way to minimize technical problems with your computer
Gala2k [10]
Buy or get new software that protects ur pc, such as a "fixmestix" or just download new software or use a disc 
4 0
3 years ago
Write a SQL statement to display the WarehouseID, the sum of Quantity On Order, and the sum of QuantityOnHand, grouped by Wareho
mariarad [96]

Answer:

The corrected question is:

Write an SQL statement to display the WarehouseID, the sum of QuantityOnOrder and sum of QuantityOnHand, grouped by WarehouseID and QuantityOnOrder. Name the sum of QuantityOnOrder as TotalItemsOnOrder and the sum of QuantityOnHand as TotalItemsOnHand. Use only the INVENTORY table in your SQL statement.

Answer to this corrected question:

SELECT WarehouseID,

SUM(QuantityOnOrder) AS TotalItemsOnOrder,

SUM(QuantityOnHand) AS TotalItemsOnHand

FROM INVENTORY

GROUP BY WarehouseID, QuantityOnOrder;

According to the given question:

SELECT WarehouseID,

SUM(QuantityOnOrder) + SUM(QuantityOnHand) AS TotalItemsOnHand    

FROM INVENTORY

GROUP BY WarehouseID, QuantityOnOrder;

Explanation:

  • In the SQL statement SELECT statement is used to select the data from the table. Here the SELECT statement is used to select WarehouseID, Sum of the columns QuantityOnOrder and QuantityOnHand from INVENTORY table.
  • The sum of QuantityOnOrder and QuantityOnHand columns are given the name of TotalItemsonHand (In case of the corrected question the sum of column QuantityOnOrder is named as TotalItemsOnOrder and the column QuantityOnHand is named as TotalItemsOnHand ) using Alias AS. Alias is the temporary name given to the columns or table to make them  more readable.
  • GROUP BY statement is used to arrange or "group" same data and is often use with aggregate functions like SUM function here. So the grouping here is done based on two columns WarehouseID and QuantityOnOrder.
  • SUM function in this SQL statement is an aggregate function to calculate the sum of all value in the columns QuantityOnOrder and QuantityOnHand.
3 0
3 years ago
A lot of computations involve processing a string one character at a time. Often they start
dedylja [7]

Answer:

The last character in the string processed is "t".

Explanation:

The index start from 0 and the len(fruit) is 5.

When index is 0 which is less than 5; "f" is printed

When index is 1 which is less than 5; "r" is printed

When index is 2 which is less than 5; "u" is printed

When index is 3 which is less than 5; "i" is printed

When index is 4 which is less than 5; "t" is printed

When index is 5, the condition is false; so the loop content is not executed.

Therefore, the last character traversed in the string "fruit" is "t".

3 0
3 years ago
Other questions:
  • The illustrations group contains all but a _______​
    9·1 answer
  • If you were given a 3D microscope to use for photography, which object(s) would you most want to photograph?
    10·2 answers
  • What may happen if a large number of computer users are attempting to access a web site at the same time that you are
    9·2 answers
  • Search engines enable you to
    9·2 answers
  • You can tell a cell is the active cell when it has a
    14·2 answers
  • what would be the address of the cell, which is intersect of the second row and third column in a worksheet
    8·2 answers
  • What does a page break do?
    13·1 answer
  • Why is local hosting not suitable for a public website?
    15·1 answer
  • Select the correct answer.
    7·2 answers
  • Consider the following method.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!