#voice-chat-text-0

1 messages · Page 768 of 1

faint ermine
runic forum
#

e!

printf('Hello world!')
faint ermine
#
for child in reversed(list(ast.iter_child_nodes(parent))):
    if not isinstance(child, ast.FunctionDef)\
        or child.name != fn_name\
        or not hasattr(child, 'decorator_list')\
        or len([ 
            dec 
            for dec in child.decorator_list 
            if dec.id == 'reloading' ]) < 1:
#
    # find the parent of the function definition so that we can find out
    # where the function definition ends by using the starting line
    # number of the subsequent child after the function definition
zealous wave
#

dunno how ima do this but im gonna try

terse needle
runic forum
#

!e ```py
print("Hello World!");

flint hill
#

Omg face reveal

#

@whole rover nice face cam

faint ermine
#

!help remind

wise cargoBOT
#
Command Help

!remind [mentions]... <expiration> <content>
Can also use: reminder, reminders, remindme

Commands for managing your reminders.

Subcommands:

!remind delete <id_>
Delete one of your active reminders.
!remind edit
Commands for modifying your current reminders.
!remind list
View a paginated embed of all reminders for your user.
!remind new [mentions]... <expiration> <content>
Set yourself a simple reminder.

faint ermine
#

!remind new 165023948638126080 1h maybe remove video role from 706572768858210367

wise cargoBOT
#
Of course!

Your reminder will arrive in 1 hour and will mention 1 other(s)!

craggy zephyr
#

Hi @somber heath

#

Need your help dude

#

have a look on it

runic forum
#

can i have Video Role @whole rover

whole bear
#

Hi guys

somber heath
#

@craggy zephyr Is there a particular question about Python that you have?

whole rover
#

new error pages

whole bear
#

Hi OpalMist

somber heath
#

Yello.

whole rover
#

am heading out for 5 minutes so no video roles until I get home

whole bear
#

Long time no see

#

Where have you been OpalMist?

somber heath
#

Often around.

whole bear
#

Ok, How is life?

somber heath
#

Continuing.

whole bear
#

Same here but aimless.

terse needle
#
roman = {
'M': 1000,
'CM': 900,
'D': 500,
'CD': 400,
'C': 100,
'XC': 90,
'L': 50,
'XL': 40,
'X': 10,
'IX': 9,
'V': 5,
'IV': 4,
'I': 1
}

number = {
1000: 'M',
900: 'CM',
500: 'D',
400: 'CD',
100: 'C',
90: 'XC',
50: 'L',
40: 'XL',
10: 'X',
9: 'IX',
5: 'V',
4: 'IV',
1: 'I'
}

class RomanNumerals:
    
    def to_roman(n: int):
        result = []

        while n: 
            for i in number.keys():
                if n >= i:
                    n -= i
                    result.append(number.get(i))
                    break

        return ''.join(result)
        
        
    def from_roman(n: str):
        total = 0
        offset = 0
        for i in range(len(n)):
            i += offset

            try:
                if roman.get(n[i]) < roman.get(n[i+1]):
                    total += roman.get(n[i:i+2])
                    offset += 1

                else:
                    total += roman.get(n[i])

            except IndexError:
                try:
                    total += roman.get(n[i])
                    
                except IndexError:
                    ...
                
                    
        return total    
uncut meteor
#

!e

from enum import Enum
from functools import reduce

class RomanNumerals:
    class Numerals(Enum):
        I = 1
        V = 5
        X = 10
        L = 50
        C = 100
        D = 500
        M = 1000

        def __gt__(self, other):
            return self.value > other.value

    @classmethod
    def to_roman(cls, num: int) -> str:
        t = []
        while num > 0:
            for numeral in reversed(cls.Numerals):
                if num // numeral.value >= 1:
                    num -= numeral.value
                    t.append(numeral)
                    break
        return ''.join(u.name for u in t)

    @classmethod
    def from_roman(cls, string: str) -> int:
        partition = [[cls.Numerals[string[0]]]]

        for char in string[1::]:
            if (s := cls.Numerals[char]) > partition[-1][-1]:
                partition[-1].append(s)
            else:
                partition.append([s])
        return sum(reduce(lambda x, y: x - y, reversed([p.value for p in part])) for part in partition)


# assert RomanNumerals.to_roman(1000) == 'M', '1000 should == "M"'
# assert RomanNumerals.to_roman(1990) == 'MCMXC', '1990 should == "MCMXC"'

assert RomanNumerals.from_roman('XXI') == 21, 'XXI should == 21'
assert RomanNumerals.from_roman('MMVIII') == 2008, 'MMVIII should == 2008'
assert RomanNumerals.from_roman('MCMXXIII') == 1923, 'MCMXXIII should == 1923'

wise cargoBOT
#

@uncut meteor :warning: Your eval job has completed with return code 0.

[No output]
faint ermine
#

@thorn geyser

zealous wave
#

!e ```py
def unique_in_order(iterable):
iterable = list(iterable)

for i in enumerate(iterable):
    print(i)

unique_in_order([1, 2, 3, 4])

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

001 | (0, 1)
002 | (1, 2)
003 | (2, 3)
004 | (3, 4)
zealous wave
#

!e ```py
import dis

dis.dis("""
def unique_in_order(iterable):
iterable = list(iterable)

for i in enumerate(iterable):
    print(i)

unique_in_order([1, 2, 3, 4])""")

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

001 |   2           0 LOAD_CONST               0 (<code object unique_in_order at 0x7efc2b0b4920, file "<dis>", line 2>)
002 |               2 LOAD_CONST               1 ('unique_in_order')
003 |               4 MAKE_FUNCTION            0
004 |               6 STORE_NAME               0 (unique_in_order)
005 | 
006 |   8           8 LOAD_NAME                0 (unique_in_order)
007 |              10 BUILD_LIST               0
008 |              12 LOAD_CONST               2 ((1, 2, 3, 4))
009 |              14 LIST_EXTEND              1
010 |              16 CALL_FUNCTION            1
011 |              18 POP_TOP
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/aganujufol.txt

faint ermine
paper tendon
#

Peep PEP

#

🙂

runic forum
#

balding programmers...

paper tendon
#

AST rewrite 🙂

terse needle
terse needle
faint ermine
icy axle
faint ermine
halcyon relic
#

hello

thin breach
#

my teammates are slacking off

icy axle
#
@decorator
def function():
    ...
def function():
    ...

function = decorator(function)
faint ermine
#
@decorator()
def function():
    ...
icy axle
#
@reload
def function():
    ...
#
@reload(10)
def function():
    ...
faint ermine
#
from functools import partial

def reloading(*args, **kwargs):
    if len(args) > 0:
        print(args[0], kwargs)
    else:
        return partial(reloading, **kwargs)

@reloading
def a():
    pass

@reloading(reload_after=1)
def a():
    pass
wise cargoBOT
#

@faint ermine @whole rover

It has arrived!

Here's your reminder: maybe remove video role from 706572768858210367.
[Jump back to when you created the reminder](#voice-chat-text-0 message)

icy axle
#

!e ```py
from functools import partial

partial(print, "hello")()

wise cargoBOT
#

@icy axle :white_check_mark: Your eval job has completed with return code 0.

hello
icy axle
#
from functools import lru_cache

@lru_cache(max_size=2)
def first_letter(word):
    return word[0]

first_letter("hey")    # Not cached
first_letter("you")    # Not cached
first_letter("there")  # Not cached
first_letter("hey")    # Not cached
first_letter("there")  # Cached
runic forum
#

im humming

faint ermine
terse needle
uncut meteor
#

^ send link

tall latch
#

helloWorld

terse needle
pale marsh
#

anyone want to play chess?

zealous wave
terse needle
#

and set the first letter to lowercase

#

unless the input has an uppercase on char. 0

icy axle
zealous wave
#

!e ```py
word1 = "Hello"
word2 = ", World!"

print(''.join(f"this works! {word1}{word2}"))

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

this works! Hello, World!
icy axle
#
hello {name}!
gentle flint
#

somehow I managed to snap an oar in half today

uncut meteor
#

oar-no!

gentle flint
#

that is terrible

#

@rugged root is it catching?

pale marsh
#

where you kayaking?

gentle flint
#

the terrible dad jokes I mean

gentle flint
#

I store it under my bed

#

and one of the slats in the bed came down and snapped the oar

pale marsh
#

oh ok

runic forum
#

mann i was gone a while... tell me what i missed?

gentle flint
#

you missed a broken oar

pale marsh
#

It was kind of a boat-deal

zealous wave
#

it doesnt look that bad in use

#
 embed = EmbedHelper(title=f"{guild.name.title()}'s Info",
                            timestamp=datetime.utcnow(),
                            description=textwrap.dedent(f"""
                            **Owner:** {owner.mention}
                            **Created At:** {created}
                            **Emojis:** {emojis}
                            **Roles:** {num_roles}
                                    """),

                            thumbnail_url=guild.icon_url,

                            footer_text=f"Command Invoked by {ctx.author}",
                            footer_url=ctx.author.avatar_url,

                            fields=[
                                {"name": f"**Member Count:**", "value": value1},
                                {"name": "**Presences**", "value": value2},
                                {"name": f"**Total Channel Count:** {len(guild.channels)}", "value": value3, "inline": False}
                            ]
                            )
uncut meteor
#
 embed = EmbedHelper(title=f"{guild.name.title()}'s Info",
                            timestamp=datetime.utcnow(),
                            description=textwrap.dedent(f"""
                                **Owner:** {owner.mention}
                                **Created At:** {created}
                                **Emojis:** {emojis}
                                **Roles:** {num_roles}
                            """),

                            thumbnail_url=guild.icon_url,

                            footer_text=f"Command Invoked by {ctx.author}",
                            footer_url=ctx.author.avatar_url,

                            fields=[
                                {"name": f"**Member Count:**", "value": value1},
                                {"name": "**Presences**", "value": value2},
                                {"name": f"**Total Channel Count:** {len(guild.channels)}", "value": value3, "inline": False}
                            ]
                            )
gentle flint
#

perhaps somewhat offtopic for a python server

zealous wave
#

!e ```py
import functools
System = type('System', (), {'out': type('out', (), {'println': print, 'print': functools.partial(print, end='')})})
System.out.println('lol')

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

lol
runic forum
icy axle
runic forum
#

but whatever i guess 🤷‍♂️

whole bear
#

yeh blind

uncut meteor
#

!doc str.split

wise cargoBOT
#
str.split(sep=None, maxsplit=-1)```
Return a list of the words in the string, using *sep* as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, the list will have at most `maxsplit+1` elements). If *maxsplit* is not specified or `-1`, then there is no limit on the number of splits (all possible splits are made).

If *sep* is given, consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, `'1,,2'.split(',')` returns `['1', '', '2']`). The *sep* argument may consist of multiple characters (for example, `'1<>2<>3'.split('<>')` returns `['1', '2', '3']`). Splitting an empty string with a specified separator returns `['']`.

For example:... [read more](https://docs.python.org/3/library/stdtypes.html#str.split)
terse needle
#

!e

def prnt(text: str):
  print(text)

prnt('Hello World')
wise cargoBOT
#

@terse needle :white_check_mark: Your eval job has completed with return code 0.

Hello World
zealous wave
#

(lambda b, cls: b.add_cog(cls(bot)))(bot, yourclass)

#

isnt this a nice setup func?

runic forum
#

where's joe btw??

uncut meteor
#
import re

def to_camel_case(text):
    result = re.split("[_,-]", text)
    return result[0] + ''.join(char.capitalize() for char in result[1::])

i need to use Regex more @terse needle

tall latch
runic forum
#

i mean really?

uncut meteor
#

@terse needle let me know the next one

terse needle
#
def to_camel_case(text):
    
    text_array = []
    
    text_array = text.replace('-',',').replace('_',',').split(',')

    if text:
        PascalCase = ''.join([i[0].upper()+i[1:].lower() for i in text_array])
        
        if text[0].islower(): camelCase = PascalCase[0].lower() + PascalCase[1:]
        else: camelCase = PascalCase
        
    else:
        camelCase = ''
        
    return camelCase     
faint ermine
#

!pep -8

wise cargoBOT
#
PEP not found

PEP -8 does not exist.

uncut meteor
#

!pep negative8

wise cargoBOT
#
Bad argument

Converting to "int" failed for parameter "pep_number".

#
Command Help

!pep <pep_number>
Can also use: get_pep, p

Fetches information about a PEP and sends it to the channel.

tall latch
gentle flint
#

I don't game in bed

#

I game in a chair

zealous wave
#

!e ```py
def trueinvert(num : int):
return int(f"-{num}")

print(9.invert())
print(trueinvert(9))

wise cargoBOT
#

@zealous wave :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 4
002 |     print(9.__invert__())
003 |             ^
004 | SyntaxError: invalid syntax
zealous wave
#

wait let me fix this

uncut meteor
#

int(9).__

#

or it will think float

tall latch
#

??

zealous wave
#

!e ```py
def trueinvert(num : int):
return int(f"-{num}")

print([].class.name.str().len().add([1].class.name.str().len()).invert())

print(trueinvert([].class.name.str().len().add([1].class.name.str().len())))

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

001 | -9
002 | -8
zealous wave
#

!e ```py
print([].class.name.str().len().add([1].class.name.str().len()))

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

8
tall latch
#

reaction loop

zealous wave
#

!e ```py
print([].class.name.str().len().add([1].class.name.str().len()))

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

8
zealous wave
#

!e ```py
print([].len().bool().class.name.str().len().add([1].len().bool().class.name.str().len()))

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

8
zealous wave
#

why

#

ffs

#

!e ```py
print(bool(len([])))

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

False
zealous wave
#

!e ```py
print(bool(len([1])))

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

True
uncut meteor
#

!e

print([].__class__.__name__.__str__().__len__().__add__(float((True is False)+.1).__class__.__name__.__str__().__len__()))
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

9
zealous wave
#

so its different

uncut meteor
#

ur different

zealous wave
#

!e ```py
four = [1].len().bool().str().len()

print(four)

gentle flint
#

no u

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

4
gentle flint
#

also, flexing nitro much huh

zealous wave
#

!e ```py
nine = [1].len().bool().str().len().add([].len().bool().str().len())

print(nine)

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

001 | 4
002 | 5
tall latch
#

SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

zealous wave
#

!e ```py
nine = [1].len().bool().str().len().add([].len().bool().str().len())

print(nine)

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

9
tall latch
#

proImage = Image.open(fp="C:\Users\JERSON\Videos\FabCode resources\FabTech Logo.png", mode="RGB")

uncut meteor
#

!e

nine = len(str(bool(len([1])))) + len(str(bool(len([]))))

print(nine)
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

9
zealous wave
#

!e ```py
def trueinvert(num : int):
return int(f"-{num}")

print(trueinvert([1].len().bool().str().len().add([].len().bool().str().len())))

print([1].len().bool().str().len().add([].len().bool().str().len()).invert())

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

001 | -9
002 | -10
zealous wave
#

see

#

invert doesnt properly invert

uncut meteor
#

!e

def trueinvert(num : int):
  return int(f"-{num}")

print(trueinvert(9))

print(int(9).__invert__())
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

001 | -9
002 | -10
uncut meteor
#

oof

zealous wave
#
File "/Users/8586/PycharmProjects/Magoji-Chili-Branch/cogs/moderation/moderation.py", line 30, in kick
    raise commands.MissingPermissions("You cant kick someone who is higher or has the same role as you")
discord.ext.commands.errors.MissingPermissions: You are missing Y, O, U,  , C, A, N, T,  , K, I, C, K,  , S, O, M, E, O, N, E,  , W, H, O,  , I, S,  , H, I, G, H, E, R,  , O, R,  , H, A, S,  , T, H, E,  , S, A, M, E,  , R, O, L, E,  , A, S,  , Y, O, and U permission(s) to run this command.

```  bro im only doing this ```py
raise commands.MissingPermissions("You cant kick someone who is higher or has the same role as you")
uncut meteor
#

You cant

#

me irl fighting a cockroach

gentle flint
#

tf

whole bear
#

kam

uncut meteor
#

@terse needle where is the next code wars?

terse needle
#

i tried

from itertools import permutations

def sum_arrangements(num):
    print(num)
    return sum([int(''.join(i)) for i in iter(permutations(str(num)))])
``` but too slow
uncut meteor
#

!docs itertools.permutations

wise cargoBOT
#
itertools.permutations(iterable, r=None)```
Return successive *r* length permutations of elements in the *iterable*.

If *r* is not specified or is `None`, then *r* defaults to the length of the *iterable* and all possible full-length permutations are generated.

The permutation tuples are emitted in lexicographic ordering according to the order of the input *iterable*. So, if the input *iterable* is sorted, the combination tuples will be produced in sorted order.

Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat values in each permutation.

Roughly equivalent to:... [read more](https://docs.python.org/3/library/itertools.html#itertools.permutations)
gentle flint
#

Yery, Yeru, Ery or Eru (Ы ы; italics: Ы ы), usually called Ы [ɨ] in modern Russian or еры yerý historically and in modern Church Slavonic, is a letter in the Cyrillic script. It represents the close central unrounded vowel /ɨ/ (more rear or upper than i) after non-palatalised (hard) consonants in the Belarusian and Russian alphabets.
The letter...

tall latch
#

i have no freaking idea what is wrong File "pillowtest.py", line 3 filename = "C:\Users\JERSON\Videos\FabCode resources\FabTech Logo.png" ^ SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

whole bear
#

me too

#

brb

tall latch
#

can i not declare vars

terse needle
gentle flint
zealous wave
gentle flint
gentle flint
vivid palm
#

LOL

#

appreciated

uncut meteor
#

@terse needle Next Codewars?

gentle flint
#

nobody ever seems to know the lyrics of the polish cow song

terse needle
tall latch
#

i am getting an error saying images do not match

uncut meteor
#

show error

tall latch
uncut meteor
#

just

#

copy paste it

tall latch
#
  File "C:\Users\JERSON\Desktop\Bot Bakers\Bakery Bot\pillowtest.py", line 11, in <module>
    newImage.paste(proImage, (10, 10, 80, 80))
  File "C:\Users\JERSON\AppData\Local\Programs\Python\Python38\lib\site-packages\PIL\Image.py", line 1506, in paste
    self.im.paste(im, box)
ValueError: images do not match
[Finished in 0.8s with exit code 1]```
uncut meteor
#

what is the size of newImage

zealous wave
tall latch
#

malayalam

vivid palm
#

There are, however, certain circumstances in which we may share your information with certain third parties, as set forth below:

#

insert long list here

zealous wave
#

nvm

terse needle
#

No Sale of Personal Information: The CCPA sets forth certain obligations for businesses that sell personal information. We do not sell the personal information of our users. https://discord.com/privacy

vivid palm
#

Aggregated or Non-identifiable Data: We may also share aggregated or non-personally identifiable information with our partners or others for business purposes.

#

what does that sound like to you lol

tall latch
#

@worldly pollen welcome home

terse needle
#

Discord does not sell the personal information of our users to third parties, this is not applicable.

zealous wave
late spoke
#

!voiceverify

zealous wave
wise cargoBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

tall latch
#

who else watch youtube video and listen to music at same time

late spoke
#

!voice

#

I seem to meet all the criteria

vivid palm
#

you can try leaving and re-entering?

zealous wave
#
        if num % 2 != 0:
            # is odd
terse needle
#
if n&1:
  # is odd
late spoke
#

hmm.. maybe I don't have 50 text messages

#

how can I check

runic forum
#

so what are you doing right now @icy axle

tall latch
late spoke
#

!voice_verify

#

!voiceverify

terse needle
#
             1
          3     5
       7     9    11
   13    15    17    19
21    23    25    27    29
...
late spoke
#

Those commands do nothing

zealous wave
#

!e ```py
def row_sum_odd_numbers(n):
for num in range(0, n+1):
if num % 2 != 0:
print(num)

row_sum_odd_numbers(30)

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 3
003 | 5
004 | 7
005 | 9
006 | 11
007 | 13
008 | 15
009 | 17
010 | 19
011 | 21
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/azegasigeh.txt

vivid palm
uncut meteor
#
def row_sum_odd_numbers(n):
    s = sum(range(n))
    return sum(range(1, 13371337, 2)[s:s+n])

#

@terse needle let me know the next one

terse needle
#

will do when i solve this myself

uncut meteor
#

gl

terse needle
#

yeah

uncut meteor
#

@zealous wave u bad

terse needle
#

looking at the rows they end at 2, 6, 12, 20, 30, it increases by 4 everytime

#

4n-2 should allow me to calculate where it ends

tall latch
#

i wanna give it a bit of a padding

zealous wave
#

@terse needle have you figured out how to create the triangle yet?

terse needle
#

yes

#

kinda

#

row = lambda n: sum([i for i in range( ((4*n)-2) +1) if i&1]) not quite right but almost

zealous wave
#

would you mind helping me out with that

tall latch
uncut meteor
zealous wave
#
triangle = [[1], [3, 5], [7, 9, 11], [13, 15,  17, 19], [21, 23, 25, 27, 29]]


def row_sum_odd_numbers(n):
    index = n-1

    return sum(triangle[index])
uncut meteor
#
def row_sum_odd_numbers(n):
    s = sum(range(n))
    return sum(range(1, float("inf"), 2)[s:s+n])
cold bison
zealous wave
#

fuck this shit im just using this ```py
row_sum_odd_numbers = lambda n: sum(range(1, 1000000, 2)[sum(range(n)):sum(range(n))+n])

terse needle
#

!wa

#

!wolframalpha

cold bison
uncut meteor
#
             1
          3     5
       7     9    11
   13    15    17    19
21    23    25    27    29
...
strong arch
#
def row_sum_odd_numbers(n):
    num = 2*sum(range(n)) + 1
    tot = 0
    for _ in range(n):
        tot += num
        num += 2
    return tot
uncut meteor
#
def sum_of_odd_triangle(n):
  """
  n -> index
  """
  # Return the sum of the nth row
zealous wave
#
row_sum_odd_numbers = lambda n: n ** 3
terse needle
#

n + n^2

uncut meteor
#
def row_sum_odd_numbers(n):
    s = sum(range(n))
    return sum(range(1, 13371337, 2)[s:s+n])
zealous wave
#
row_sum_odd_numbers = lambda n: sum(range(1, 1000000, 2)[sum(range(n)):sum(range(n))+n])
potent torrent
#

what website is this

whole bear
#
n = int(input('n: '))
ans = 0
for i in range(1, n):
    if i%3==0 or i%5==0:
        ans+=i
print(ans)
zealous wave
#
def solution(number):
    nums = []
    for num in range(0, number+1):
        if num % 3 == 0 and num % 5 == 0:
            nums.append(num)
            
    return num
grim fossil
#

if anyone can help me with urllib3 pool stuff in in code/help 0

strong arch
#
module MultiplesOf3And5 where

solution :: Integer -> Integer
solution number = sum (filter (\x -> (mod x 5 == 0) || (mod x 3 == 0)) [0..number-1])
icy axle
#

::

terse needle
#
def solution(number):
    return sum([i for i in range(number) if not i % 3 or not i % 5])
uncut meteor
#
def solution(number):
    return sum(n for(n)in range(1,number)if(not(n%3))or(not(n%5)))
zealous wave
gentle flint
uncut meteor
#
def pig_it(text):
    return ' '.join(f"{word[1::]}{word[0]}ay" for word in text.split())
gentle flint
#

izi

strong arch
#
def narcissistic( value ):
    pow = len(str(value))
    return sum([int(i)**pow for i in str(value)]) == value
zealous wave
gentle flint
#

sur-marine

#

opposite of submarine

uncut meteor
#
def digital_root(n):
    if n < 10:
        return n
    return digital_root(sum(int(char) for char in str(n)))
whole bear
#
def Root(n):
    sum = 0
    for i in str(n):
        sum+=int(i)
    if len(str(sum)) == 1:
        return sum
    else:
        return Root(sum)
strong arch
#
def digital_root(n):
    while n > 9:
        n = sum(int(i) for i in str(n))
    return n
uncut meteor
#

@zealous wave where next?

zealous wave
strong arch
#
def find_it(seq):
    for num in set(seq):
        count = 0
        for i in seq:
            if i == num: count += 1
        if count % 2 == 1:
            return num
zealous wave
#
def find_it(seq):
    return [x for x in seq if seq.count(x) % 2][0]
gentle flint
#

@zealous wave oi

#

invite

#

naow

#

oh

#

no

#

I shall not.

#

I refooz

#

I defy it!

#

what if it has a data leak

uncut meteor
#

lol

#

what wuld it leak?

#

a used connection token

strong arch
zealous wave
strong arch
icy axle
#

Well, I won't hear much

#

Because headphones died

#

But still

zealous wave
#

!e ```py
print(list(builtins.dict).index('eval'))

wise cargoBOT
#

@zealous wave :white_check_mark: Your eval job has completed with return code 0.

19
honest pier
grim fossil
#

this error

The system cannot find the file file:///C:\Program Files\JetBrains\PyCharm Community Edition 2020.3.3\jbr\bin\www.nasdaq.com.

while attempting a

html_file = certs.request('GET', url, timeout = 1)

it fails because the timeout is low, but in the run tab it has a link for wwww.nasdaq.com , when you click it you get this error

strong arch
honest pier
#

!default

wise cargoBOT
#
Did you mean ...

mutable-default-args
defaultdict

honest pier
#

!mutable-default-args

wise cargoBOT
#

Mutable Default Arguments

Default arguments in python are evaluated once when the function is
defined, not each time the function is called. This means that if
you have a mutable default argument and mutate it, you will have
mutated that object for all future calls to the function as well.

For example, the following append_one function appends 1 to a list
and returns it. foo is set to an empty list by default.

>>> def append_one(foo=[]):
...     foo.append(1)
...     return foo
...

See what happens when we call it a few times:

>>> append_one()
[1]
>>> append_one()
[1, 1]
>>> append_one()
[1, 1, 1]

Each call appends an additional 1 to our list foo. It does not
receive a new empty list on each call, it is the same list everytime.

To avoid this problem, you have to create a new object every time the
function is called:

>>> def append_one(foo=None):
...     if foo is None:
...         foo = []
...     foo.append(1)
...     return foo
...
>>> append_one()
[1]
>>> append_one()
[1]

Note:

• This behavior can be used intentionally to maintain state between
calls of a function (eg. when writing a caching function).
• This behavior is not unique to mutable objects, all default
arguments are evaulated only once when the function is defined.

grim fossil
#
Failed to process the request, Exception:HTTPSConnectionPool(host='www.nasdaq.com', port=443): Max retries exceeded with url: /market-activity/stocks/NHI/dividend-history (Caused by ReadTimeoutError("HTTPSConnectionPool(host='www.nasdaq.com', port=443): Read timed out. (read timeout=8)"))
zealous wave
grim fossil
#

<urllib3.response.HTTPResponse object at 0x00000075914BA340>

icy axle
zealous wave
sinful bramble
zealous wave
#

Why would you use regex for this?

gentle flint
#

brrr

whole bear
#

m i being featured in the stream?

sinful bramble
icy axle
#

Yes

whole bear
#

yo!

sinful bramble
#

oh wait maybe i just use split

#

damn i forgot

whole bear
#

yayayaya

gentle flint
whole bear
#

ofc

sinful bramble
#

no. youre just a gurkan

whole bear
#

what is gurkan

sinful bramble
#

hmmm maybe i can use a tree here

warm prism
#

wats going on in vc

gentle flint
#

vocal communication

warm prism
#

sick

whole bear
#

my headphone is screaming "oops battery low" everytime u r saying something

thorny ocean
#

lol does it mean cucumber in the context you're using it or something else..

whole bear
#

battery died ;/

icy axle
#

:(

icy axle
sinful bramble
#

oh no

#

i like your deep voice though

whole bear
thorny ocean
#

but what, the suspense is killing me

icy axle
sinful bramble
#

VEsler

warm prism
icy axle
gentle flint
thorny ocean
#

cucumbers

sinful bramble
#

something happened

#

and then it happened

#

and he made a server :((

#

yes

loud orbit
green bone
#

@icy axle What's with all the lambdas in yellow circles?

#

it is

#

.randomcase no it's not a lambda, it's Swedish not Greek, boo hoo

viscid lagoonBOT
#

nO IT's not A lamBda, iT'S SWediSH nOT GreEK, BOO Hoo

green bone
#

A of course @icy axle

#

that's what she said

gentle flint
#

@icy axle

sinful bramble
#

doxxxx!

#

YES CATS

#

yes gust---

icy axle
gentle flint
#

vestergurcat

sinful bramble
#

youve been doxxing yaself

warped saffron
#

Nani!?!?!

sinful bramble
#

lol

#

i like cats because they just stay there and leave u if they feel like it

olive hedge
#

That is why I do not like cats as much

uncut meteor
#

tryna go 4d?

gentle flint
sinful bramble
warm prism
#
ArtStation

Ive been making banners and other renders for about 2 years. Ive experinced photoshop for a total of 2 years I have enough under my belt to give people good quality banners at very cheap prices.

sinful bramble
#

oh lol weird chess

gentle flint
#

are we ready?

#

right we starting

sinful bramble
#

i am lollipop

strong arch
gentle flint
#

naval ensign:

sinful bramble
#

wHAT

gentle flint
#

WHAT THE ACTUAL FUCK

#

a yellow eiffel tower

olive hedge
uncut meteor
#

*fromage

olive hedge
#

.randomcase its the Eiffel tower

viscid lagoonBOT
#

its THe EIFFeL tower

uncut meteor
#

.randomcase Chedda

viscid lagoonBOT
#

cHEdda

gentle flint
#

ItS ThE EiFfEl tOwEr

olive hedge
#

!otn a eiffel cheese tower

wise cargoBOT
#

:ok_hand: Added eiffel-cheese-tower to the names list.

sinful bramble
#

oh lol

olive hedge
#

@amber raptor you having some audio troubles there?

amber raptor
#

I was

#

Part of the issue is my internet seems to fast for Discord

#

like Discord gets connected to WebRTC before RTC server is ready for it

#

so I'm connected but nothign comes

#

it's working now

olive hedge
#

oh no :C

#

oh yay C:

sinful bramble
#

wth

amber raptor
uncut meteor
#

4ms!?

honest pier
#

@olive hedge

uncut meteor
#

my brain has like a 20ms delay

olive hedge
uncut meteor
#

probs higher

amber raptor
#

I'm on East Coast, Fiber optics, and hardwired in

honest pier
olive hedge
#

I no understand

honest pier
#

@olive hedge 👀

gentle flint
#

87 ms here

#

from Europe

sinful bramble
#

bagel lol

sinful bramble
gentle flint
#

hairy bagel, hmmm

honest pier
olive hedge
#

this means nothing to me

honest pier
olive hedge
#

LOL, I might be war thundered out for the day.

honest pier
#

😔

gentle flint
sinful bramble
#

eifel tower again

#

wtf

gentle flint
#

*eiffel

olive hedge
#

eefeil

honest pier
#

@sinful bramble the real reneganronin 👀

sinful bramble
#

i suck

sinful bramble
honest pier
#

:o

rich hollow
#

guys i can't speak

#

why?

honest pier
#

!voice @rich hollow

wise cargoBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

rich hollow
#

what?

sinful bramble
#

wrong spelling lol

rich hollow
#

how ?

#

please tel me

honest pier
#

did you read the tag

rich hollow
#

1315

#

this is the tag

honest pier
#

no, the embed

rich hollow
#

LECOLA#1315

#

guysssss

gentle flint
#

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

olive hedge
sinful bramble
#

i dont have a mouse xD

uncut meteor
#

#voice-verification

sinful bramble
#

bebi

warm prism
uncut meteor
#

brb

uncut meteor
#

Code: WQYC

dreamy sequoia
#

hey

#

one question

#

how can I talk on the voice chat??

gentle flint
#

!voice

wise cargoBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

gentle flint
#

read it

uncut meteor
#

chho

rigid plank
#

!voice

wise cargoBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

leaden arch
potent torrent
#

what game is this?

leaden arch
#
#

cuz u asked

#

lmao

#

good luck

median jackal
whole bear
#

najhdsjbnx

#

sowwy

uncut meteor
whole bear
#

oh well i feel bad, so i m joining.. i guess

#

uhh

#

nvm

coarse bramble
#

Who can make rooms for jackbox? I don't know how to

#

I'm Aayan in there

#

It was good

#

You guys should sleep

#

@warm prism pinged you

warm prism
leaden arch
#

Saxode is the combination of Sax and Code

#

I play sax and I'm a programmer 😂

#

uh I have a recording here

#

a sec

#

lmao it's not beside me, in my room and I'm studying

#

what u guys doin

#

My biology teacher told us to do a biology research about Prunus serrulata and apparently I have no idea what to do ;-;

#

a kind of sakura

#

nah only medical ones

#

Is Soil moisture effect to the PH value of Prunus Serrulata fruits a good research topic

strong arch
high stump
#

hello dudes

#

i have

#

a quick question

#

i actually tryed to use

#

the module:

#

tensorFlow

#

but i have python 3.8 and these module are not ported

#

only ported in 3.7

#

i download anaconda

#

and i am in this part

#

i can't talk

#

because im mute

#

i use an environment

strong arch
#

@high stump id recommend asking in a help channel

high stump
#

ah thanks

#

u know why i can't talk?

#

maybe

#

for the 50th first

#

messages

strong arch
#

dont spam please

#

i will report you

high stump
#

@strong arch which game?

#

im not spam lol

#

really rude ; (

#

bye

glacial steppe
#

Thank you

left ginkgo
#

i have a quick question

#

Say I know very very little about coding let alone Python. And I had the end goal of making a webscrapper
where should I start learning and what are some resources i could use

faint ermine
#

!resources

wise cargoBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

left ginkgo
#

ive learned a very small bit of java and HTML but not enough to really understand basics

#

bu thank i will pursue it

#

awesome thank you so much

#

yea i know

#

i didnt learn enough to say i know java though so it doesnt really matter

#

I practically dont know any languages.

#

Well i dont plan i learning multiple languages. I'm a musician and don't plan on going into any sort of computer science if i switch career paths

#

this is more for small personal use

#

what are some recommended editors

#

I would be willing to put in the work for VSC

#

Ill just look up some guides but if you want to send me those i'd be greatful

#

what do these mean

faint ermine
#

first 2 are when you right click on a file or folder you will have the option "open with code"

left ginkgo
#

in dont have an editor so this would be my first

#

k

#

you know its good when its default UI is darkmode

left ginkgo
#

is VSC by Microsoft?

#

cool

left ginkgo
#

cool ty bunch

exotic raft
#

what vs code is?

#

ok, thanks for answering

left ginkgo
#

cause who wants to use something that looks like wordpad

#

what do you use to coade?

#

wordpad

#

oh god

#

where does mkdir put files

#

thats work too

#

yea

#

i checked

faint ermine
#
    "code-runner.executorMap": {
        "python": "$pythonPath -u $fullFileName",
    }
#

ctrl + shift + p

left ginkgo
#

says code language not supported or defined

#

when trying to run

#

or do i just leave it

#

still notta

#

yea

#

yes

#

yes

#

say that again

#

k

#

ok its all good i just didnt understand what i was looking at

#

ok

#

someone likes their spahgetti

#

shit looks like mixed pasta types with alfredo and red sauce

exotic raft
#

I think its a mixture of all colours

#

of avatar

runic forum
#

you mean the bg color of the profile pic?

#

sure

#

can i show it here?

faint ermine
#

@pine ledge we can hear ourselves through your microphone, please fix

#

@runic forum were also getting some background noise from you, sounds like a video or maybe the TV?

pine ledge
#

I am not able to hear anything

dusk burrow
#
def prim_check(n: int):
    x = int(n**0.5)
    if n % x == 0 and x != 1:
        return "It's not a prime number"
    elif x == 1:
        return "It's a prime number"
    else:
        return prim_check(n)
faint ermine
#

@pine ledge you are deafened, undeafen yourself and you can hear

runic forum
#

@pine ledge because you have deafen yourself

strong arch
#
def factor(n, fac=None):
  if fac == None: fac= int(n**0.5)
  if fac == 1: return True
  elif n % fac == 0: return False
  return factor(n, fac - 1)
wise cargoBOT
#

@dusk burrow :warning: Your eval job has completed with return code 0.

[No output]
runic forum
#

@faint ermine do you also code in other languages rather than in python?

pine ledge
#

Want to learn programming :)

strong arch
#
pub fn stroke(
        &mut self,
        last_point: impl Into<Option<Point2<f32>>>,
        point: impl Into<Point2<f32>>,
        pressure: f32,
        ctx: &mut ggez::Context,
    )
runic forum
#

why you've got so many help channels? wouldn't just one be enough?

#

okay now i understand why you need so many help channels 😆

pine ledge
#

What is this language

gentle flint
#

rust

strong arch
exotic raft
#

Are you alive? guys?

runic forum
#

i am

exotic raft
#

nice

runic forum
#

i don't know if it's my mic or discord :/

#

ok lemme check real quick...

exotic raft
#

ok, guys it was a pleasure to listen to your conversations. See you

terse needle
#

why is voice chat 0 in sydney

gentle flint
#

as a tribute to opalmist

somber heath
#

Who lives in Melbourne.

#

Still. I suppose it works out better for me than a server in the US.

#

Though who knows? These things can be wired and beamed all over the place.

terse needle
#

'A..B..C' -> 'A.B.C'

somber heath
#
'A..B..C'.replace('..', '.')```
terse needle
#

'A.....B...C' -> 'A.B.C'

#
song_decoder("WUBWEWUBAREWUBWUBTHEWUBCHAMPIONSWUBMYWUBFRIENDWUB")
  # =>  WE ARE THE CHAMPIONS MY FRIEND
somber heath
#
a = 'A.....B..C'
while '..' in a:
    a = a.replace('..', '.')```
#
'ABABA'.strip('A') == 'BAB'```
terse needle
#
    song = song.lstrip()
    song = song.rstrip()
runic forum
#

compressed into a single line followed by each letter?

terse needle
#

no

runic forum
#

then what is it?

terse needle
somber heath
#

Are we sure it's not Ewok?

#

There's a lot of wub wubs in it.

terse needle
#

lmao

dusk burrow
terse needle
#

6

dusk burrow
#

good

#

my challenge is solving 1000 katas

terse needle
#

join the PythonDiscord clan

#

we're trying to make it a thing

dusk burrow
#

Send me link please

terse needle
#

you just write it in your profile

#

in "Account Settings"

dusk burrow
#

Ah ok

flint tartan
#

hello

#

is

#

anyone here

pine ledge
#

Hero

#

Hi

flint tartan
#

i need

#

help

#

can you

pine ledge
#

I am new learner. But I can see if I can help

flint tartan
#

well

#

idk

#

maybe

#

do you know about

pine ledge
#

Ok I think someone else may

flint tartan
#

tuples

pine ledge
#

Yes it is immutable

flint tartan
#

can you take a look?

pine ledge
#

Ok

somber heath
pine ledge
#

I was looking for friends lol

#

Is this server a good place

somber heath
#

Often.

pine ledge
#

But I am not a programmer

#

I just happen to land here

somber heath
#

It's the best Python programming server you'll come across.

uncut meteor
pine ledge
#

Yes

uncut meteor
#

then it is the place for you

pine ledge
#

There are a number of channels

somber heath
#

!e ```python
def my_generator():
while True:
apple = yield
print(apple)

my_gen = my_generator()
next(my_gen) #Starts the generator running. It hasn't until now.
my_gen.send('Hello, world.')```

wise cargoBOT
#

@somber heath :white_check_mark: Your eval job has completed with return code 0.

Hello, world.
uncut meteor
#

!e

def my_generator():
    while True:
        apple = yield
        print(apple)

my_gen = my_generator()
next(my_gen) #Starts the generator running. It hasn't until now.
print(dir(my_gen))
my_gen.send('Hello, world.')
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

001 | ['__class__', '__del__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__lt__', '__name__', '__ne__', '__new__', '__next__', '__qualname__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'close', 'gi_code', 'gi_frame', 'gi_running', 'gi_yieldfrom', 'send', 'throw']
002 | Hello, world.
uncut meteor
#

!e

def my_generator():
    while True:
        apple = yield
        print(apple)

my_gen = my_generator()
my_gen.throw(Exception("Test"))
next(my_gen) #Starts the generator running. It hasn't until now.
my_gen.send('Hello, world.')
wise cargoBOT
#

@uncut meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 7, in <module>
003 |   File "<string>", line 1, in my_generator
004 | Exception: Test
uncut meteor
#

!e

def my_generator():
    while True:
        apple = yield
        print(apple)

my_gen = my_generator()
print(my_gen.gi_code.co_code)
next(my_gen) #Starts the generator running. It hasn't until now.
my_gen.send('Hello, world.')
pine ledge
#

Is there throw in python

wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

001 | b'd\x00V\x00}\x00t\x00|\x00\x83\x01\x01\x00q\x00d\x00S\x00'
002 | Hello, world.
pine ledge
#

What's gicode and cocode

uncut meteor
#

!e

def my_generator():
    while True:
        apple = yield
        print(apple)
        yield 
        yield (apple + " ") * 2

my_gen = my_generator()
next(my_gen) #Starts the generator running. It hasn't until now.
my_gen.send('Hello, world.')
print(next(my_gen))
somber heath
#

@pine ledge Usually, you'd raise an exception if you wanted to do that outside of the more 'natural' ways of causing them.

#

Not throw.

wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Hello, world.
002 | Hello, world. Hello, world. 
pine ledge
#

Programming is very difficult

uncut meteor
#
True
pine ledge
#

I get exhausted and feel like going to eat food

uncut meteor
#

food is good

somber heath
#

It's mixed. It gets both better and worse.

#

The examples under discussion above are probably not where most beginners to the language would start.

pine ledge
#

I want to learn about decorator

#

Is generator same as yield

#

Like if you write yield out becomes generator

somber heath
#

Mm. There is a term you'll hear, "syntactic sugar". Decorators are examples of such. They're like a shorthand for other ways of writing the same functionality without decorators.

pine ledge
#

I know it's like nested function

somber heath
#

Yeah.

uncut meteor
#

!e

def decorate(func):
  def inner():
    print("Heelo")
    func()
    print("World")
  return inner


@decorate
def yike():
  print("yike")

yike()
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Heelo
002 | yike
003 | World
uncut meteor
#

basically wraps the function with code

#

you see it is returning a new function

#

that also calls the base method

pine ledge
#

Oh so it turns function

uncut meteor
#

it adds stuff on them

pine ledge
#

And the outer codes also get executed

#

Wow understood

#

I've been having difficulty understanding

#

Anything else is also there in decorator

uncut meteor
#

wdym?

pine ledge
#

I think I won't be able to code

#

Even though I understood

uncut meteor
#

y

pine ledge
#

It is so confusing

#

I understand with arrows

uncut meteor
#

!e

def factory(name):
  class Test:
    def __init__(self):
      self.name = name

  return Test


t = factory("Yikes")
u = t()
print(u.name)
pine ledge
#

But when i try to write it gets confusing

wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

Yikes
runic forum
#

pieru

uncut meteor
#

Peeroo

runic forum
#

!e ```py
print("Vitun Pieru Paska Saatana Neekeri!")

uncut meteor
#

!decorator

wise cargoBOT
#

Decorators

A decorator is a function that modifies another function.

Consider the following example of a timer decorator:

>>> import time
>>> def timer(f):
...     def inner(*args, **kwargs):
...         start = time.time()
...         result = f(*args, **kwargs)
...         print('Time elapsed:', time.time() - start)
...         return result
...     return inner
...
>>> @timer
... def slow(delay=1):
...     time.sleep(delay)
...     return 'Finished!'
...
>>> print(slow())
Time elapsed: 1.0011568069458008
Finished!
>>> print(slow(3))
Time elapsed: 3.000307321548462
Finished!

More information:
Corey Schafer's video on decorators
Real python article

runic forum
#

haista vittu!

gentle flint
runic forum
gentle flint
#

I'm not gonna speak Finnish here

runic forum
#

damn bro u from finland?

uncut meteor
#

Fineland

gentle flint
#

No, but we used to live there

#

in Suomenlinna

#

long, long ago

runic forum
#

you still know any finnish

gentle flint
#

nope

runic forum
#

oke....

gentle flint
#

I was 2 or smth when we left

#

but we still had some finnish books, which is why I recognise it when I see it

uncut meteor
gentle flint
#

🇫🇮

uncut meteor
runic forum
uncut meteor
runic forum
#

it's blue cross one

uncut meteor
#

Wrong

gentle flint
uncut meteor
runic forum
#

its prop Pakistan

uncut meteor
runic forum
#

that's a flag of Singapore

pine ledge
#

France

gentle flint
runic forum
#

im pretty sure

gentle flint
#

🇸🇬

#

^singapore^

uncut meteor
runic forum
gentle flint
#

The National Flag of Singapore, often simply referred to as the Singaporean flag, consists of a horizontal bicolour of red above white, overlaid in the canton (upper-left quadrant) by a white crescent moon facing a pentagon of five small white five-pointed stars. It was first adopted in 1959, the year Singapore became self-governing within the B...

#

do you dare challenge me

uncut meteor
runic forum
#

Togo

pine ledge
#

Can you explain me heap

runic forum
#

pick that

pine ledge
#

Or heap tree

#

And threading

uncut meteor
pine ledge
#

Is there anything like heap tree

runic forum
#

🎰

somber heath
#

In Python, threading is "parallelism" within a single system process, whereas multiprocessing is parallelism across multiple Python system processes.

willow light
#

What about perpendicularism?

somber heath
#

Related to threading is also async.

runic forum
#

dude why is you singing

gentle flint
#

'cuz I sure would li-ike, some sweet co-ompany

somber heath
#

When using threading, race conditions are a thing, but there are ways of dealing with that.

gentle flint
#

oh, you're gonna miss me when I'm gone

willow light
#

Meanwhile, I got into a debate this morning about whether 10 years is enough time to let something like the National Weather Service know that Python 2 is going away.

runic forum
#

what did the old flag of south africa look like?

pine ledge
#

Greenblue

gentle flint
#

that's the old one

#

new one is

somber heath
#

Responsibly.

pine ledge
#

What can I create to get a job

somber heath
#
import job```
willow light
terse needle
#

hardly any notice my ass lmao

pine ledge
#

When do you use asyncio

somber heath
willow light
somber heath
#

@pine ledge i/o bound stuff.

pine ledge
#

When you need io

#

Ok

#

I have never used it

terse needle
willow light
terse needle
#

lmao

willow light
#

Though you can tell they did not read the best-practices guide for GeoJSON

gentle flint
#

I know several people who still use KML

#

GeoJSON is still a lot better, even with bad practices

pine ledge
#

How can I create like a map which shows current GPS position of something

willow light
gentle flint
#

It is

willow light
gentle flint
#

and for all the people who decided to exclusively support it because they are stupid d!cks

#

and for google mymaps

terse needle
willow light
#

e.g.

curl https://api.weather.gov/stations/kash/observations/latest | jq ‘.geometry’

Is so much easier than what it could be.

#

Given this is the weather service we’re speaking of

gentle flint
#

🇨🇲

pine ledge
#

Drc

#

Jamaica

gentle flint
#

I'm off

#

cya

wise glade
#

so this, with curl google.co.in
html page?

#

I'm gonna have to restart my system
something's eating up disk

somber heath
#

Disk monsters. OM NOM NOM!!!

wise glade
#

yeah, C#'s not to play with 😂

#

idk what I ran

#

dotnet somehing ...

terse needle
uncut meteor
#
def trouble(x, t):
    l = 0
    while l < len(x) - 1:
        if x[l] + x[l+1] == t:
            x.pop(l+1)
        else:
            l += 1
    return x
terse needle
#
def trouble(x, t):
    removed = True
    while removed:
        removed = False

        for i, _ in enumerate(x):
            if i != len(x)-1:           
                if x[i] + x[i+1] == t:
                    removed = True

                    del x[i+1]
    
    return x
uncut meteor
#

!code

wise cargoBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

terse needle
#
def trouble(x, t):
    removed = True
    while removed:
        removed = False
        offset = 0

        for i in range(len(x)):
            i -= offset

            if i != len(x)-1:           
                if x[i] + x[i+1] == t:
                    removed = True
                    offset += 1

                    del x[i+1]
    
    return x
runic forum
#

on discord

pine ledge
#

Hi

#

How to generate all substring of a string

uncut meteor
#

!e

string = "Hello"

cur_sub_size = len(string)
output = []

while cur_sub_size >= 0:
    l = 0
    while l + cur_sub_size < len(string):
        output.append(string[l:l + cur_sub_size + 1])
        l += 1

    cur_sub_size -= 1

print(f"All substrings: {', '.join(output)}")
#

like that?

wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

All substrings: Hello, Hell, ello, Hel, ell, llo, He, el, ll, lo, H, e, l, l, o
uncut meteor
#

@pine ledge

pine ledge
#

That's not all substring

uncut meteor
#

what is missing?

pine ledge
#

Ho

uncut meteor
#

that isn't a substring

pine ledge
#

Eo

uncut meteor
#

that is permutations

#

!docs itertools.combinations

wise cargoBOT
#
itertools.combinations(iterable, r)```
Return *r* length subsequences of elements from the input *iterable*.

The combination tuples are emitted in lexicographic ordering according to the order of the input *iterable*. So, if the input *iterable* is sorted, the combination tuples will be produced in sorted order.

Elements are treated as unique based on their position, not on their value. So if the input elements are unique, there will be no repeat values in each combination.

Roughly equivalent to:... [read more](https://docs.python.org/3/library/itertools.html#itertools.combinations)
pine ledge
#

Ok I think I am getting confused here I was just solving question on a website

uncut meteor
#

!e

from itertools import combinations

print(list(combinations("Hello", 4)))
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

[('H', 'e', 'l', 'l'), ('H', 'e', 'l', 'o'), ('H', 'e', 'l', 'o'), ('H', 'l', 'l', 'o'), ('e', 'l', 'l', 'o')]
uncut meteor
#

!e

from itertools import combinations

all_combs = set()
text = "Hello"

for i in range(1, len(text) + 1):
    for comb in combinations("Hello", i):
      all_combs.add(''.join(comb))
print(all_combs)
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

{'ll', 'elo', 'ello', 'e', 'el', 'H', 'l', 'ell', 'o', 'He', 'Hello', 'Hlo', 'Helo', 'Hel', 'lo', 'llo', 'Hllo', 'Heo', 'Hell', 'Hl', 'Ho', 'Hll', 'eo'}
pine ledge
#

Ok.

#

Thanks

#

One more question I had

#

It was long

uncut meteor
#

how long

pine ledge
#

You had to write a function

uncut meteor
#
def func():
  ...
#

done

pine ledge
#

f(-1)= -1 , f(0)= 0 , f(1) = 1 if n>=0 then f(n) = f(n-1)+f(n-2) else if n<0 f(n) = f(n+1)+ f(n+2)

#

I think it'll use recursion

amber raptor
#

because they are so sciency, they pretty much mandate that everyone has Master minimum in Computer Science related

pine ledge
#

There is end condition

#

F(0) =0

#

F(-1)=-1

#

F(1)=1

#

It just sums . It was a question on a website

wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

001 | -1
002 | 0
003 | 1
004 | 2
005 | 3
006 | 5
007 | 8
008 | 13
009 | 21
010 | 34
011 | 55
pine ledge
#

F(3) = f(2) + f(1) == f(1)+f(0)+f(1)== 1+0+1==2

#

It's fibbo

#

:)

tall latch
#

how does this look for a leveling bot rank command

pine ledge
#

I want to learn recursion

whole bear
#

ok​​‍​​‍​‍‍​‍‍​‍‍‍‍‍​​​​​​​​​‍​‍

pine ledge
#

Can you share the code

#

My code didn't compile

uncut meteor
#

!e

from functools import cache

@cache
def f(n):
    if n in [-1, 0, 1]:
        return n
    elif n >= 0:
        return f(n - 1) + f(n - 2)
    else:
        return f(n + 1) + f(n + 2)

print(f(100))
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

354224848179261915075
tall latch
uncut meteor
#

!e

from functools import cache


# Fibonacci
@cache
def f(n):
    return n if n in [-1, 0, 1] else f(n - 1) + f(n - 2) if n >= 0 else f(n + 1) + f(n + 2)

print(f(100))
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

354224848179261915075
uncut meteor
pine ledge
#

I do not know about cache

tall latch
#

how about this

uncut meteor
#

!docs functools.lru_cache

wise cargoBOT
#
@functools.lru_cache(user_function)``````py
@functools.lru_cache(maxsize=128, typed=False)```
Decorator to wrap a function with a memoizing callable that saves up to the *maxsize* most recent calls. It can save time when an expensive or I/O bound function is periodically called with the same arguments.

Since a dictionary is used to cache results, the positional and keyword arguments to the function must be hashable.

Distinct argument patterns may be considered to be distinct calls with separate cache entries. For example, f(a=1, b=2) and f(b=2, a=1) differ in their keyword argument order and may have two separate cache entries.

If *user\_function* is specified, it must be a callable. This allows the *lru\_cache* decorator to be applied directly to a user function, leaving the *maxsize* at its default value of 128:

```py
@lru_cache
def count_vowels(sentence):
    sentence = sentence.casefold()
    return sum(sentence.count(vowel) for vowel in 'aeiou')
```  If *maxsize* is set to `None`, the LRU feature is disabled and the cache can grow without bound.... [read more](https://docs.python.org/3/library/functools.html#functools.lru_cache)
uncut meteor
#

!docs functools.cache

wise cargoBOT
#
@functools.cache(user_function)```
Simple lightweight unbounded function cache. Sometimes called [“memoize”](https://en.wikipedia.org/wiki/Memoization).

Returns the same as `lru_cache(maxsize=None)`, creating a thin wrapper around a dictionary lookup for the function arguments. Because it never needs to evict old values, this is smaller and faster than [`lru_cache()`](#functools.lru_cache "functools.lru_cache") with a size limit.

For example:

```py
@cache
def factorial(n):
    return n * factorial(n-1) if n else 1

>>> factorial(10)      # no previously cached result, makes 11 recursive calls
3628800
>>> factorial(5)       # just looks up cached value result
120
>>> factorial(12)      # makes two new recursive calls, the other 10 are cached
479001600
```   New in version 3.9.
pine ledge
#

:)

#

Lot to learn

tall latch
#

@wicked sundial what was it that you needed help with anyway

#

there is something important i dont know

#

that is to use stackoverflow properly

wicked sundial
wise cargoBOT
#

Hey @wicked sundial!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

wicked sundial
#

intents = discord.Intents.default() # get the default intents where members and presence are disabled
intents.members = True # enable the members intent

bot = commands.Bot(command_prefix = "?", intents=intents)


bot.reaction_roles = []

@bot.event
async def on_ready():
    async with aiofiles.open("reaction_roles.txt", mode="a") as temp:
        pass
        
    async with aiofiles.open("reaction_roles.txt", mode="r") as file:
        lines = await file.readlines()
        for line in lines:
            data = line.split(" ")
            bot.reaction_roles.append((int(data[0]), int(data[1]), data[2].strip("\n")))

    print("Your bot is ready.")

@bot.command()
async def set_reaction(ctx, role: discord.Role=None, msg: discord.Message=None, emoji=None):
    if role != None and msg != None and emoji != None:
        await msg.add_reaction(emoji)
        bot.reaction_roles.append((role.id, msg.id, str(emoji.encode("utf-8"))))
        
        async with aiofiles.open("reaction_roles.txt", mode="a") as file:
            emoji_utf = emoji.encode("utf-8")
            await file.write(f"{role.id} {msg.id} {emoji_utf}\n")

        await ctx.channel.send("Reaction has been set.")
        
    else:
        await ctx.send("Invalid arguments.")

@bot.event
async def on_raw_reaction_add(payload):
    for role_id, msg_id, emoji in bot.reaction_roles:
        if msg_id == payload.message_id and emoji == str(payload.emoji.name.encode("utf-8")):
            await payload.member.add_roles(bot.get_guild(payload.guild_id).get_role(role_id))
            return

@bot.event
async def on_raw_reaction_remove(payload):
    for role_id, msg_id, emoji in bot.reaction_roles:
        if msg_id == payload.message_id and emoji == str(payload.emoji.name.encode("utf-8")):
            guild = bot.get_guild(payload.guild_id)
            await guild.get_member(payload.user_id).remove_roles(guild.get_role(role_id))
            return```
tall latch
#

await client.wait_for('reaction_add', check=check)

paper tendon
#

stuff party?

uncut meteor
#

!e

print(f"{5:02}")
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

05
uncut meteor
#

!e

print(f"{5.2:.2f}")
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

5.20
uncut meteor
#

!f-string

wise cargoBOT
#

Creating a Python string with your variables using the + operator can be difficult to write and read. F-strings (format-strings) make it easy to insert values into a string. If you put an f in front of the first quote, you can then put Python expressions between curly braces in the string.

>>> snake = "pythons"
>>> number = 21
>>> f"There are {number * 2} {snake} on the plane."
"There are 42 pythons on the plane."

Note that even when you include an expression that isn't a string, like number * 2, Python will convert it to a string for you.

terse needle
#

2 -> 002, print(f'{2:03}')

uncut meteor
#

!e
print(f"{2222:03}")

wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

2222
uncut meteor
#

!e

print(f"{5:1>2}")
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

15
tall latch
#
user:
  usertag text
  userid integer
  level integer
  exp integer
  guildid integer

role:
  rolename text
  roleid integer
  guildid integer
  level integer```
whole bear
#

hm

paper tendon
#

!e import random; print(random.choice(["funny", "not funny"]))

wise cargoBOT
#

@paper tendon :white_check_mark: Your eval job has completed with return code 0.

not funny
terse needle
uncut meteor
#
def what_is_the_time(time_in_mirror):
    hours, mins = time_in_mirror.split(":")
    flipped_hours = (12 - int(hours)) if not hours in ["6", "12"] else hours
    flipped_mins = (60-int(mins)) if not mins in ["00", "60"] else mins

    return f"{flipped_hours:0>2}:{flipped_mins:0>2}"
terse needle
#
def get_nums(timestr: str) -> list:
    return timestr.split(':')

def what_is_the_time(time_in_mirror):
    clockTime = get_nums(time_in_mirror)
    invertHour = 12 - int(clockTime[0])
    invertMin = 60 - int(clockTime[1])
    return f'{str(invertHour):0>2}:{str(invertMin):0>2}'
uncut meteor
#

!e

test = [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

hours, mins = 5, 22
print(test[12-hours%11])
print(test[12-hours%11])
wise cargoBOT
#

@uncut meteor :white_check_mark: Your eval job has completed with return code 0.

001 | 7
002 | 7
terse needle
stuck furnace
#

You haven't converted to metric yet?

#

What is clocks?

terse needle
stuck furnace
#

Thanks for the clarification @whole bear 😄

frozen jacinth
pine ledge
#

Do you guys connect from same place

frozen jacinth
icy axle
#

What do you mean?

pine ledge
#

It feels like you're talking in a room sitting together

icy axle
#

Don't think so

stuck furnace
#

Great job 😄

#

It is a bit echoey @tall latch

olive siren
#

Hi @ all

#

i can't find the Switch statement

stuck furnace
olive siren
#

does it has another name

stuck furnace
#

Wait till the next version of python, it will have the match statement (I think).

#

But there is no switch.

olive siren
#

oh match

#

ok i got it

olive siren
#

so for now a need dictionary

stuck furnace
#

Alright I'm out of here 😄

wise cargoBOT
#
**PEP 634 - Structural Pattern Matching: Specification**
Status

Accepted

Python-Version

3.10

Created

12-Sep-2020

Type

Standards Track

cobalt fractal
#

😄

olive siren
#

😆

pine ledge
#

Can class have private constructor

tall latch
olive siren
uncut meteor
random ridge
#

How do I get voice verified ?

terse needle
#

!voice

wise cargoBOT
#

Voice verification

Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.

random ridge
#

THanks

olive siren
random ridge
#

Oh

#

I have to be here for longer

#

So

#

What is the topic ?