Python Forum
How to combine two output in one variable?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to combine two output in one variable?
#1
I have a while loop. In my loop the result can be one or more than one. Like:

2 antivirüs name's like:
Kaspersky.
Trend Micro


I want to combine them in one variable like Kaspersky#Trend Micro . And then save into the db.

Here is my while loop:

    while i < parsing_value4:
        parsing_value3 = parsing_value2[int(i)]
        print(result_parse[int(parsing_value3)])
        i += 1
How can i do it?
Reply
#2
missing:
  • parsing_value4
  • parsing_value2
  • starting value of i
  • explanation (code is better) of result_parse function
IT would be easier if you specify the inputs, and expected outputs rather than showing an incomplete snippet of code.
Gribouillis likes this post
Reply
#3
>>> a = "Kaspersky"
>>> b = "Trend Micro"
>>> c = f"{a}#{b}"
>>> c
'Kaspersky#Trend Micro'
>>> 
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Os command output in variable shows wrong value paulo79 2 1,514 Apr-09-2022, 03:48 PM
Last Post: ndc85430
  Command output to Variable ironclaw 1 1,790 Aug-26-2021, 06:55 PM
Last Post: bowlofred
  Getting a GET request output text into a variable to work with it. LeoT 2 3,028 Feb-24-2021, 02:05 PM
Last Post: LeoT
  Capture grep output to a variable which includes another variable kdefilip2 4 8,246 Nov-24-2019, 12:30 PM
Last Post: kdefilip2
  Guidance in Creating random output for a variable. Livne_ye 1 2,517 May-04-2019, 01:18 PM
Last Post: Yoriz
  How to assign this output to a string variable? Pedroski55 3 2,639 Apr-18-2019, 07:23 AM
Last Post: Yoriz
  Pass variable script return twice output problem Faruk 8 4,395 Dec-26-2018, 11:57 AM
Last Post: Faruk
  unexpected output for global variable bhdebasish 1 2,370 Aug-22-2018, 04:55 PM
Last Post: Larz60+
  Retrieve data from Terminal output or from an ASE variable. DreamingInsanity 0 2,220 Jul-08-2018, 05:51 PM
Last Post: DreamingInsanity
  Is it possible to create a variable with the name of an output of another variable Panda 8 4,592 Jun-06-2018, 09:14 PM
Last Post: Panda

Forum Jump:

User Panel Messages

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