Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Compare Two Lists and Replace Items In a List by Index
Post: Compare Two Lists and Replace Items In a List by I...

I'm working on a problem in which I'd like to compare two lists of numbers: list_a = [0, 1, 2, 3] list_b = [4, -2, 3, -1]Then, I'd like to create a new list_c that transforms the list_a by examining ...
nagymusic General Coding Help 2 2,891 May-09-2020, 10:13 PM
    Thread: Pass Tuple as a Slice
Post: RE: Pass Tuple as a Slice

Thank you!
nagymusic General Coding Help 2 2,369 Dec-12-2019, 04:42 AM
    Thread: Pass Tuple as a Slice
Post: Pass Tuple as a Slice

I'd like to pass a tuple (2, 3) as a parameter value into a function (via array variable below), so that it replaces the slice value 2:3 in the third line. What would be the easiest way to achieve tha...
nagymusic General Coding Help 2 2,369 Dec-11-2019, 10:47 PM
    Thread: Round off floats in a list
Post: RE: Round off floats in a list

Thank you! That's it. I've learned a lot - so thank you once again!
nagymusic Homework 10 4,784 Apr-02-2019, 12:43 AM
    Thread: Round off floats in a list
Post: RE: Round off floats in a list

I understand. I should have asked if there's a way to modify the line 3 in post 6 so that the trailing decimal zero (.0) is removed from list_cleaned output. While the output in the revised code (post...
nagymusic Homework 10 4,784 Apr-01-2019, 12:05 PM
    Thread: Round off floats in a list
Post: RE: Round off floats in a list

Thank you very much for your help and advice! When I try to remove the trailing zeros using this code: list_cleaned = [str(s).rstrip('0').rstrip('.') for s in list_round] I get this output: list_cl...
nagymusic Homework 10 4,784 Apr-01-2019, 01:07 AM
    Thread: Round off floats in a list
Post: RE: Round off floats in a list

Thank you for your patience... and encouragement **wink**! I appreciate the opportunity to ask questions and learn on this forum. Here's what I managed so far. While I'm able to generate correct inte...
nagymusic Homework 10 4,784 Mar-31-2019, 05:59 PM
    Thread: Round off floats in a list
Post: RE: Round off floats in a list

Thank you for your reply. This is not homework. I'm working on a larger project in which I'm testing a transformation of strings. My apology for not being able to provide more information. I'm somewh...
nagymusic Homework 10 4,784 Mar-30-2019, 02:49 PM
    Thread: Round off floats in a list
Post: Round off floats in a list

Hello! I'm writing to ask how to round off the given list l = [0.0, 1.23, 1.68] so it reads as l = [0, 1, 1.5], with also having an option to round it off as l = [0, 1, 2]. Thank you!
nagymusic Homework 10 4,784 Mar-30-2019, 01:37 PM
    Thread: Compiling a Python Package on Windows
Post: RE: Compiling a Python Package on Windows

Many thanks for your advice. I did post a comment on their GitHub. Resetting the PC solved the problem. I'm still not sure what was the cause of this issue and why Python didn't want to compile the p...
nagymusic General Coding Help 2 3,634 Jan-29-2019, 12:08 AM
    Thread: Compiling a Python Package on Windows
Post: Compiling a Python Package on Windows

My apology if this may not be the right place to post my question. I recently had to update Windows 10 system on a Lenovo Yoga 910 laptop. Following the system update, I successfully installed Python ...
nagymusic General Coding Help 2 3,634 Jan-26-2019, 08:52 PM
    Thread: Replace element in a nested list
Post: RE: Replace element in a nested list

Thank you! This is very helpful.
nagymusic General Coding Help 4 17,892 Nov-19-2018, 06:24 PM
    Thread: Replace element in a nested list
Post: Replace element in a nested list

I’m writing to ask if you could help me with a short Python example. Here’s a list of the list of strings: my_string = [[89, 111, 117, 32], [104, 97, 118, 101, 32], [109, 97, 100, 101, 32], [109, 121...
nagymusic General Coding Help 4 17,892 Nov-19-2018, 06:08 PM

User Panel Messages

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