7 kyu

Two numbers are positive

2,718 of 6,971CodewarsDenis

Description:

Task:

Your job is to write a function, which takes three integers a, b, and c as arguments, and returns True if exactly two of the three integers are positive numbers (greater than zero), and False - otherwise.

Examples:

two_are_positive(2, 4, -3) == True
two_are_positive(-4, 6, 8) == True
two_are_positive(4, -6, 9) == True
two_are_positive(-4, 6, 0) == False
two_are_positive(4, 6, 10) == False
two_are_positive(-14, -3, -4) == False
twoArePositive(2, 4, -3) == true
twoArePositive(-4, 6, 8) == true
twoArePositive(4, -6, 9) == true
twoArePositive(-4, 6, 0) == false
twoArePositive(4, 6, 10) == false
twoArePositive(-14, -3, -4) == false
TwoArePositive(2, 4, -3) == true
TwoArePositive(-4, 6, 8) == true
TwoArePositive(4, -6, 9) == true
TwoArePositive(-4, 6, 0) == false
TwoArePositive(4, 6, 10) == false
TwoArePositive(-14, -3, -4) == false
two_are_positive(2, 4, -3) == true
two_are_positive(-4, 6, 8) == true
two_are_positive(4, -6, 9) == true
two_are_positive(-4, 6, 0) == false
two_are_positive(4, 6, 10) == false
two_are_positive(-14, -3, -4) == false
Fundamentals

Stats:

CreatedFeb 18, 2021
PublishedFeb 18, 2021
Warriors Trained8774
Total Skips156
Total Code Submissions15781
Total Times Completed6971
Python Completions2718
JavaScript Completions2583
C# Completions528
TypeScript Completions209
PHP Completions183
C Completions239
Java Completions719
CoffeeScript Completions14
Rust Completions121
Total Stars43
% of votes with a positive feedback rating87% of 842
Total "Very Satisfied" Votes653
Total "Somewhat Satisfied" Votes152
Total "Not Satisfied" Votes37
Total Rank Assessments327
Average Assessed Rank
7 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • CodewarsDenis Avatar
  • SagePtr Avatar
  • andreapt82 Avatar
  • sbx Avatar
  • Madjosz Avatar
  • rowcased Avatar
  • Awesome A.D. Avatar
  • hobovsky Avatar
  • Pnd72 Avatar
  • dfhwze Avatar
  • LosBlobbos Avatar
Ad