0
The "say the numbers" exercise in the Go tutorial
Hi guys! I'm python dev learning Go; but I'm a bit confused. The "say the numbers" exercise requires you to take three numbers between 0 and 10, and then print their English equivalent line by line. My solution gets past all the tests but the third one (which is locked and thus unknown). Can someone help?
9 Answers
+ 1
AzuraMask You can share your code bit and then someone can let you know if you did correctly.
Or you can test the case yourself: since this one wants you to input a number and print out the text and it only goes to 10. Then input each number to see if it prints the text for each number 0-10..
https://www.sololearn.com/Discuss/2880776/i-wrote-the-following-code-for-the-say-the-numbers-project-in-the-go-tutorial-but-it-doesn-t-pass-2
+ 2
Chris Coder pro users cannot see more test cases than free users. They're hidden to prevent hardcoding the answers. Since sololearn doesn't check the code but only compares the output for each input to the expected output you could just solve all tasks with a few if statements.
+ 1
I assume to help users figure out if they're completely off the mark.
+ 1
AzuraMask I used a switch statement with fmt.Println rather than print. I did not have a default case.
0
Jay Matthews it is possible that the app post the same thing twice. Sometimes my answers appear twice.
0
IDK why that happened. Removed the duplicate. Can some1 help?
0
Thanks.
Also, what a great approach! "It's free, but we'll make it impossible to understand what's wrong with your code!"
0
Appreciated. Thanks a lot.
0
Simon Sauter Thanks for the correction. I had pro but wasn't sure if I remembered correctly. What is the point of showing that are other test cases?