Python Forum
Problem with a language word problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with a language word problem
#1
Can anyone solve this problem?
english = "hello"
spanish = "hola"

1

print("hello is hola in Spanish")

2

​

3

print ("goodbye is adios in Spanish")
Reply
#2
What's the problem?

Both of your threads lack details. Do you have a homework prompt that can help us to help you?
Reply
#3
(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.
Reply
#4
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)
Reply
#5
(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/
Is that correct?
what have you tried so far? (show your code)
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
Reply
#6
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))
Reply
#7
(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):
 en_tobacco = 'tobacco' sp1_tobacco = 'tabaco' sp2_tobacco = 'cigarrillo' print('{} is {} in Spanish but could also be {}'.format(en_tobacco, sp1_tobacco, sp2_tobacco)) 
Your suggestion didn't work.
Reply
#8
there are not all on the same line!
you must separate!
Then it will work fine.
Reply
#9
(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.
Reply
#10
you are running python interpreter correct?
from command line, type python followed by enter
you should see:
Output:
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD6 4)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
or something very similar
at >>> prompt type the code one line at a time
paste your output
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with "Number List" problem on HackerRank Pnerd 5 2,086 Apr-12-2022, 12:25 AM
Last Post: Pnerd
Question Problem: Check if a list contains a word and then continue with the next word Mangono 2 2,488 Aug-12-2021, 04:25 PM
Last Post: palladium
  Problem with csv giorgosmarga 4 2,373 Mar-18-2021, 11:07 AM
Last Post: giorgosmarga
  Problem in solving optimization problem Ruchika 0 1,549 Jul-27-2020, 05:28 AM
Last Post: Ruchika
  Map() problem pyzyx3qwerty 4 2,516 May-16-2020, 01:35 PM
Last Post: pyzyx3qwerty
  else problem MJB 3 9,277 May-02-2020, 02:30 PM
Last Post: Yoriz
  Need Help With A Problem I Have Come Across finndude 10 3,796 Apr-14-2020, 01:15 PM
Last Post: finndude
  Python Speech recognition, word by word AceScottie 6 15,984 Apr-12-2020, 09:50 AM
Last Post: vinayakdhage
  Pip problem Jules 5 10,672 Mar-25-2020, 12:21 AM
Last Post: Larz60+
  try except problem catlessness 1 1,702 Mar-06-2020, 06:39 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020