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
lesya692 [45]
3 years ago
13

Write a program to create a list of numbers in the range of 1 to 10. Then delete all the even numbers from the list and print th

e final list.
Computers and Technology
1 answer:
Sever21 [200]3 years ago
6 0
>>> range (0,11,2)
[0, 2, 4, 6, 8, 10]
You might be interested in
Que son los sistemas de control con retroalimentacion
iren2701 [21]
Existen 2 clases comunes:
sistema de lazo abierto: la salida no efecto sobre el sistema
sistema de lazo cerrado: la toma de desiciones del sistema de la entrada si no también de la salida
5 0
3 years ago
First write a method to calculate the greatest common divisor (GCD) of two positive integers using Euclid’s algorithm (also know
MAVERICK [17]

Answer:

import java.util.Scanner;

public class Gcd

{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 System.out.print("Enter two numbers to find their GCD: ");

 int number1 = input.nextInt();

 int number2 = input.nextInt();

 

 if(number1 > 0 && number2 > 0)

     System.out.println("GCD of " + number1 +" and " + number2 +" is: " + findGCD(number1, number2));

       else

           System.out.println("Invalid Input!");

}  

public static int findGCD(int number1, int number2) {

    if(number2 == 0){

        return number1;

    }

return findGCD(number2, number1 % number2);

}

}

Explanation:

To be able to find GCD, we need to factorize the numbers and multiply common factors.

- <u>Inside the function:</u>

- Recursively divide <em>number1</em> by <em>number2</em> until <em>number2</em> is equal to zero.

- Return <em>number1</em>  when the <em>number2</em> is equal to zero. That means we found all the divisors of <em>number1</em>

- <u>Inside the main:</u>

- Ask user to input numbers

- Check if both numbers are greater than zero

- If they satisfy the condition, call the method and print the result.

7 0
3 years ago
TRUE OR FALSE:
Yuki888 [10]

Answer:

True

Explanation:

I just know the answer because I'm a genius hehe

3 0
2 years ago
In this lab, your task is to complete the following: Enable all of the necessary ports on each networking device that will allow
Sphinxa [80]

Answer:

enable the used ports in the router with their respective IP address and only the connected ports in the switch. Allow configure the STP on the switch

Explanation:

Network switches are used to connect a group of computer devices in a network LAN. It is automatically enabled when a port is connected and creates a MAC address table of the computers connected to it. STP or spanning-tree protocol is a protocol used to prevent looping in a switch. Unused ports can be disabled for security reasons.

A router is a network device that is used to forward packets between networks. All used ports in a router must be enabled and configured with an IP address and subnet mask.

5 0
3 years ago
What protects original and creative expression of an idea?
alukav5142 [94]
A patent grants the right to sell an invention and claim it as your own
6 0
3 years ago
Read 2 more answers
Other questions:
  • When looking through the documentation for a specific class, you never actually see the source code for that class. Instead, you
    6·1 answer
  • What is an example of asynchronous communication
    7·1 answer
  • 4
    10·1 answer
  • Chandra, a student working on a group project, is trying to decide how to have the whole group suggest revisions for an essay. S
    10·1 answer
  • Which of these expressions evaluates to 4.0?
    12·2 answers
  • If you turn on the Lock alpha button , what happens
    5·2 answers
  • Please help me answer this question
    14·1 answer
  • What are some best practices for file management
    8·1 answer
  • Cora is writing a program to make a motorcycle racing game. If Cora wants the speed of the motorcycle to appear on the screen wh
    5·2 answers
  • Rachelle is writing a program that needs to calculate the cube root of a number. She is not sure how to write the code for that
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!