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
pochemuha
3 years ago
8

PYTHON

Computers and Technology
1 answer:
Nina [5.8K]3 years ago
4 0

Answer:

This is one of the efficient ways to find the number of occurrences of a given number in a list:

<h3><u>def find_num(arr,n):</u></h3><h3><u>    return len([count for count in arr if count == n])</u></h3><h3><u>print(find_num([0,1,1,1,0],1))</u></h3>

If you want a simpler version, you can try this:

<h2><u>def find_num(arr,n):</u></h2><h2><u>    count = 0 </u></h2><h2><u>    for i in range(len(arr)): </u></h2><h2><u>        if arr[i]==n: </u></h2><h2><u>            count += 1 </u></h2><h2><u>    return count</u></h2><h2><u>print(find_num([0,1,1,1,0],1))</u></h2>

This is the simplest method:

<h2><u>arr = [0,1,1,1,0]</u></h2><h2><u>print(arr.count(1))</u></h2>

I think I gave you enough examples. This should get you started off easily.

If you need an explanation, I am happy to help you. BTW I started python 6 months back so even I am pretty new to this.

You might be interested in
EIPP:________.
nikdorinn [45]

Answer:

D. All of these choices are correct

Explanation:

Electronic invoice presentment and payment, otherwise known as EIPP are business-to-business systems that combine e-invoicing and e-payment processes for the purpose of sending invoices to customers via Web portal or via a secure network by the use of a third party service provider. They are also used for receiving payer-initiated, third-party-processed, and ACH-network-settled wire transfers.

4 0
4 years ago
Read 2 more answers
Write a C++ program that will ask the user for the name of a data file.
rosijanka [135]

Answer:

Explanation:

Enter information,

Enter name: Bill

Enter roll number: 4

Enter marks: 55.6

Displaying Information,

Name: Bill

Roll: 4

Marks: 55.6

THIS IS AN EXAMPLE I HOPE THIS HELPS YOU!!

4 0
3 years ago
To insert a footnote in a document, a user would navigate to the _____ tab.
Pachacha [2.7K]

Answer

References tab.

Explanation

In MS word documents, you can add footnotes and endnotes by;

• Clicking the area to add a footnote

• Clicking references, then insert Footnote. The word program will insert a reference mark in the text and will add the footnote mark at the bottom of the page

• Type a footnote text.

Hope this Helps!

3 0
3 years ago
Read 2 more answers
Define a method named roleOf that takes the name of an actor as an argument and returns that actor's role. If the actor is not i
dusya [7]

Answer:

var movie = {

   // Code will be tested with different actors and movies

   name: "Interstellar",

   director: "Christopher Nolan",

   composer: "Hans Zimmer",

   cast: {

       "Matthew McConaughey": "Cooper",

       "Anne Hathaway": "Brand",

       "Jessica Chastain": "Murph",

       "Matt Damon": "Mann",

       "Mackenzie Foy": "Young Murph"

   },

   roleOf: function (actorName) {

       if (!(actorName in this.cast)) {

           return "Not in this movie.";

       }

       return this.cast[actorName];

   }

};

Explanation:

4 0
3 years ago
On the Loan worksheet in cell c9 enter PMT function to calculate the monthly payment for the Altamonte springs 2018 facilities l
Delicious77 [7]

Answer and Explanation:

First of all we should have to know about PMT

PMT

stands for payment .payment that you want to send and receive.It is used in financial calculators and equation. It is a payment that return the periodic payment for a loan.

From the given statement we have to calculate the PMT  for this purpose .

let us consider example where we take loan amount and have some interest and then calculate it.

loan of amount = $6000.00

Interest rate = 4.20%

period per year=15

period = 60

then monthly payment = $ 111.40

Using Excel then we get the monthly payment in cell C9

as calculations has been shown in the excel.

where you can get function who returns a positive value.

6 0
3 years ago
Other questions:
  • The compare_strings function is supposed to compare just the alphanumeric content of two strings, ignoring upper vs lower case a
    15·1 answer
  • Decrypt the message OPEHHISTLWILKWPR which is the cyphertext produced by encrypting a plaintext message using the transposition
    14·1 answer
  • What is the subjects under artificial intelligence ?​
    15·1 answer
  • He has a new Wi-Fi router that connects wirelessly to a new desktop and two new laptops, in addition to multiple smartphones, ta
    8·1 answer
  • Research different ways that 3D printing is used in society. Tell us about the items that are 3D printed.
    8·2 answers
  • Now let's create a memo. The memo should include all parts of a memo, and these parts should appear in the correct order. In you
    9·1 answer
  • In most programming languages, the compiler carries a preprocessing step to determine if certain statements will compile. For in
    7·1 answer
  • Assume a TCP sender is continuously sending 1,090-byte segments. If a TCP receiver advertises a window size of 5,718 bytes, and
    7·1 answer
  • Plz help, I need help, I appreciate people to anwser and I mark you brainlist promise​
    5·1 answer
  • Who invented Satellites? What purpose does it serve? How has it impacted society today?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!