![]() |
Problem with a language word problem - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Problem with a language word problem (/thread-10577.html) Pages:
1
2
|
Problem with a language word problem - baobei - May-25-2018 Can anyone solve this problem? english = "hello" spanish = "hola" 1 print("hello is hola in Spanish") 2 3 print ("goodbye is adios in Spanish") RE: Problem with a language word problem - micseydel - May-25-2018 What's the problem? Both of your threads lack details. Do you have a homework prompt that can help us to help you? RE: Problem with a language word problem - baobei - May-26-2018 (May-25-2018, 09:26 PM)micseydel Wrote: What's the problem? Both of your threads lack details. Do you have a homework prompt that can help us to help you?1. The problem is that using English to Spanish translations, make at least 2 correct translations. 2. I don't have anything that might help solve the problem. RE: Problem with a language word problem - Larz60+ - May-26-2018 I'm guessing that you are supposed to fill in another Spanish word for hello under 2, and then add 4 and another word for goodbye/ Is that correct? what have you tried so far? (show your code) RE: Problem with a language word problem - baobei - May-27-2018 (May-26-2018, 01:27 PM)Larz60+ Wrote: I'm guessing that you are supposed to fill in another Spanish word for hello under 2, and then add 4 and another word for goodbye/No, your suggestion wasn't correct. 2 Print translations Given an english string and its spanish translation, print sentences of the form "english is spanish in Spanish" english = "hello" spanish = "hola" 1 print("hello is hola in Spanish") 2 english = "goodbye" 3 spanish = "adios" 4 print ("goodbye is adios in Spanish") Expected output hello is hola in Spanish 3 print ("goodbye is adios in Spanish")Expected output hello is hola in Spanish 3 RE: Problem with a language word problem - Larz60+ - May-27-2018 Well, the code is there, all you have to do is remove the non python lines use variable names like en_hello, sp1_hello, sp2_hello and formatted print statements like (for example): en_tobacco = 'tobacco' sp1_tobacco = 'tabaco' sp2_tobacco = 'cigarrillo' print('{} is {} in Spanish but could also be {}'.format(en_tobacco, sp1_tobacco, sp2_tobacco)) RE: Problem with a language word problem - baobei - May-27-2018 (May-27-2018, 12:55 AM)Larz60+ Wrote: Well, the code is there, all you have to do is remove the non python lines use variable names like en_hello, sp1_hello, sp2_hello and formatted print statements like (for example):Your suggestion didn't work.en_tobacco = 'tobacco' sp1_tobacco = 'tabaco' sp2_tobacco = 'cigarrillo' print('{} is {} in Spanish but could also be {}'.format(en_tobacco, sp1_tobacco, sp2_tobacco)) RE: Problem with a language word problem - Larz60+ - May-27-2018 there are not all on the same line! you must separate! Then it will work fine. RE: Problem with a language word problem - baobei - May-27-2018 (May-27-2018, 02:19 PM)Larz60+ Wrote: there are not all on the same line! you must separate! Then it will work fine.Still no luck. RE: Problem with a language word problem - Larz60+ - May-27-2018 you are running python interpreter correct? from command line, type python followed by enter you should see: or something very similarat >>> prompt type the code one line at a time paste your output |