Page 6 of 9 FirstFirst ... 23456789 LastLast
Results 76 to 90 of 131

Thread: Any Python Programmers Out There??

  1. #76 | Top
    Join Date
    Feb 2020
    Posts
    87,043
    Thanks
    35,071
    Thanked 21,785 Times in 17,104 Posts
    Groans
    985
    Groaned 2,344 Times in 2,263 Posts
    Blog Entries
    1

    Default

    Here's another clue:

    There are possible values of two or three variables that add up to a number each row. Subtract 30 from known entries and work from there.

    Let linear algebra work it's magic for the magic square.

  2. #77 | Top
    Join Date
    Feb 2020
    Posts
    87,043
    Thanks
    35,071
    Thanked 21,785 Times in 17,104 Posts
    Groans
    985
    Groaned 2,344 Times in 2,263 Posts
    Blog Entries
    1

    Default

    Those are possible values for those two unknowns for the first row.

    Code:
    PLst = [2, 0, 4, 5, 7, 0, 3, 2]
    print(sum(PLst))
    Sub = 30 - sum(PLst)
    print(Sub)
    #Clue here
    for i in range(1,Sub):
        print(i,Sub - i)
    Result

    23
    7
    1 6
    2 5
    3 4
    4 3
    5 2
    6 1

  3. #78 | Top
    Join Date
    Apr 2009
    Posts
    108,120
    Thanks
    60,501
    Thanked 35,051 Times in 26,519 Posts
    Groans
    47,393
    Groaned 4,742 Times in 4,521 Posts
    Blog Entries
    61

    Default

    Quote Originally Posted by AProudLefty View Post
    Maybe I am a Drunken Computer Programmer. Like that Drunken Kung Fu Master Jackie Chan? Once he's drunk, all of sudden he's an expert at it.
    Are you an alcoholic?

  4. #79 | Top
    Join Date
    Jul 2019
    Posts
    28,403
    Thanks
    26,104
    Thanked 11,856 Times in 8,415 Posts
    Groans
    18
    Groaned 2,290 Times in 2,172 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Primavera View Post
    Are you an alcoholic?
    He's not, but you are.
    Lock Him Up

  5. #80 | Top
    Join Date
    Apr 2009
    Posts
    108,120
    Thanks
    60,501
    Thanked 35,051 Times in 26,519 Posts
    Groans
    47,393
    Groaned 4,742 Times in 4,521 Posts
    Blog Entries
    61

    Default

    Quote Originally Posted by AProudLefty View Post
    Remember I was drunk and already explained and just now explained again to Havana Moon? Heh.

    Now what do you think of my core dump? Seems like Python doesn't like matrices. I am new to Python.
    Maybe you should read this first before commenting?

    https://www.programiz.com/python-pro...ultiply-matrix

  6. #81 | Top
    Join Date
    Nov 2013
    Location
    internet
    Posts
    759
    Thanks
    127
    Thanked 366 Times in 247 Posts
    Groans
    5
    Groaned 24 Times in 23 Posts

    Default

    Quote Originally Posted by Primavera View Post
    I contacted my son and he said this.
    we fucking know tom, your son said what I said like 40 hours ago at this point
    NPC is a beloved internet personality. Their pronouns are he/him. NPC fully recognizes the inherent privilege of being able to post on a message board, and as such NPC makes sure to avoid all social media where the trust and safety council flags something as dangerous to think about. He avoids all tweets that are disputed, and only supports mainstream news sources where former CIA, NSA and FBI serve as talking heads.The future is female, orange man bad, black lives matter, and wear a damn mask!

  7. The Following User Groans At Niche Political Commentor For This Awful Post:

    cancel2 2022 (12-29-2020)

  8. #82 | Top
    Join Date
    Sep 2020
    Posts
    222
    Thanks
    2
    Thanked 68 Times in 58 Posts
    Groans
    0
    Groaned 2 Times in 2 Posts

    Default

    Quote Originally Posted by Guille View Post
    Then you suck because that shouldn't happen.
    Yeah, can't argue. Just curious: How is it constructive for you to point that out??

  9. #83 | Top
    Join Date
    Nov 2013
    Location
    internet
    Posts
    759
    Thanks
    127
    Thanked 366 Times in 247 Posts
    Groans
    5
    Groaned 24 Times in 23 Posts

    Default

    Quote Originally Posted by Bubba View Post
    OK, I do get it. (I think.) Code works now. Thank you and thanks to APL for the time you guys spent explaining it.

    Now I'm ready to move on. The original problem in the book of puzzles was an 8 X 8 grid. Each horizontal line similar to my PLst: [2, 0, 4, 5, 7, 0, 3, 2] with some of the numbers in each line missing. Those are the ones I filled in with zero.

    The challenge is to make each horizontal line AND each vertical line add to thirty. Well, I'll just type the entire puzzle.

    [2, 0, 4, 5, 7, 0, 3, 2]
    [0, 4, 1, 6, 0, 1, 9, 0]
    [4, 0, 0, 1, 0, 8, 2, 4]
    [1, 5, 0, 0, 5, 0, 0, 2]
    [0, 6, 4, 3, 0, 4, 2, 6]
    [7, 3, 4, 0, 2, 5, 1, 0]
    [0, 1, 6, 7, 1, 0, 0, 2]
    [1, 0, 2, 0, 3, 2, 5, 0]

    So all sixteen lines have to add to thirty. Now that you've pointed me in the right direction, I'm going to forge ahead and attempt to finish the puzzle.
    i assume you can't use numbers large than 9 in the grid?
    NPC is a beloved internet personality. Their pronouns are he/him. NPC fully recognizes the inherent privilege of being able to post on a message board, and as such NPC makes sure to avoid all social media where the trust and safety council flags something as dangerous to think about. He avoids all tweets that are disputed, and only supports mainstream news sources where former CIA, NSA and FBI serve as talking heads.The future is female, orange man bad, black lives matter, and wear a damn mask!

  10. #84 | Top
    Join Date
    Feb 2020
    Posts
    87,043
    Thanks
    35,071
    Thanked 21,785 Times in 17,104 Posts
    Groans
    985
    Groaned 2,344 Times in 2,263 Posts
    Blog Entries
    1

    Default

    Quote Originally Posted by Primavera View Post
    Are you an alcoholic?
    Is it alcoholic if I just love beer?

  11. #85 | Top
    Join Date
    Apr 2009
    Posts
    108,120
    Thanks
    60,501
    Thanked 35,051 Times in 26,519 Posts
    Groans
    47,393
    Groaned 4,742 Times in 4,521 Posts
    Blog Entries
    61

    Default

    Quote Originally Posted by Niche Political Commentor View Post
    we fucking know tom, your son said what I said like 40 hours ago at this point
    You're a touchy arsehole, seem to have big ego issues. Who are you anyway, definitely not a newbie?

  12. #86 | Top
    Join Date
    Apr 2009
    Posts
    108,120
    Thanks
    60,501
    Thanked 35,051 Times in 26,519 Posts
    Groans
    47,393
    Groaned 4,742 Times in 4,521 Posts
    Blog Entries
    61

    Default

    Quote Originally Posted by Niche Political Commentor View Post
    we fucking know tom, your son said what I said like 40 hours ago at this point
    Quote Originally Posted by AProudLefty View Post
    Is it alcoholic if I just love beer?
    Depends on how much and how often. Well at least you've not graduated to spirits!
    Last edited by cancel2 2022; 12-29-2020 at 08:51 PM.

  13. #87 | Top
    Join Date
    Apr 2009
    Posts
    108,120
    Thanks
    60,501
    Thanked 35,051 Times in 26,519 Posts
    Groans
    47,393
    Groaned 4,742 Times in 4,521 Posts
    Blog Entries
    61

    Default

    Quote Originally Posted by Niche Political Commentor View Post
    we fucking know tom, your son said what I said like 40 hours ago at this point
    Quote Originally Posted by Legion View Post
    It's Grind, Tom.
    Ah well that would explain everything, obviously had a bad Xmas, did his mother force him to go to midnight Mass again?

    My son explained in a clear easily understandable way without all the extraneous bullshit and need to have his ego massaged. He's thinking about writing a Python how-to guide in Japanese for his fellow workers at Softbank.
    Last edited by cancel2 2022; 12-29-2020 at 09:15 PM.

  14. #88 | Top
    Join Date
    Nov 2013
    Location
    internet
    Posts
    759
    Thanks
    127
    Thanked 366 Times in 247 Posts
    Groans
    5
    Groaned 24 Times in 23 Posts

    Default

    Quote Originally Posted by Primavera View Post
    Ah well that would explain everything, obviously had a bad Xmas, did his mother force him to go to midnight Mass again?

    My son explained in a clear easily understandable way [..bunch of shit no one cares about]
    this is what your son said:

    Quote Originally Posted by Primavera View Post
    I contacted my son and he said this:
    The variable I is the value inside the array, not its index

    Hence it is wrong to write Plst[I]

    Instead it should be just I in the if statement
    hmm where have we heard that before

    Quote Originally Posted by Niche Political Commentor View Post

    OPs problem is doing the "if list[i] == 0" conditional
    Quote Originally Posted by Niche Political Commentor View Post

    Just do:

    for item in list:
    ----if item == 0:
    --------<other stuff goes here>
    Quote Originally Posted by Niche Political Commentor View Post

    if list[item] == 0: <--- don't do this

    rather than just simply using

    if item == 0:
    Quote Originally Posted by Niche Political Commentor View Post

    DO. NOT. USE. "if PLst[I] == 0" Don't. STOP!

    The conditional should be "if i == 0"
    Quote Originally Posted by Niche Political Commentor View Post

    do so by doing if element == x. Not if list[element] == x.
    Quote Originally Posted by Niche Political Commentor View Post
    his issue is wrongly trying to evaluate an element by doing if list[item] == 0
    NPC is a beloved internet personality. Their pronouns are he/him. NPC fully recognizes the inherent privilege of being able to post on a message board, and as such NPC makes sure to avoid all social media where the trust and safety council flags something as dangerous to think about. He avoids all tweets that are disputed, and only supports mainstream news sources where former CIA, NSA and FBI serve as talking heads.The future is female, orange man bad, black lives matter, and wear a damn mask!

  15. The Following User Groans At Niche Political Commentor For This Awful Post:

    cancel2 2022 (12-30-2020)

  16. #89 | Top
    Join Date
    Feb 2020
    Posts
    87,043
    Thanks
    35,071
    Thanked 21,785 Times in 17,104 Posts
    Groans
    985
    Groaned 2,344 Times in 2,263 Posts
    Blog Entries
    1

    Default

    Code:
    for i in JPPAssholes:
       print(i)
    What would the results be?

  17. #90 | Top
    Join Date
    Apr 2009
    Posts
    108,120
    Thanks
    60,501
    Thanked 35,051 Times in 26,519 Posts
    Groans
    47,393
    Groaned 4,742 Times in 4,521 Posts
    Blog Entries
    61

    Default

    Quote Originally Posted by Niche Political Commentor View Post
    we fucking know tom, your son said what I said like 40 hours ago at this point
    Quote Originally Posted by Niche Political Commentor View Post
    this is what your son said:



    hmm where have we heard that before
    Happy Xmas to you as well, did you get laid? I'm guessing not.

Similar Threads

  1. A Monty Python riddle for you......
    By Cancel 2020.2 in forum Off Topic Forum
    Replies: 0
    Last Post: 04-27-2020, 07:44 PM
  2. Replies: 2
    Last Post: 06-16-2018, 08:07 PM
  3. Monty Python meets Daesh
    By cancel2 2022 in forum Off Topic Forum
    Replies: 69
    Last Post: 01-13-2016, 06:00 PM
  4. 3 S.F. programmers build alternative to HealthCare.gov
    By StormX in forum Current Events Forum
    Replies: 17
    Last Post: 11-11-2013, 04:55 PM
  5. Pet Python Strangles Child, Officials Say
    By Demwit in forum Off Topic Forum
    Replies: 1
    Last Post: 07-01-2009, 07:39 PM

Bookmarks

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •