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
Ratling [72]
2 years ago
15

Write a program for determining if a year is a leap year. In the Gregorian calendar system you can check if it is a leaper if it

is divisible by 4 but not by 100 unless it is also divisible by 400.
Computers and Technology
1 answer:
SOVA2 [1]2 years ago
8 0

Answer:

def leap_year_check(year):

return if int(year) % 4 == 0 and (int(year) % 100 != 0 or int(year) % 400 == 0)

Explanation:

The function is named leap_year_check and takes in an argument which is the year which we wish to determine if it's a new year or not.

int ensures the argument is read as an integer and not a float.

The % obtains the value of the remainder after a division exercise. A remainder of 0 means number is divisible by the quotient and a remainder other wise means it is not divisible by the quotient.

If the conditions is met, that is, (the first condition is true and either the second or Third condition is true)

the function leap_year_check returns a boolean ; true and false if otherwise.

You might be interested in
You have to communicate a signal in a language that has 3 symbols A, B and C. The probability of observing A is 50% while that o
Vlada [557]

Answer:

Huffman code is use for encoding the language. The entropy when calculated is 1.5.

Explanation:

Using Huffman Coding scheme to encode:

The huffman coding scheme is described in the attachment.

To find entropy; we use the formula given below:

H = ∑p log_{2}  \frac{1}{p}

where H = Entropy and p = probability

p(A) = 50% = 1/2

p(B) = 25% = 1/4

p(C) = 25% = 1/4

H = \frac{1}{2} log_{2} 2 + \frac{1}{4}  log_{2} 4+ \frac{1}{4} log_{2}4\\H = \frac{1}{2}(1) + \frac{1}{4}(2) + \frac{1}{4}(2)\\H = \frac{1}{2} + \frac{2}{4} + \frac{2}{4}\\H = \frac{1}{2} + \frac{1}{2} + \frac{1}{2}\\H = \frac{3}{2}\\H = 1.5

Download pdf
7 0
3 years ago
Quick!!!!!
Vlad [161]

Answer:

B. the current affairs page

Explanation:

it's a simple question

8 0
3 years ago
Read 2 more answers
To make a profit the price of the items sold in the furniture store are marked up by 80 %after marking up the prices each item i
Verdich [7]

Answer:

The algorithm is as follows:

1. Start

2. Display "Input Item Price: "

3. Input Price

4. Markup = Price + 80% * Price

5. Selling_Price = 10% * Markup

6. Display "The Selling Price is "+Selling_Price

7. Stop

Explanation:

This signals the beginning of the algorithm

1. Start

This is a prompt that asks for the price of the item

2. Display "Input Item Price: "

This gets the price of the item

3. Input Price

This calculates the Markup (80% of the inputted price)

4. Markup = Price + 80% * Price

This calculates the selling price (10% of the markup)

5. Selling_Price = 10% * Markup

This prints the selling price

6. Display "The Selling Price is "+Selling_Price

This signals the end of the algorithm

7. Stop

7 0
2 years ago
Pls awnser if awnser is wrong I will unmark brainliest
choli [55]

Answer: i think 1, 3, and 4

Explanation:

3 0
3 years ago
Which bus slot provides the highest video performance​
Sphinxa [80]

Answer: PCI, The PCI provides the highest performance

4 0
3 years ago
Other questions:
  • Want is the assignmment
    8·1 answer
  • If a driving who is under the age of 21 is stopping by a law enforcement officer and shown to here a bal of .02 or greater, he o
    14·1 answer
  • Digital cameras always create great photographs. <br>True <br>False
    14·2 answers
  • Fill in the blank: _________ is Google’s machine-learning artificial intelligence system that interprets people’s searches to fi
    9·1 answer
  • Question 21 pts How many lines should an email signature be? Group of answer choices "5 to 6" "7 to 8" "1 to 2" "3 to 4"
    10·1 answer
  • What sort of query is (strbucks]?
    14·1 answer
  • What is one way object-oriented programming differs from procedural programming?
    15·1 answer
  • What Does The Computer Monitor Contain?
    8·1 answer
  • Select one Layer 2 or wireless WAN technology presented in Lesson 3. Elaborate on its characteristics, pros and cons, and common
    13·1 answer
  • find_cow(name, cows) Given a name and a Python list of Cow objects, return the Cow object with the specified name. If no such Co
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!