7 kyu
Write out expression!
976 of 1,350Caders
Description:
Math hasn't always been your best subject, and these programming symbols always trip you up! I mean, does **
mean "Times, Times" or "To the power of"? Luckily, you can create the function to write out the expressions for you!
The operators you'll need to use are:
"+" --> "Plus"
"-" --> "Minus"
"*" --> "Times"
"/" --> "Divided By"
"**" --> "To The Power Of"
"=" --> "Equals"
"!=" --> "Does Not Equal"
Notes:
- the input will always be given as a string, in the following format:
number space operator space number
; for example:"1 + 3"
or"2 - 10"
- the numbers used will be
1
to10
- the valid operators and the relevant texts are stored in the preloaded dictionary/hash
OPERATORS
- invalid operators will also be tested, to which you should return
"That's not an operator!"
Examples
"4 ** 9" --> "Four To The Power Of Nine"
"10 - 5" --> "Ten Minus Five"
"2 = 2" --> "Two Equals Two"
"2 x 3" --> "That's not an operator!"
Good luck!
Fundamentals
Similar Kata:
Stats:
Created | Sep 21, 2016 |
Published | Sep 21, 2016 |
Warriors Trained | 2531 |
Total Skips | 120 |
Total Code Submissions | 7302 |
Total Times Completed | 1350 |
Python Completions | 976 |
JavaScript Completions | 365 |
Ruby Completions | 38 |
Total Stars | 35 |
% of votes with a positive feedback rating | 84% of 368 |
Total "Very Satisfied" Votes | 273 |
Total "Somewhat Satisfied" Votes | 74 |
Total "Not Satisfied" Votes | 21 |
Total Rank Assessments | 113 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 1 kyu |
Lowest Assessed Rank | 8 kyu |