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 to 10
  • 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

Stats:

CreatedSep 21, 2016
PublishedSep 21, 2016
Warriors Trained2531
Total Skips120
Total Code Submissions7302
Total Times Completed1350
Python Completions976
JavaScript Completions365
Ruby Completions38
Total Stars35
% of votes with a positive feedback rating84% of 368
Total "Very Satisfied" Votes273
Total "Somewhat Satisfied" Votes74
Total "Not Satisfied" Votes21
Total Rank Assessments113
Average Assessed Rank
6 kyu
Highest Assessed Rank
1 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Caders Avatar
  • anter69 Avatar
  • B1ts Avatar
  • user9644768 Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
Ad