Question

write a program in python language: One hot summer day Pete and his friend Billy decided...

write a program in python language:

One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, and decided to divide the berry, however they faced a hard problem.

Pete and Billy are great fans of even numbers, that's why they want to divide the watermelon in such a way that each of the two parts weighs even number of kilos, at the same time it is not obligatory that the parts are equal. The boys are extremely tired and want to start their meal as soon as possible, that's why you should help them and find out, if they can divide the watermelon in the way they want. For sure, each of them should get a part of positive weight.

Input
The first (and the only) input line contains integer number w (1 ≤ w ≤ 100) — the weight of the watermelon bought by the boys.

Output
Print YES, if the boys can divide the watermelon into two parts, each of them weighing even number of kilos; and NO in the opposite case.

Examples
input
8
output
YES

Note
For example, the boys can divide the watermelon into two parts of 2 and 6 kilos respectively (another variant — two parts of 4 and 4 kilos).

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code and output

main.py or 1 n=int(input(Enter the weight of the water melon 2- if n%2==0: print(YES) 4- if n%2==1: print(NO) 3 5 input

Code for copying

n=int(input("Enter the weight of the water melon : "))
if n%2==0:
print("YES")
if n%2==1:
print("NO").

Add a comment
Know the answer?
Add Answer to:
write a program in python language: One hot summer day Pete and his friend Billy decided...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Edit a C program based on the surface code(which is after the question's instruction.) that will...

    Edit a C program based on the surface code(which is after the question's instruction.) that will implement a customer waiting list that might be used by a restaurant. Use the base code to finish the project. When people want to be seated in the restaurant, they give their name and group size to the host/hostess and then wait until those in front of them have been seated. The program must use a linked list to implement the queue-like data structure....

  • i have the case study question with the answers but i need help to re-write the...

    i have the case study question with the answers but i need help to re-write the answers. please see the attached files Case Study Analysis (CSF3003) Assessment Description and Requirements CLO1: Case Study 1 Ahmad lef home to study master and PhD in Australia. He has fees for the first semester only. After he arrived to Sydney and settled down, he start looking for a part-time job to save money for the next term. Ahmad has some experience on making...

  • Comprehensive Income Tax Course: Module 1 4. Randy turned 16 last year and had his first...

    Comprehensive Income Tax Course: Module 1 4. Randy turned 16 last year and had his first summer job. Even though his parents are claiming him as a dependent he wants to file a return in order to get his refund. He receives his W-2 and decides he can do his own return using form 1040-EZ. Which of the following information is not found on a Form W-2? a) The taxpayer’s Social Security number b) The taxpayer’s wages, tips and other...

  • I have this case study to solve. i want to ask which type of case study...

    I have this case study to solve. i want to ask which type of case study in this like problem, evaluation or decision? if its decision then what are the criterias and all? Stardust Petroleum Sendirian Berhad: how to inculcate the pro-active safety culture? Farzana Quoquab, Nomahaza Mahadi, Taram Satiraksa Wan Abdullah and Jihad Mohammad Coming together is a beginning; keeping together is progress; working together is success. - Henry Ford The beginning Stardust was established in 2013 as a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT