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
#11
(May-27-2018, 04:39 PM)Larz60+ Wrote: 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
I am using something similar to python, only it's on a website.
Reply
#12
Please do not send private mail. Answer here for all to see
Reply
#13
(May-27-2018, 04:39 PM)Larz60+ Wrote: 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
I am using a different version of python. Did you get my private message?
Reply
#14
Read my response above. I usually ignore private mail
Reply
#15
I got:
Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 01:31:54) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> en_tobacco = 'tobacco'
>>> sp1_tobacco = 'tabaco'
>>> sp2_tobacco = 'cigarrillo'
>>> en_tobacco = 'tobacco' sp1_tobacco = 'tabaco' sp2_tobacco = 'cigarrillo' print('{} is {} in Spanish but could also be {}'.format(en_tobacco, sp1_tobacco, sp2_tobacco))
SyntaxError: invalid syntax
Reply
#16
(Nov-21-2019, 11:41 PM)baobei Wrote: I got:
Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 01:31:54) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> en_tobacco = 'tobacco'
>>> sp1_tobacco = 'tabaco'
>>> sp2_tobacco = 'cigarrillo'
>>> en_tobacco = 'tobacco' sp1_tobacco = 'tabaco' sp2_tobacco = 'cigarrillo' print('{} is {} in Spanish but could also be {}'.format(en_tobacco, sp1_tobacco, sp2_tobacco))
SyntaxError: invalid syntax

Hi!

You are not following correctly the instructions from Larz60+.
Output:
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> en_tobacco = 'tobacco' >>> sp1_tobacco = 'tabaco' >>> sp2_tobacco = 'cigarrillo' >>> print('{} is {} in Spanish but could also be {}'.format(en_tobacco, sp1_tobacco, sp2_tobacco)) tobacco is tabaco in Spanish but could also be cigarrillo >>>
All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#17
But still, what is the answer?
Reply
#18
Here's my output:
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> en_tobacco = 'tobacco'
>>> sp1_tobacco = 'tabaco'
>>> sp2_tobacco = 'cigarrillo'
>>>
>>> print('{} is {} in Spanish but could also be {}'.format(en_tobacco, sp1_tobacco, sp2_tobacco))
tobacco is tabaco in Spanish but could also be cigarrillo
>>>
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,278 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