i need to store the piglatin words returned by each function into one string so that I can then check it for lowercase or uppercase words and change as required. I can't seem to get the return 'temp' to store into a string in main. Also, when printed out, the last 2 or 3 letters move to the next line, why is this?
Here is my code thus far: must enter info in all CAPS for now.
Pig Latin Translator in Python. Ask Question Asked 3 years, 7 months ago. The last thing unpacking can help you with is the choice of language/transformation function. If you define, for each input letter, the name of the language and the associated transformation function in a tuple, you can extract them out easily. Word separator.
3 Contributors
forum5 Replies
933 Views
1 Day Discussion Span
commentLatest Postby Stoned_coder
not looking at code improperly formatted. please edit your post to include code tags if you want help.
Smack, makes more sense now! Thank you for your help :) Yanson, I got the ideas of how to do a pig latin code; however, just looking for a tad more knowledge. I fully understand what your line 28 is doing now :D however that string::npos is really bugging me! I have noticed that in my C++ book too and other programmers here on this forum. There are two string data type. one is size_type(which is all positive integers and the other one is npos(which I don't understand at all or even what it is) please don't refer me to the c++ reference page. Their wordings are a little too advanced for me right now, my opinion. YOU did explain this quite well and I would like you to answer this as well too please. 1.) I don't understand what the npos is doing in that if statement? This is what I'm viewing your line 28 to be now. Please correct me. If (first letter) or vowel is not found then make ay='way';I see a '!' should it not only be equal then?..meaning if the first letter is vowel then set ay='way'; 2.) why are you using string::npos? is there not another way to write this 'if first letter is vowel and found, then set 'ay='way'.