Python Forum
Add variable value to string
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add variable value to string
#1
I am creating variable

dashboard_id="66862fa0-dafa-4d28572533a"
I want to create a another variable and insert this value to it

Output:
{ "objects":[ { "type":"dashboard", "id":"66862fa0-dafa-4d28572533a" } ] , "includeReferencesDeep": true }
this is how i am creating this but do not know how to replace this id

data = '\n{ "objects":[\n   {\n "type":"dashboard",\n "id":"66862fa0-dafa-4d28572533a"\n } ] ,\n "includeReferencesDeep": true\n}'
Reply


Messages In This Thread
Add variable value to string - by pythonlearner1 - May-24-2020, 08:47 PM
RE: Add variable value to string - by michael1789 - May-24-2020, 09:10 PM
RE: Add variable value to string - by buran - May-25-2020, 12:54 PM
RE: Add variable value to string - by ndc85430 - May-25-2020, 05:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Replacing String Variable with a new String Name kevv11 2 805 Jul-29-2023, 12:03 PM
Last Post: snippsat
  Need help on how to include single quotes on data of variable string hani_hms 5 2,106 Jan-10-2023, 11:26 AM
Last Post: codinglearner
  python r string for variable mg24 3 2,877 Oct-28-2022, 04:19 AM
Last Post: deanhystad
  USE string data as a variable NAME rokorps 1 978 Sep-30-2022, 01:08 PM
Last Post: deanhystad
  Removing Space between variable and string in Python coder_sw99 6 6,362 Aug-23-2022, 01:15 PM
Last Post: louries
  Remove a space between a string and variable in print sie 5 1,833 Jul-27-2022, 02:36 PM
Last Post: deanhystad
  Split string using variable found in a list japo85 2 1,324 Jul-11-2022, 08:52 AM
Last Post: japo85
  Can you print a string variable to printer hammer 2 1,988 Apr-30-2022, 11:48 PM
Last Post: hammer
Question How to convert string to variable? chatguy 5 2,490 Apr-12-2022, 08:31 PM
Last Post: buran
  I want to search a variable for a string D90 lostbit 3 2,663 Mar-31-2021, 07:14 PM
Last Post: lostbit

Forum Jump:

User Panel Messages

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