Python Forum
Remove a space between a string and variable in print
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove a space between a string and variable in print
#4
Isn't Python marvellous, it gives us many different ways to kill a cat!

print ("I don't like " + colour + ", I prefer red.")
Watch out for the apostrophe in don't, can cause trouble sometimes. In that case esape it: \'
rob101 and sie like this post
Reply


Messages In This Thread
RE: Remove a space between a string and variable in print - by Pedroski55 - Jul-27-2022, 07:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  remove gilberishs from a "string" kucingkembar 2 303 Mar-15-2024, 08:51 AM
Last Post: kucingkembar
  Replacing String Variable with a new String Name kevv11 2 819 Jul-29-2023, 12:03 PM
Last Post: snippsat
  Print variable without '' and spaces arnonim 1 749 Jan-30-2023, 05:23 PM
Last Post: deanhystad
  Need help on how to include single quotes on data of variable string hani_hms 5 2,136 Jan-10-2023, 11:26 AM
Last Post: codinglearner
  Problem with print variable in print.cell (fpdf) muconi 0 690 Dec-25-2022, 02:24 PM
Last Post: muconi
  python r string for variable mg24 3 2,910 Oct-28-2022, 04:19 AM
Last Post: deanhystad
Smile please help me remove error for string.strip() jamie_01 3 1,249 Oct-14-2022, 07:48 AM
Last Post: Pedroski55
  USE string data as a variable NAME rokorps 1 989 Sep-30-2022, 01:08 PM
Last Post: deanhystad
  Removing Space between variable and string in Python coder_sw99 6 6,383 Aug-23-2022, 01:15 PM
Last Post: louries
  Split string using variable found in a list japo85 2 1,334 Jul-11-2022, 08:52 AM
Last Post: japo85

Forum Jump:

User Panel Messages

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