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
Vera_Pavlovna [14]
2 years ago
3

Write a program that first reads a list of 5 integers from input. then, read another value from the input, and output all intege

rs less than or equal to that last value
Computers and Technology
1 answer:
4vir4ik [10]2 years ago
3 0

Answer:

<em>integers = [int(i) for i in input().split()]</em>

<em>value = int(input())</em>

<em>for integer in integers:</em>

<em>--if integer <= value:</em>

<em>----print(integer)</em>

Explanation:

We first read the five integers in a string. We can use the <em>.split() </em>method, which splits the string into separate parts on each space.

For example:

<em>print(input())</em>

<em>>> "4 -5 2 3 12"</em>

<em>print(input().split())</em>

<em>>> ["4", "-5", "2", "3", "12"]</em>

We cannot work with these numbers if they are strings, so we can turn them into integers using the <em>int </em>constructor. An easy way to do this is with list comprehension.

<em>print([int(i) for i in input().split()]</em>

<em>>> [4, -5, 2, 3, 12]</em>

Now that all the values in the list are integers, we can use a for loop to get each of the values and check whether they are less than or equal to the <em>value</em>.

Let's first get the <em>value </em>from the input.

<em>integers = [int(i) for i in input().split()]</em>

<em>value = int(input())</em>

<em>print(value)</em>

<em>>> 4</em>

Here, we have to pass the input through the <em>int </em>constructor to be able to compare it with the other integers. Let's now make a for loop to go through each integer and check if the integer is less than or equal to <em>value.</em>

<em>for integer in integers:</em>

<em>--if integer <= value:</em>

<em>----print(integer)</em>

The dashes are there to show indentation and are not part of the code.

You might be interested in
Identify the tips to create a well-designed digital portfolio.
Levart [38]

Answer:

B. She created a person website with a unique URL for her online portfolio

Explanation:

8 0
3 years ago
TO Cloud
scoray [572]

The type of situation would it make sense to use edge computing is   where critical decisions must be made on a split-second basis.

<h3>What is edge computing?</h3>

Edge computing is known to be a kind of computing which often occur on site or near a specific data source, it reduces the need for data to be processed in a distance data center.

Note that The type of scenario  that would it make sense to use edge computing is  when critical decisions must be made on a split-second basis as it requires urgency.

Learn more about edge computing from

brainly.com/question/23858023

7 0
2 years ago
a value-returning method must specify as its return type in the method header. question 18 options: a) an int b) a double c) a b
Olenka [21]

An int must be specified in the method header as the return type for a value-returning method

<h3>What is an int?</h3>

A whole number that can be positive, negative, or zero is called an integer. It is not a fraction. -5, 1, 5, 8, 97, and 3, 043 are some examples of integers. 1.43, 1 3/4, and 3.14 are a few examples of numbers that are not integers.

The compiler includes a fundamental variable type called int, which stands for "integer" and is used to define numeric variables that carry entire integers. Float and double are additional data types.

A basic data type is the Java int keyword. Declaring variables is done using it. Additionally, it can be used with methods that return values of the integer type. It is capable of storing a 32-bit signed, two's complement integer. In the Internet's Domain Name System, the domain name int is a sponsored top-level domain.

To learn more about an int refer to:

brainly.com/question/27415982

#SPJ4

5 0
1 year ago
The default user of your phpmyadmin
Ghella [55]

Answer:

d. root

Explanation:

phpMyAdmin is a web application used to administer and manage MySQL database instances. It can also be used for querying a table/tables in the database using SQL. phpMyAdmin comes pre-configured with a default user 'root' with no password. From a security standpoint, a password can be assigned for root user after first login. Other userids can also be created for effective database administration.

7 0
4 years ago
If you had to choose, would you consider yourself more of an internet celebrant or a skeptic? On balance, do you think the inter
vitfil [10]

Answer:

i`m more a celebrant

Explanation:

3 0
3 years ago
Other questions:
  • David has a laptop that is having a problem with the video system. You believe the problem might be the backlight. During your r
    13·1 answer
  • Samantha was calculating a mathematical formula on an electronic spreadsheet. She used multiple values to recalculate the formul
    7·2 answers
  • Research information technology affects on job market, career pathways, occupational outlooks in business and finance and synthe
    7·1 answer
  • Select the answers that best describe showing respect for confidential data. Check all of the boxes that
    10·1 answer
  • On a piano, each key has a frequency, and each subsequent key (black or white) is a known amount higher. Ex: The A key above mid
    14·1 answer
  • Write a recursive function, displayFiles, that expects a pathname as an argument. The path name can be either the name of a file
    6·1 answer
  • Create a dictionary that will hold AT LEAST 3 categories for food with at least 3 foods for each category. E.g. Fruits --&gt; Ap
    6·1 answer
  • Jenny, a programmer, uses Microsoft Excel 2016 to generate data required for the programs she develops. She uses various functio
    10·1 answer
  • Python problem: The program needs to output the numbers 1 to 9, each on a separate line, followed by a dot:
    7·1 answer
  • Fill in the missing terms relating to computer software
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!