Python Forum
How to get first line of a tuple and the third item in its tuple. Need Help, Anybody?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get first line of a tuple and the third item in its tuple. Need Help, Anybody?
#1
I have these values which I store in a:
a = ((1.425, 4.82145395112958, 0.0656498375731458)
    (1.39716316090366, 7.2, 0.102480129941483)
    (7.425, 4.82145395112958, 0.0656498375731458)
    (7.39716316090366, 7.2, 0.102480129941483)
    (7.425, -0.928546048870416, 0.0656498375731458)
    (7.39716316090366, 0.95, 0.102480129941483)
    (1.425, -0.928546048870416, 0.0656498375731458)
    (1.39716316090366, 0.95, 0.102480129941483))
what I'm doing:
print a[2]
Gives:
Output:
0.0656498375731458 0.102480129941483 0.0656498375731458 0.102480129941483 0.0656498375731458 0.102480129941483 0.0656498375731458 0.102480129941483
I only need this single value to print: 0.0656498375731458
Reply


Messages In This Thread
How to get first line of a tuple and the third item in its tuple. Need Help, Anybody? - by SukhmeetSingh - May-20-2019, 09:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  using > < for tuple , list,... akbarza 3 468 Feb-05-2024, 01:18 PM
Last Post: deanhystad
Sad UnpicklingError: NEWOBJ expected an arg tuple. biyazelnut 0 455 Dec-20-2023, 03:16 AM
Last Post: biyazelnut
  Searche each element of each tuple based 3 numbes zinho 8 855 Dec-11-2023, 05:14 PM
Last Post: zinho
  tuple indices must be integers or slices, not str cybertooth 16 11,444 Nov-02-2023, 01:20 PM
Last Post: brewer32
Question mypy unable to analyse types of tuple elements in a list comprehension tomciodev 1 468 Oct-17-2023, 09:46 AM
Last Post: tomciodev
  Change font in a list or tuple apffal 4 2,670 Jun-16-2023, 02:55 AM
Last Post: schriftartenio
  search in dict inside tuple steg 1 683 Mar-29-2023, 01:15 PM
Last Post: rob101
Exclamation IndexError: Replacement index 2 out of range for positional args tuple - help? MrKnd94 2 6,302 Oct-14-2022, 09:57 PM
Last Post: MrKnd94
  Pulling username from Tuple pajd 21 3,340 Oct-07-2022, 01:33 PM
Last Post: pajd
  how to convert tuple value into string mg24 2 2,323 Oct-06-2022, 08:13 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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