Skip to main content
Tweeted twitter.com/StackMma/status/1524449259222884354
Became Hot Network Question
edited title
Link
Lukas Lang
  • 34.4k
  • 1
  • 56
  • 99

Check condition on each Modify list and print out what I wantelements if last two entries are equal

Source Link
kompaui
  • 135
  • 2

Check condition on each list and print out what I want

Suppose I have a list as follows

{{1, 1, 1, 1, 1, 3}, {1, 1, 3, 4, 1, 1}}

and I want to check the last two coordinates are equal or not. If that is the case then I want it to print out T after that list. So the result should be

{{1, 1, 1, 1, 1, 3}, {1, 1, 3, 4, 1, 1,T}}

I am thinking about using "if" but I have no idea how to do it.