Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print command
#1
Hi

using
print '.ngc'+string

I get .ngc***** - 3654 - 20181222

but using using
print string+'.ngc'
***** - 3654 - 20181222

.ngc


but would like ***** - 3654 - 20181222.ngc



how would I fix this

thanks
Reply
#2
Strip the whitespace out.
print("{0}.ngc".format(string.strip()))
Reply
#3
perfect
thank you
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  problem with print command in super() akbarza 5 506 Feb-01-2024, 12:25 PM
Last Post: deanhystad
  Python VS Code: using print command twice but not getting output from terminal kdx264 4 1,034 Jan-16-2023, 07:38 PM
Last Post: Skaperen
  Why does absence of print command outputs quotes in function? Mark17 2 1,342 Jan-04-2022, 07:08 PM
Last Post: ndc85430
  Using print command to send command to rasberry pi terminal MondazeBear 2 1,831 Aug-02-2021, 03:15 PM
Last Post: Larz60+
  Will not print in command prompt PandaCode 12 12,830 May-06-2020, 03:48 AM
Last Post: PandaCode
  how to make a mathematical operation without the command "print" ewar2606 4 2,896 Mar-15-2018, 07:19 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

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