Python Forum
For loop prints strane values?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
For loop prints strane values?
#2
a better way to print this is:
header = ['one', 'two', 'three']
data_bytes = [1,2,3,4,5]
print(f"{[x for x in header]}, {data_bytes[0]}")
Output:
['one', 'two', 'three'], 1
Reply


Messages In This Thread
For loop prints strane values? - by colt - Sep-22-2019, 01:38 AM
RE: For loop prints strane values? - by Larz60+ - Sep-22-2019, 01:57 AM
RE: For loop prints strane values? - by ichabod801 - Sep-22-2019, 02:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Loop through values and compare edroche3rd 6 702 Oct-18-2023, 04:04 PM
Last Post: edroche3rd
  Loop through json file and reset values [SOLVED] AlphaInc 2 2,150 Apr-06-2023, 11:15 AM
Last Post: AlphaInc
  zfill prints extra et the end of a var tester_V 4 915 Mar-24-2023, 06:59 PM
Last Post: tester_V
  Creating a loop with dynamic variables instead of hardcoded values FugaziRocks 3 1,505 Jul-27-2022, 08:50 PM
Last Post: rob101
  How do loop over curl and 'put' different values in API call? onenessboy 0 1,231 Jun-05-2022, 05:24 AM
Last Post: onenessboy
  Loop through values in dictrionary and find the same as in previous row Paqqno 5 1,915 Mar-27-2022, 07:58 PM
Last Post: deanhystad
  How to add for loop values in variable paulo79 1 1,460 Mar-09-2022, 07:20 PM
Last Post: deanhystad
  variable prints without being declared. ClockPillow 2 1,821 Jul-11-2021, 12:13 AM
Last Post: ClockPillow
Exclamation Compare values in a for loop. penahuse 1 2,374 Feb-22-2021, 07:01 AM
Last Post: buran
  Output prints Account.id at the end? LastStopDEVS 5 2,797 Dec-19-2020, 05:59 AM
Last Post: buran

Forum Jump:

User Panel Messages

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