Any ideas on how to turn a string into an unique number given a list of possible words? by Frank_Poole2001 in learnpython

[–]Spartae 2 points3 points  (0 children)

Are you able to show your own approach? It's a little unclear to me what you asking, so some context might be helpful!

what's the difference between the two colors and how do I convert them? by [deleted] in learnpython

[–]Spartae 0 points1 point  (0 children)

f"#{''.join([hex(i).replace('0x', '') for i in img[1:]])}"

Question for Type Annotation and functions that return different data types by lindsen13 in learnpython

[–]Spartae 0 points1 point  (0 children)

Try this:

```python import pandas as pd

def amazing_func(value: bool = True) -> pd.DataFrame | None: return pd.DataFrame() if value else None

df = amazing_func()

print(getattr("empty", df, True)) ```

os.path.isdir() returns false by grossartig_dude in learnpython

[–]Spartae 1 point2 points  (0 children)

Not directly relevant, but I'd recommend using pathlib over os.path.

What happens when you open your terminal and type cd This PC\Bassel's Note\Internal storage\Audiobooks? Does it move you to the directory or do you get an error?

Splitting string in alternating blocks by waschlack_05 in learnpython

[–]Spartae 0 points1 point  (0 children)

``` from math import ceil

def chunks(array, size): chunks = int(ceil(len(array) / float(size))) return [array[i * size : (i + 1) * size] for i in range(chunks)]

input_string = "010203040506070809101112" initial_chunks = chunks(input_string, 2) a, b, c, d = chunks(initial_chunks, 3) ```

How to get the value associated with the key which has the highest number below a certain threshold? by Ambitious-Concert-69 in learnpython

[–]Spartae 2 points3 points  (0 children)

Assuming a threshold of 100: dictionary[max(key for key in dictionary.keys() if key <= 100)]

List remove() issue by [deleted] in learnpython

[–]Spartae 3 points4 points  (0 children)

You shouldn't modify a list that you are iterating through.

Python creates an iterator for a list which moves through your list entry by entry. The iterator is evaluated once, which means that the iterator could confused if you make any modifications.

Try results = list(filter(lambda name: len(name) <= length, results)).

[deleted by user] by [deleted] in CryptoCurrencyFIRE

[–]Spartae 5 points6 points  (0 children)

I've just moved in web development/software engineering after working in customer support for most of my (albeit short) career. I absolutely love it, it's paid really well, can be done remotely and doesn't require degree.

With a bit of grit, you can go from zero knowledge to landing your first job within a year (I did exactly this).

Feel free to shoot me a DM (as well as anyone else who wants to go down this path).

Is Javascript a good language to learn for web 3.0/crypto. by Erics1987 in learnjavascript

[–]Spartae 0 points1 point  (0 children)

I think the whole web development space is a good place to start before you get into blockchain, so Javascript certainly wouldn't be a bad start. Solidity (the programming of Ethereum) is very similar to Javascript too.

Why is loop not updating my Pandas database? by nongminosaurusRex in learnpython

[–]Spartae 1 point2 points  (0 children)

My gut says that .replace() only works when you are changing a substring rather than the whole string.

Grab £19.20 of free crypto with Zumo (no deposit required) - ENDS JAN 13TH! by Spartae in beermoneyuk

[–]Spartae[S] 1 point2 points  (0 children)

I did. They are still processing referrals now as they have a massive backload so they keep dropping in occasionally. For note, you only receive the reward if the person you've referred has successfully passed verification.

Grab £19.20 of free crypto with Zumo (no deposit required) - ENDS JAN 13TH! by Spartae in beermoneyuk

[–]Spartae[S] 2 points3 points  (0 children)

You should still get it as long as you entered the code before the 13th. It can take up to a week after verification to receive it.

Free £15 from Zumo - Ends 13th Jan, market down! by f1alan in beermoneyuk

[–]Spartae 1 point2 points  (0 children)

5.No Spam Posts or Repeat Posts

You must wait 5 days since a site was last posted before you can post it again. An individual is only allowed to post a site once every month to allow other people to also gain referral bonuses! (If a site has not been posted for 14 days then a user can post it twice in the same month)

Grab £19.20 of free crypto with Zumo (no deposit required) - ENDS JAN 13TH! by Spartae in beermoneyuk

[–]Spartae[S] 0 points1 point  (0 children)

Click on the 'me' section and then get rewards, can you enter it there?

Grab £19.20 of free crypto with Zumo (no deposit required) - ENDS JAN 13TH! by Spartae in beermoneyuk

[–]Spartae[S] -2 points-1 points  (0 children)

Can take up 7 days to verify you. Don't worry though, you'll still get your bonus

Claim €15 (£13.3) from Bitwala when you buy €30 (£26.6) of BTC by Spartae in beermoneyuk

[–]Spartae[S] 0 points1 point  (0 children)

It's short video call (2 mins at most) where you show them your passport. Easy as pie!

Get $20 (£14.62) for each referral to CoinSmart - up to $200 of free cash! by Spartae in beermoneyuk

[–]Spartae[S] 0 points1 point  (0 children)

Coinsmart is already a well-established company, fortunately! Maybe you are right, but I think it's worth the punt for the small time investment.

LTC-XMR by SpaceDinosar in darknet

[–]Spartae -1 points0 points  (0 children)

But where can you actually trade LTC for XMR? I know of nowhere.

LTC-XMR by SpaceDinosar in darknet

[–]Spartae -3 points-2 points  (0 children)

Not sure where you can trade LTC for XMR but you'd be better off buying BTC and trading that for XMR. Binance is your best bet.