Python Forum

Full Version: How to combine two output in one variable?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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.
>>> a = "Kaspersky"
>>> b = "Trend Micro"
>>> c = f"{a}#{b}"
>>> c
'Kaspersky#Trend Micro'
>>>