Python Forum
How to add for loop values in variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to add for loop values in variable
#2
If that works, then use \
>>>distinct_values = list(g_unique)
or
distinct_values = list(set([x.find('diskType').text for x in get_xml.findall('physicaldisk')]))
Reply


Messages In This Thread
How to add for loop values in variable - by paulo79 - Mar-09-2022, 06:52 PM
RE: How to add for loop values in variable - by deanhystad - Mar-09-2022, 07:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Variable definitions inside loop / could be better? gugarciap 2 481 Jan-09-2024, 11:11 PM
Last Post: deanhystad
  How to create a variable only for use inside the scope of a while loop? Radical 10 1,908 Nov-07-2023, 09:49 AM
Last Post: buran
  Loop through values and compare edroche3rd 6 743 Oct-18-2023, 04:04 PM
Last Post: edroche3rd
  Loop through json file and reset values [SOLVED] AlphaInc 2 2,214 Apr-06-2023, 11:15 AM
Last Post: AlphaInc
  store all variable values into list and insert to sql_summary table mg24 3 1,191 Sep-28-2022, 09:13 AM
Last Post: Larz60+
  Nested for loops - help with iterating a variable outside of the main loop dm222 4 1,663 Aug-17-2022, 10:17 PM
Last Post: deanhystad
  loop (create variable where name is dependent on another variable) brianhclo 1 1,175 Aug-05-2022, 07:46 AM
Last Post: bowlofred
  Creating a loop with dynamic variables instead of hardcoded values FugaziRocks 3 1,547 Jul-27-2022, 08:50 PM
Last Post: rob101
  How do loop over curl and 'put' different values in API call? onenessboy 0 1,248 Jun-05-2022, 05:24 AM
Last Post: onenessboy
  Multiple Loop Statements in a Variable Dexty 1 1,228 May-23-2022, 08:53 AM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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