Write a Python function that reads as keyboard input a positive four-digit integer n. The function returns True if the number n meets the following criteria, and False otherwise: ➔ A number n meets the criteria if at least one of the four digits of the number n is equal to 7, or if all the digits of n are even. In this function, it is not allowed to use strings. The function should return a Boolean variable. Use modulo and whole division to determine the digits.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 22PE
icon
Related questions
Question
Write a Python function that reads as keyboard input a positive four-digit integer n. The function returns True if the number n meets the following criteria, and False otherwise: ➔ A number n meets the criteria if at least one of the four digits of the number n is equal to 7, or if all the digits of n are even. In this function, it is not allowed to use strings. The function should return a Boolean variable. Use modulo and whole division to determine the digits.
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning