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
vlabodo [156]
3 years ago
6

Write a function where you are given: a list of numbers "nums", a number to search for "num". Return the index of "num" in the l

ist "nums". If "num" is not found in the list, return -1 instead.
Computers and Technology
1 answer:
ASHA 777 [7]3 years ago
6 0

The program is an illustration of functions; functions are used to represent collection of named statements

<h3>The program in Python</h3>

The function in Python where comments are used to explain each line is as follows:

#This defines the function

def checkList(nums,num):

   #This checks if num exists in nums

   if num in nums:

       #If yes, this returns the index of num

       return nums.index(num)

   #If otherwise, this returns -1

   return -1

Read more about Python programs at:

brainly.com/question/26497128

#SPJ1

You might be interested in
Suppose that you are given the following partial data segment, which starts at address 0x0700 : .data idArray DWORD 1800, 1719,
Digiron [165]

Answer:

The value EAX contain after the code has been executed is 1233

Explanation:

Solution

Now,

The below instruction describes the MOV operation.

The MOV esi, OFFSET idArray .

It shows the movement, the offset value of the idArray in the esi.

Thus,

Follow the below instruction

MOV eax, [esi+7*TYPE idArray]

It will move the address of the idArray at that position into eax.

Value at the 7th position is moved to eax.

Therefore, the value at eax will be 1233.

5 0
4 years ago
Check the devices that are external peripheral devices:
irina [24]

Answer:

Mouse, and keyboard

Explanation:

Common Sense

6 0
3 years ago
Effective nonverbal communication can cause tension.<br><br> True or False
agasfer [191]

Explanation:

When your nonverbal signals match up with the words you're saying, they increase trust, clarity, and rapport. When they don't, they can generate tension, mistrust, and confusion.

4 0
3 years ago
There are several different types of RAM, each with its own purpose. Name the three types of RAM and briefly describe their func
Neko [114]
Well we have SRAM(Static Random Access Memory) is faster, have a lower density but it is more expensive.
While DRAM(Dynamic Random access memory) is just the opposite.
Those are the only two, I know exist.
3 0
4 years ago
Read 2 more answers
In the HTML for a three-column layout, an aside, a main element, and another aside are coded within a body element. Then, to use
liberstina [14]

Answer:

c. float the both asides and the main content to the left.

Explanation:

The float CSS property decides the positioning of an element in its container, the float CSS property allows you to put block-level elements beside each other instead of on top of each other. The float: left; property allows you to float the element to the left of its container.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which model is the oldest and most common technique of differentiating information systems?
    8·2 answers
  • Which Command Prompt commands in Windows is used for listing a computer connections to shared resources
    10·1 answer
  • The ____ contains all data definitions for a database, including table structures, security information, relationships between t
    11·1 answer
  • When adapting graphs for slides,
    6·1 answer
  • "The study of how changes in the input parameters of a linear programming problem affect the optimal solution is known as
    8·1 answer
  • Your manager has requested you keep a timesheet showing how many hours you work each day and what projects you work on during th
    13·2 answers
  • Write a program that reads a list of integers into a vector, and outputs the two smallest integers in the list, in ascending ord
    5·1 answer
  • Hello! I hope you have a great day! Good things will come your way.
    12·1 answer
  • Yahoo Messenger is an example of a/an __________ service on the Internet.
    5·2 answers
  • Which adaptation of eap utilizes eap-mschapv2 inside of an encrypted tls tunnel?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!