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
liberstina [14]
3 years ago
5

Python

Computers and Technology
1 answer:
xeze [42]3 years ago
3 0

Answer:

Following are the function to the Python Programming Language.

#define a function to read or crates the list

def GetUserValues():

 my_list=[]

 n=int(input("Enter range: "))

 for i in range(n):

   my_list.append(int(input(" :")))

 return my_list

#define a function to check the elements of the list

def IsListEven(mylist):

 #set the for loop

 for i in range(len(mylist)):

   #set if condition to check odd number

   if mylist[i]%2 !=0:

     #if condition is true retun false

     return False

 #otherwise return true

 return True

#define a function to check the elements of the list

def IsListOdd(mylist):

 #set the for loop

 for i in range(len(mylist)):

   #set if condition to check even number

   if mylist[i]%2==0:

     #if condition is true retun false

     return False

 #otherwise return true

 return True

#set variable to store list

l=GetUserValues()

#set if condition to check the function is true

if IsListOdd(l)==True:

 #then, print the message

 print("all odd")

#set elif condition to check the function is true

elif IsListEven(l)==True:

 #then, print the message

 print("all Even")

else:

 #otherwise print message.

 print("not even or odd")

<u>Output:</u>

Enter range: 5

:2

:4

:6

:8

:10

all Even

Explanation:

Here, we define a function "GetUserValues()" and inside the function.

  • Set the list data type variable "my_list" then, get input from the user in the variable "n".
  • Set the for loop which starts from 0 and end at the variable "n" then, get input from the user and appends inputs in the variable "my_list".
  • Then, we return list and close the function.

Then, we set a function "IsListEven()" and pass an argument "mylist" to check the elements is even or not, if the list elements is even then, return true otherwise, return false.

Then, we set a function "IsListOdd()" and pass an argument "mylist" to check the elements is odd or not, if the list elements is odd then, return true otherwise, return false.

Finally, we call and store the function in the variable "l" then, set conditions to check the list is even print "all even", if the is odd "all odd" otherwise, print "not even or odd".

You might be interested in
Suppose a computer can execute 1 billion instructions/sec and that a system call takes 1000 instructions, including the trap and
Genrish500 [490]

Answer:

System calls = 500000

Explanation:

Instructions that a computer can execute = 1 billion instructions/sec

Instructions that a system call takes including the trap and context switching = 1000 instructions

When half of the CPU time is on application, n system calls can be executed in 1 second.

Therefore we'll get an equation as following.

1000 * n = 0.5 * 1000000000

n = 0.5 * 1000000000 / 1000

n = 500000

System calls = 500000

3 0
3 years ago
Which extension is appropriate for Word document templates?
Ronch [10]

Answer:

<em><u>DOCX pretty sure</u></em>

<em><u /></em>

<em><u>hope that this helps :)</u></em>

<em></em>

5 0
3 years ago
Read 2 more answers
PLS HELP) Early word processors ran on devices that looked like digital _______?
stealth61 [152]
I looked it up it just says true
8 0
3 years ago
Read 2 more answers
A device that is connected to the Internet is known as<br> a. Nexus. Backbone. Node. Link.
ikadub [295]
A device connected to the internet is known as a Node.
3 0
3 years ago
Read 2 more answers
Lori wants to set up a SOHO network in her apartment. The apartment comes with a Gigabit Ethernet network already installed. Lor
Yanka [14]

Connection to the gigabit ethernet network must be done with Cat6 Cable. Using the wireless ethernet router as the network device and connecting the cable to the printer must be done with Cat5e Cable.

We can arrive at this answer because:

  • The Cat6 Cable will be responsible for establishing a bridge between the gigabyte Ethernet and the network device, allowing data delivery to be made between the two systems.
  • This connection must be made with a wireless device, to keep it more stabilized and it needs, mainly, for the notebook to receive the internet signal. This will be done using the wireless ethernet router.
  • The printer needs a softer, less rigid connection, so a Cat5e cable will be a convenient option.

In this case, we can see that using these devices will allow Lori to have a more stable and efficient connection to meet her needs.

More information on network connection at the link:

brainly.com/question/8118353

5 0
2 years ago
Read 2 more answers
Other questions:
  • By default, windows does not display ____________________ in windows explorer.
    8·1 answer
  • Can anyone find any words in here?
    14·2 answers
  • Write a calculator program that keeps track of a subtotal like real calculators do. Start by asking the user for an initial numb
    12·1 answer
  • What is key for evaluating internal controls such as human resources, logistics, information technology, risk, legal, marketing
    11·1 answer
  • What is the computer that is similar to a destop but smaller in size
    8·1 answer
  • In terms of CPU scheduling metrics, __________ is the time at which the job completes minus the time at which the job arrived in
    10·1 answer
  • EASY POINTS what favorate food<br> so easy
    7·2 answers
  • Always follow the routine "clean up while in use and clean up before keeping it".
    6·1 answer
  • Write a program that calculates the average of N integers. The program should prompt the
    12·1 answer
  • How to install an older version of prettier on yarn
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!