#off-topic-lounge-text

1 messages · Page 35 of 1

cold lintel
#

Did you vote KJ? Oh wait you can't lemon_smug

buoyant kestrel
#

Oh jesus

#

How

#

HOW can they like it

vernal snow
cold lintel
#

Yeah that was loud 😄

honest pasture
cold lintel
#

That like resonated with my ear drum

buoyant kestrel
#

It made me puke from fear when I was a kid

#

Okay that's gold

#

Didn't even know that was a thing

cold lintel
#

ET?

#

🤢

#

Ohh

#

Yeah it's great

#

Did you watch BB first?

#

Ah :C

#

Yeah it really picks up from there

#

Season 2 and the beginning of season 3 are a bit slow.

#

Season 4 is amazing.

#

The guy

#

What you working on at the moment?

#

Very nice

#

Iterative design

buoyant kestrel
cold lintel
#

That guy's got a stick of dynamite yeah

fresh sail
cold lintel
#

Wow my terminal is taking like 30 seconds to start up for some reason 🤔

wary lance
#

Keep getting disconnected S:

cold lintel
#

Just make your font really small.

#

You know systemd can watch files btw Griff.

#

I didn't hear the entirety of what you were saying earlier so I don't know if that's actually a helpful suggestion but 🤷‍♂️

#

Ah right

vernal snow
cold lintel
#
inotifywait

Waits for changes to one or more files.
More information: https://manned.org/inotifywait.

 - Run a command when a file changes:
   while inotifywait {{path/to/file}}; do {{command}}; done

 - Be quiet about watching for changes:
   while inotifywait --quiet {{path/to/file}}; do {{command}}; done

 - Watch a directory recursively for changes:
   while inotifywait --recursive {{path/to/directory}}; do {{command}}; done

 - Exclude files matching a regular expression:
   while inotifywait --recursive {{path/to/directory}} --exclude '{{regular_expression}}'; do {{command}}; done

 - Wait at most 30 seconds:
   while inotifywait --timeout {{30}} {{path/to/file}}; do {{command}}; done

 - Only watch for file modification events:
   while inotifywait --event {{modify}} {{path/to/file}}; do {{command}}; done
#

No description provided.
😔

wide aurora
#

@buoyant kestrel

Project Structure

templates/      # Holds template.yml files that define the output structure of guild channels

README.md       # What you are reading 
notes.txt       # Implementation notes
structure.yml   # Holds the ... ?
cold lintel
#

Like ```py
def foo(
x,
y,
z,
):
...

#

@steady gust could you turn on PTT, you've got some background noise.

wide aurora
#

let us know when you have sorted it, and we can unmute ^

cold lintel
#

I really like most of the decisions made by Black tbh.

#

I really like most of the decisions made by Black tbh.

#

And where I disagree with it, I'm happy that it's at least consistent and I don't have to think about it.

#

And where I disagree with it, I'm happy that it's at least consistent and I don't have to think about it.

timid fjordBOT
#

run.py lines 13 to 18

await send(
    {
        "type": "http.response.start",
        "status": 404,
    }
)```
cold lintel
#

Gimme a sec KJ 🤔

timid fjordBOT
#

run.py lines 13 to 18

await send(
    {
        "type": "http.response.start",
        "status": 404,
    }
)```
cold lintel
#

Gimme a sec KJ 🤔

timid fjordBOT
#

run.py lines 13 to 18

await send(
    {
        "type": "http.response.start",
        "status": 404,
    }
)```
cold lintel
#

Is it just me or is Discord slow to send messages atm?

vernal snow
wide aurora
#

https://colours.friendo.dev/random-random-random-random-random

cold lintel
vernal snow
cold lintel
#

.*[a-z].*

vernal snow
#

but foo123bar should also be valid

#

but foo123bar should also be valid

cold lintel
#

They've turned on slow mode :C

cold lintel
#

Let me test it...

#

Let me test it...

#

Ah right

vernal snow
#

ah I see

cold lintel
#

Think it's more explicit.

#

I never remember exactly which characters \w (and similar) correspond to.

#

But, just personal preference 🤷‍♂️

#

!eval ```py
import re

valid_strs = """
foo123
foo
123foo
foo123bar
""".splitlines()

invalid_strs = """
123
""".splitlines()

pattern = re.compile(r".[a-z].")

for s in valid_strs:
assert pattern.fullmatch(s), s

for s in invalid_strs:
assert not pattern.fullmatch(s), s

print('success')

timid fjordBOT
#

@cold lintel :white_check_mark: Your eval job has completed with return code 0.

success
vernal snow
#

[a-zA-Z\S\d]*[a-zA-Z]+[a-zA-Z\d]*

#

that seems to work the best for me

cold lintel
#

Alright, reading Fisher's code...

#

Oh on the commits page the oldest commit is first. Was reading them in the wrong order. Was confused.

#

Yep

#

Mhm

#

Ah yeah, one sec...

#

Erm, it's more like a community maintained list of examples.

#

Yep

#

It's pretty good

#

Nah it just says not found.

#

I find it really useful, because terrible memory.

#

Adios @vernal snow

#

Cya guys 👋

strong knoll
#

hello

hearty cobalt
#

wish = input('Enter what you would like:')
if wish == 'cream':
print('Try the cream puffs')
if wish == 'raisins':
print('Try our signature cakes')
if wish == 'cream'or wish != 'raisins':
print('Try the poppy seed crescents')

#

can u fix it for me plz

#

!eval

timid fjordBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

hearty cobalt
#

!eval wish = input('Enter what you would like:')
if wish == 'cream':
print('Try the cream puffs')
if wish == 'raisins':
print('Try our signature cakes')
if wish == 'cream'or wish != 'raisins':
print('Try the poppy seed crescents')

#

!eval
wish = input('Enter what you would like:')
if wish == 'cream':
print('Try the cream puffs')
if wish == 'raisins':
print('Try our signature cakes')
if wish == 'cream'or wish != 'raisins':
print('Try the poppy seed crescents')

timid fjordBOT
#

@hearty cobalt :x: Your eval job has completed with return code 1.

001 | Enter what you would like:Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
primal bison
#

Hello

#

@dry sequoia

#

my mic is bugged

dry sequoia
primal bison
dry sequoia
primal bison
#

my god

#

thath code is

#

massive

dry sequoia
night lily
#

Perhaps, were you to narrow your eyes at it accusingly, it would begin to function.

#

Howdy howdy.

dry sequoia
night lily
#

I'm not speaking.

dry sequoia
night lily
#

I'll set myself to mute to remove doubt.

dry sequoia
night lily
#

About the closest thing I've ever done in terms of writing an API was the most janky, slapdash cobbling together of Twisted code to distribute some Mandelbrot animation processing.

#

I like Twisted. It's higher level than requests and the like, so it's a bit friendlier to use.

primal bison
#

building Rpg

night lily
#

Even if it is a bit surplus to requirements. There's a fair bit in it.

#

What setting?

night lily
#

What is life but a series of often contiguous dumb things?

primal bison
night lily
#

Yes.

#

I'm asking you what setting your RPG is in.

#

Kemal.

worn gulch
#

yes

night lily
#

Agreed.

dry sequoia
#

kemal wher

primal bison
dry sequoia
worn gulch
#

Macedonia

dry sequoia
worn gulch
#

yes

#

very sun

night lily
supple merlin
primal bison
worn gulch
supple merlin
#

yep

worn gulch
#

unless baklava

supple merlin
#

baklava is a greek food

dry sequoia
#

hey all we have geography lesson today by KEmal and Iam hungry

worn gulch
supple merlin
#

Moderate continental climate in Macedonia
It usually has cold and wet winters and hot dry summers. Spring is colder than Autumn. There are differences in average temperatures in regions of moderate continental climate. These differences are due to the geographical width of the regions, the height of the sea level, etc. due to locations. its not ctrl+v

primal bison
#

how i unlock my mic on this server

night lily
#

!voice

timid fjordBOT
#

Voice verification

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

night lily
#

There's always a part of Australia that's on fire.

#

Often more.

supple merlin
#

tree = hotel

night lily
primal bison
dry sequoia
supple merlin
dry sequoia
supple merlin
dry sequoia
supple merlin
#

and also ı am 12

dry sequoia
ivory cloak
dry sequoia
supple merlin
#

yes

ivory cloak
supple merlin
#

and in 2022 kids can do any thing they want

dry sequoia
ivory cloak
timid fjordBOT
supple merlin
#

sorry

#

in online

ivory cloak
#

using discord under age 13 is against ToS

supple merlin
#

so what shoud ı do

dry sequoia
#

unless you see him

ivory cloak
dry sequoia
#

this is online

#

non real world

supple merlin
#

thanks @dry sequoia

dry sequoia
#

you'r free here

ivory cloak
dry sequoia
supple merlin
#

and ı love fenrir in mythology

ivory cloak
ivory cloak
night lily
#

I'm not used to seeing dark theme on github.

dry sequoia
supple merlin
#

ı read

#

booooooks

dry sequoia
night lily
supple merlin
#

no

worn gulch
supple merlin
#

ı am jusy a normal kid

worn gulch
#

but still

dry sequoia
ivory cloak
night lily
#

People who prefer light themes should be launched toward the sun into which they stare.

worn gulch
#

yes

ivory cloak
cold lintel
#

I sometimes switch to lightmode just to change things up a bit 😄

#

But it only really works when you're outside or in a room with a lot of sunlight.

dry sequoia
# ivory cloak the law is just a set of rules for a country

rules are personal in nature, and they are often adjusted as the conditions and circumstances of the home change. Laws must be passed through due process in order to take effect. A law starts off as a bill, and must go through a series of checks, balances, and votes in order to become a law.

cold lintel
supple merlin
#

@dry sequoia my mom is math prof. maybe thats why ı read books

ivory cloak
supple merlin
#

but thats stupid every kid can read book

night lily
supple merlin
#

Perception of children in 2022 is very different

ivory cloak
dry sequoia
ivory cloak
primal bison
#

@ruby birch how much time do you spend on this project ?

dry sequoia
primal bison
#

bye

rain smelt
#

@forest hamlet

#

Anyone here?

#

I'm currently a rookie in Python.

#

Can you tell me how can I get fluent inPython

#

It would be really good.

primal bison
#

shoot

#

Why is coding so hard

quick onyx
#

@buoyant kestrel Let me know when you are available I wanted to add the fetures on the Calculator 😊

cold lintel
#

Yo, what you working on?

#

👍

primal bison
#

yo somebody can help me about this assignment idk how to do

cold lintel
primal bison
#

okay bro

cold lintel
#

Ah right, so you are going to parameterise the maximum world level later.

#

Oh right

#

A trick is to use max(0, x)

#

I would always opt for the API if there is one available @meager bluff

#

Maybe break the calculation down into two parts.

#

@meager bluff What's the application?

meager bluff
cold lintel
#

Feed yer cat 😄

#

Ah just a diva cat

meager bluff
#

Is python a good fit or should I consider using JS for that?

cold lintel
meager bluff
cold lintel
#

Have you learned about unit testing? @cold crystal

cold lintel
#

Ah right. It's a slightly more efficient way to test your code.

#

After a while, manually testing can get too much.

#

Erm, it's a pretty general concept. It can be as simple as testing the output for different inputs to your function.

#
def test_addone():
    assert addone(1) == 1
    assert addone(2) == 3
#

There are tools you can use to run tests, like pytest.

#

Yeap

#

!eval ```py
assert 1 == 2

timid fjordBOT
#

@cold lintel :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AssertionError
cold lintel
#

Heading over to the other channel 👋

meager bluff
weak socket
#

@cold crystal make async

mild goblet
#

@cold crystal can you hear me ?

radiant vapor
#

what are you guys doing in the channel

cold lintel
#

!stream 491289245974003722 "1 hour"

timid fjordBOT
#

✅ @cold crystal can now stream until <t:1651959237:f>.

safe surge
#

i am new to python learner, any best notes are available

primal bison
#

who does here javascript

timid fjordBOT
#

:incoming_envelope: :ok_hand: applied mute to @violet zephyr until <t:1652187885:f> (9 minutes and 59 seconds) (reason: burst rule: sent 8 messages in 10s).

#

:incoming_envelope: :ok_hand: applied mute to @primal bison until <t:1652187958:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).

calm bay
#

Alice and Bob are fictional characters commonly used as placeholders in discussions about cryptographic systems and protocols, and in other science and engineering literature where there are several participants in a thought experiment. The Alice and Bob characters were invented by Ron Rivest, Adi Shamir, and Leonard Adleman in their 1978 paper ...

cold lintel
#

.xkcd 177

vivid terraceBOT
#

Yet one more reason I'm barred from speaking at crypto conferences.

cold lintel
#

Yeah can be hard to keep track of what the current state of a Jupyter notebook is.

#

What I normally do when it gets messy is re-evaluate the whole notebook from the start ("run all").

buoyant kestrel
#

lambda: 'black' is equivelant to:

def function():
  return 'black'
buoyant kestrel
#

Who wants to join me in putting a paperclip into a power supply cable

#

!stream 878427445110407218

timid fjordBOT
#

✅ @fallen gulch can now stream until <t:1652202629:f>.

buoyant kestrel
#

Fine, brief puppy break

honest pasture
wise birch
#

hmm

brittle lily
#

!stream

#

!stream 878427445110407218

#

!stream 123123123

vestal quail
#

Thank god i use USDT

#

and then nerds like this on Coin Market Cap

vestal quail
proper elbow
#

Vowels to be returned as UpperCase Consonants to be return with 3 places shifted among consonants ONLY Remaining All special characters will be same

#

i want to write python code on above given conditions ... please help me out

icy raven
#

let's go...

#

where are you at now

#

I know python pretty well...

#

that's the only lang, I know properly...

fresh sail
icy raven
#

yeah..

#

almost 4 years...

#

properly from 2 years

#

i'm a cs major...

#

what...

#

I didn't get you

#

in india it is always hot...

#

in most places

#

lowest is 25* C

#

summers go as high as 40

#

yeah...

#

yeah

#

shift enter

#

it's ipynb...

#

ig, debugger only works with .py files

#

have you tried shift enter..

#

reopen vs code

#

just open jupyter notebook

#

syntax

#

you need to quote of someone

#

no in the same string

#

!e
print("Hello, mr.singlequote "'" "

timid fjordBOT
#

@icy raven :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print("Hello, mr.singlequote"'""
003 |                                  ^
004 | SyntaxError: unterminated string literal (detected at line 1)
icy raven
#

there is none...

#

if your string has single quote.. use double quotes to wrap it... if your string has double quote... use single quote to wrap it..

#

otherwise... whichever you prefer

#

!e

print("hello\bhi")
timid fjordBOT
#

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

hellohi
icy raven
#

click on try it @fresh sail

#

don't ever use this...

#

maybe there remove it let me see...

#

we have unicode now

#

for legacy stuff

#

reallyyyyyyyyyy old legacy stuff...

#

no... when they use to use computer with printers @fresh sail

#

no display

#

we use to just type out stuff...

#

each is 8 bits...

#

it is unicode stuff

#

@fresh sail ...

#

yeah

#

powers of 2

#

click on try this

#

o represents... o is a placeholder for octal

#

h is a placeholder for hexadecimal

#

yeah...

#

\x[somehex]

#

\x represents is hex

#

\x82

#

we wasted too much time on legacy stuff

#
print(0x22)
#

!e
print(0x22)

timid fjordBOT
#

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

34
icy raven
#

!e
print(0b11)

timid fjordBOT
#

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

3
icy raven
#

!e
print(0o55)

timid fjordBOT
#

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

45
icy raven
#

they use hex stuff for colors very often..

potent crow
#

you teaching python?

icy raven
#

yep

icy raven
icy raven
potent crow
#

awesome I'll try to be there

icy raven
#

i'm joking...

#

i know...

fresh sail
icy raven
#

but for anything complicated... cpp compiler writes better assembly than most people...

#

c++

#

or rust complier...

potent crow
#

f is for formatting

icy raven
#

you should look for difference between normal string and r string

#

f string and r string is not a right comparison...

#

yeah.. f string behaves like normal string... with formatting

fresh sail
#

@glossy trail We are over here

icy raven
#

so correct comparison is r strings and normal strings...

#

if you don't have any variables f string is just normal string..

#

flower brackets

#

f"{spam}"

potent crow
#
print(r'\nhello')

output:

\nhello

normal:

print('\nhello')

output:

<empty line>
hello
icy raven
#

!e

x = 1
print(f"{x}")
timid fjordBOT
#

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

1
icy raven
#

!e

x = 10
print(f"{x}")
print(f"{x = }")
print(f"{x        =     }")
print(f"{x:b}") # this is binary format
print(f"{x:x}")  # hex.. like that..
print(f"{x = :o}") 

timid fjordBOT
#

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

001 | 10
002 | x = 10
003 | x        =     10
004 | 1010
005 | a
006 | x = 12
icy raven
#

we can do cool stuff like this...

#

with f strings

potent crow
#

how do I print colored lines?

icy raven
#

!code

timid fjordBOT
#

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.

icy raven
#

that is octal

potent crow
# icy raven !code

I know this, I asked how do I print colored string in command-line using python

tulip pond
#

sorry first time ive ever joined this, idk whats going on. do you teach stuff and we like try on here? sorry

icy raven
#

there are libraries... if i remember correctly there is something called typer

potent crow
#

any clue how to do it without external libraries?

icy raven
#

idk... let me lookup

icy raven
#

without lib

potent crow
#

looks doable, I'm not a fan of external libraries for tiny tasks.

icy raven
#

!e

x = '\033[93m' + 'hello' + '\033[0m'
print(x)
timid fjordBOT
#

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

hello
icy raven
#

it's not working here..

potent crow
#

this wont work here

icy raven
#

for docs strings it is needed imo.. even if it is obvious...

#
def spam():
  """says hello"""
  print("hello")

this is good because, it gives that hover effect...

def spam():
  print("hello") # this says hello

this is bad
@indigo kite

#

when you say

s[-1]

it just assumes

s[len(s) - 1] @fresh sail

#

that's reverse

#

only for lists

potent crow
#

that's for lists

icy raven
#

because strings are immutable

icy raven
#

cpp has something

#

@fresh sail @indigo kite someone sent me this today

icy raven
potent crow
#

wait how do you use the multi-cursor?

icy raven
#

elon is quite inconsistent with his thoughts about twitter... which is concerning...

#

haha

#

!e

a = list(range(10))
print(a[1::2])
timid fjordBOT
#

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

[1, 3, 5, 7, 9]
icy raven
#

!e

a = list(range(10))
print(a[0:6:2])
timid fjordBOT
#

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

[0, 2, 4]
icy raven
timid fjordBOT
#

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

0 1 2 3 4
icy raven
#

@fresh sail

#

we are just unpacking range yield values and giving it print

#

it is like empty set is a subset of every set
@indigo kite

#

if it happens... we will not be surprised!

#

!e

a = []
a += 1
timid fjordBOT
#

@icy raven :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: 'int' object is not iterable
wheat bane
#

'' in [1,2,3,"aaa"]
is false

icy raven
#

!e

a = []
a += "1"
print(a)
timid fjordBOT
#

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

['1']
icy raven
icy raven
#

it is not appending intergers... right...

icy raven
#

!e

a = []
a += "hello"
print(a)
timid fjordBOT
#

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

['h', 'e', 'l', 'l', 'o']
icy raven
#

basically += takes any iterator....

#

yeah..

#

it is little unexpected

icy raven
#

yeah... it's good...

wheat bane
#

!e print("test")

timid fjordBOT
#

@wheat bane :white_check_mark: Your eval job has completed with return code 0.

test
icy raven
#

it is C way of doing thing... f strings are better

primal bison
#

!e

test = []
test += 10293022
timid fjordBOT
#

@primal bison :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: 'int' object is not iterable
primal bison
#

!e

test = []
test += 10,10
timid fjordBOT
#

@primal bison :warning: Your eval job has completed with return code 0.

[No output]
primal bison
#

!e

test = []
test += 10,10
print(test)
timid fjordBOT
#

@primal bison :white_check_mark: Your eval job has completed with return code 0.

[10, 10]
primal bison
#

!e

test = []
test.append(1,0,1)
print(test)
timid fjordBOT
#

@primal bison :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: list.append() takes exactly one argument (3 given)
icy raven
primal bison
#

ahh i see

icy raven
wheat bane
#

you can also use string format

#

no

icy raven
#

doing format after declaring string is bad, imo... what if we don't have that variable price...

wheat bane
#

!e "my name is {name}".format(name="mike")

timid fjordBOT
#

@wheat bane :warning: Your eval job has completed with return code 0.

[No output]
icy raven
#

you need to print it

wheat bane
#

!e print("my name is {name}".format(name="mike"))

timid fjordBOT
#

@wheat bane :white_check_mark: Your eval job has completed with return code 0.

my name is mike
icy raven
#

I was saying that to mohtasim

wheat bane
#

!e print("my name is {name} and my age is {age}".format(name="mike", age=100))

timid fjordBOT
#

@wheat bane :white_check_mark: Your eval job has completed with return code 0.

my name is mike and my age is 100
wheat bane
#

!e print("{b}".format(b=10))

timid fjordBOT
#

@wheat bane :white_check_mark: Your eval job has completed with return code 0.

10
icy raven
#

never mind both are run time errors...

#

if they wanted to... they could have easily made it into compile time error...

#

isupper() is more like is_not_lower

#

@fresh sail

#

no...

#

saying what it means

#

isupper means none of the letters should not be lower...

#

not everything has to be upper case

wheat bane
#

to make every character lower

icy raven
#

to check if input string is blank...

#

user are unpredictable.... they might press some space and press enter...

#

space come from whitespace, ig

wheat bane
#

!e dir(str)

timid fjordBOT
#

@wheat bane :warning: Your eval job has completed with return code 0.

[No output]
wheat bane
#

!e print(dir(str))

timid fjordBOT
#

@wheat bane :white_check_mark: Your eval job has completed with return code 0.

['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'removeprefix', 'removesuffix', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
wheat bane
#

dir(str)

icy raven
#

what is snake case

wheat bane
#

will show all the method of string

novel perch
#

i can't speak on the live-coding why?

icy raven
#

is_something

#

like that...

wheat bane
wheat bane
#

isSomethig is camel case

icy raven
#

I think snakecase is better camel case...

#

but I hate python standard lib is non consistent with it

#

why not

is_upper()

#

why is it list not List

#

Rust style is perfect...

#

snake case is for functions and variables
Camel case for classes and all

#

I think it is a reference to hitch hikers guide to the galaxy

novel perch
#

why he use the .isdecimal():

#

it's a name

#

omar

wheat bane
#

select detect laguage

novel perch
#

no

#

yes

#

yes

wheat bane
#

remove the question mark

icy raven
#

Today, I realized we don't have linux emojis in pydis

#

logo_notion we have f-ing notion

#

logo_vsc_insiders and vs code insider release logo 🤦‍♂️

#

but not linux

#

no

fresh sail
#

🐧

icy raven
#

it doesn't look like that in ios

novel perch
#

omar doesn't mean age it's a name from a guy he was a friend of Prophet Mohammed and it has a different pronunciation

novel perch
#

omar

#

with o

#

omar

#

yes

leaden drift
#

you want to continue

#

yes

novel perch
#

nice

wheat bane
#

keya haal hay is whats the condition

#

how are you is aap kaise huu

stark quiver
#

@fresh sail sorry to disturb, do you do these at set times every day? i need to go but this is really cool!

potent crow
#

kek

stark quiver
#

thank you

#

yes that time works perfectly

leaden drift
#

anytime for me

#

around 2am

potent crow
#

it's a worse time for me 😦 currently it's 11:20pm

leaden drift
#

yes

stark quiver
icy raven
#

have you seen dr. normal in the universe of sane @leaden drift

potent crow
#

well I know good amount of python I was just enjoying your voice

leaden drift
#

.join is very useful

icy raven
#

only list of strings

leaden drift
#

add .split() at the end

wheat bane
#

!e print("cats"+"bats")

timid fjordBOT
#

@wheat bane :white_check_mark: Your eval job has completed with return code 0.

catsbats
leaden drift
#

🤣

potent crow
#

join and split together is useless

wheat bane
#
  • can be used to concat two string
potent crow
#

you got trolled bro stop

icy raven
#

!e

s = "hey hi hello"
print("-".join(s.split()))
timid fjordBOT
#

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

hey-hi-hello
leaden drift
#

.split('-')

potent crow
#

!e

s = 'hey hi hello'
print(s.replace(' ', '-'))
timid fjordBOT
#

@potent crow :white_check_mark: Your eval job has completed with return code 0.

hey-hi-hello
icy raven
#

but i only use join to print a list in some format...

wheat bane
#

!e print("hey hi hello".replace(" ","-"))

timid fjordBOT
#

@wheat bane :white_check_mark: Your eval job has completed with return code 0.

hey-hi-hello
fallen gulch
#

❤️

leaden drift
#

yes

#

!e

words = ''
for i in ['cats','rats','bats']:
    words += i
print(words)
timid fjordBOT
#

@leaden drift :white_check_mark: Your eval job has completed with return code 0.

catsratsbats
leaden drift
#

yep

#

no

#

tuple and list are already separate

icy raven
#

!e

nums = list(range(7))
print(" ".join(str(x) for x in nums))
leaden drift
#

🤣

#

print the value

timid fjordBOT
#

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

0 1 2 3 4 5 6
icy raven
#

that's the only thing I ever use join for........

leaden drift
#

'cats': 3

#

guess who is here

calm bay
#

You can always just do a cheeky "-".join(map(str, ...))

leaden drift
#

replace ... with list

#

almost like a generator

icy raven
#

I like comprehension better...

leaden drift
#

no no that was earlier when you copied @calm bay example

#

yes

wheat bane
#

do nvidia make linux driver opensource? or the kernel module opensource?

calm bay
#
map(f,...)
(f(x)for x in ...)
wheat bane
#

driver is still closed source

calm bay
#

If you're using map with a lambda at that point I prefer a comprehension too

leaden drift
#

split I believe returns the value

#

so do string = string.split('\n')

icy raven
calm bay
#

fair enough, I just feel cool using map 😅

icy raven
#

map + (reduce or filter)

leaden drift
#

!e print('catsratsbats'.partition('s'))

timid fjordBOT
#

@leaden drift :white_check_mark: Your eval job has completed with return code 0.

('cat', 's', 'ratsbats')
leaden drift
#

and you don't have to use try and except block

#

if your unpacking

#

ctrl + alt down

icy raven
#

I don't know..... I'm feeling like this is a video ... I keep pressing right arrow to forward video...

#

😂

potent crow
#

wow the center() was really helpful for me

calm bay
leaden drift
icy raven
leaden drift
#

@fresh sail look at the resource mustafa sent

calm bay
#

@tulip python how do i stop the pain

#

(we were watching your pycon talk)

honest pasture
wheat bane
#

i cannot find a good fuzzy search library

wheat bane
#

fuzzy wuzzy will give you the ratio but do not give the location of the sub string match

buoyant kestrel
#

Didn't realize that

icy raven
#

to do that you need to that algorithm through all substring, it will take like n^3... (maybe there is better way)

icy raven
#

I feel like we can do some optimization... and get it down to n^2

#

I'll try that tomorrow... and I'll dm you if I could do it..

wheat bane
#

i think not. because it should have to go through all the variable length substring

icy raven
#

i gotta sleep, bye 👋

wheat bane
#

good night

leaden drift
#

back

#

not really

leaden drift
#

alright 🤣 enjoy your day!

wheat bane
#

lol

leaden drift
#

🤣

tulip python
#

strange that the talk is now 10 years old

calm bay
#

that's a long time indeed

humble hinge
#

What are you guy's / gal's working on?

craggy ore
#

what is this project about, i'm trying to figure out

craggy ore
#

hello

shrewd sierra
#

HI

primal bison
wide aurora
#

!e

def resolve(value: int):
    if value < 10:
        yield value
        return

    str_v = str(value)

    yield from resolve(sum(int(c) for c in str_v))


def resolve_multiple(*values):

    for value in values:
        yield from resolve(value)


gen = resolve_multiple(10234,23423)

for val in gen:
    print(val)
timid fjordBOT
#

@wide aurora :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 5
wide aurora
#

!e

import asyncio
from asyncio import create_task


async def resolve(value: int):
    if value < 10:
        return value

    str_v = str(value)
    await asyncio.sleep(int(str_v[0]))
    return await resolve(sum(int(c) for c in str_v))


async def resolve_multiple(*values):
    tasks = [create_task(resolve(v)) for v in values]

    for result in asyncio.as_completed(tasks):
        yield await result


async def main():
    async for result in resolve_multiple(321, 42, 5):
        print(result)


asyncio.run(main())
timid fjordBOT
#

@wide aurora :white_check_mark: Your eval job has completed with return code 0.

001 | 5
002 | 6
003 | 6
agile portal
#

@wide aurora from os import open? xD

wide aurora
misty tinsel
#

can i speak?

wide aurora
#

gtg

#

might be back later

#

i'm probs gonna try and make a as_completed for async iters

#

sounds like a fun problem

#

ty for the brain thoughts

dreamy sable
#

@atomic phoenix

dreamy sable
wide aurora
#

!e

import asyncio
from asyncio import create_task, sleep
from typing import AsyncGenerator


async def as_completed(*async_generators: AsyncGenerator[int, None]) -> AsyncGenerator[int, None]:
    """Get the values of async generators as they are yielded.

     Wait for a result from at least one of the async generators.
        Then iterate over all the completed tasks, yielding their result.
        And then creating the next task to gather a result.
     """
    steps = {
        create_task(anext(g), name=str(i)) for i, g in enumerate(async_generators)
    }

    while steps:
        done, steps = await asyncio.wait(steps, return_when=asyncio.FIRST_COMPLETED)

        for d in done:
            try:
                yield int(d.get_name()), d.result()
            except StopAsyncIteration:
                print(f"{d.get_name()}: completed")
            else:
                steps.add(create_task(anext(async_generators[int(d.get_name())]), name=d.get_name()))


async def f(start: int, end: int) -> AsyncGenerator[int, None]:
    """Example async generator"""
    for i in range(start, end):
        await sleep(0.01 * i)
        yield i


async def main() -> None:
    async_generators = [f(5, 10), f(1, 3), f(6, 11)]

    # Handle results as they come from the async generators
    async for i, result in as_completed(*async_generators):
        print(f"{i}: returned {result}")


asyncio.run(main())
timid fjordBOT
#

@wide aurora :white_check_mark: Your eval job has completed with return code 0.

001 | 5
002 | 1
003 | 2
004 | 6
005 | 7
006 | 8
007 | 9
wide aurora
#

@atomic phoenix ^

#

it uglly

#

but it work

#

ite

potent crow
#

what are you guys building?

icy raven
#

what you doing @atomic phoenix

#

yeah

#

okay...

#

why... for fun or for something

#

@atomic phoenix tell him to change that float to string... ig

novel perch
#

hi do u know wen they going to start

icy raven
#

start what?

novel perch
#

the live_coding

icy raven
#

if you are talking about automating the boring stuff... it is only on tuesdays and thursdays, ig

novel perch
#

oh ok thx

icy raven
#

@calm bay what are the timings....

fresh sail
#

"relating to or designed for efficiency and comfort in the working environment."

scenic ridge
#

eggs, bacon, spam = 'What is going on, Marty?'.partition(',')

#

what is bacon after the following lines are executed?

primal bison
#

🖐️

primal bison
#

ghrqs

empty plover
#

!e ```py

import random

li = [1,2,3]

print(li.random.choice)

timid fjordBOT
#

@empty plover :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 5, in <module>
003 | AttributeError: 'list' object has no attribute 'random'
empty plover
#

eh idc

calm bay
#

!e

import random
li = [1,2,3]
print(random.choice(li))
timid fjordBOT
#

@calm bay :white_check_mark: Your eval job has completed with return code 0.

1
calm bay
#

@empty plover

thorn comet
#

!e

timid fjordBOT
#
Missing required argument

code

teal rune
#

!e

timid fjordBOT
#
Missing required argument

code

teal rune
#

!e

print(“hola qué tal”)

timid fjordBOT
#

@teal rune :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(“hola qué tal”)
003 |           ^
004 | SyntaxError: invalid character '“' (U+201C)
teal rune
#

A

#

!e

print('hola qué tal')

timid fjordBOT
#

@teal rune :white_check_mark: Your eval job has completed with return code 0.

hola qué tal
teal rune
#

!e

input('sexo la pelicula')

timid fjordBOT
#

@teal rune :x: Your eval job has completed with return code 1.

001 | sexo la peliculaTraceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
teal rune
#

A

reef marsh
#

!e

timid fjordBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

reef marsh
#

!e

print("hello")

blazing relic
thorny dune
#

what is the best data type in python to implement from it a graph data structure ?

#

and can I nest dictionary 3 times ?

potent sky
#

tryeth and thou shall see. There is no limit as far as I know

primal bison
#

!e

timid fjordBOT
#
Missing required argument

code

primal bison
#

oops

#

!e
while True:
print("does this work or nah")

#

well i guess it technically does

spice spire
#

bruh\

bitter ridge
#

hi

potent crow
#

I'm not muted, I'm mute

#

yeah wanna read the boring stuff book?

#

wait 10 mins if you have time

#

k brb

potent crow
#

Back

#

no clue, where did you left?

#

let's continue from there

#

I have vscode and pycharm, I have good basic knowledge on python. Learning couple of new things from this book.

rapid vapor
#

I just got a bs 🤣

#

Btw im starting to learn pyhton im new

fresh sail
#

Bachelors of science?

potent crow
#

currently learning assembly to start developing my hobby OS

rapid vapor
#

Thanks 💀

#

Im watching

#

Only

rapid vapor
#

Nope good 😄 all set

potent crow
fresh sail
#

👁️ ❤️ emoji

#

what is the emoji for emoji?

potent crow
#

:emoji:

#

ayo my internet is having stroke I'll restart my router

fresh sail
#

pip install pyperclip

agile portal
#

snake_case
camelCase
PascalCase

vernal snow
#

reverse-cameL-kebaB-casE

agile portal
#

AnNoYiNgCaSe

potent crow
fresh sail
#

4:00 PM - 6:00 PM UTC

potent crow
#

utc+6

#

it's 10:08 PM

buoyant kestrel
#

@calm bay where you at, gurl?

potent crow
#

return carriage

buoyant kestrel
#

I was wrong. I'm thinking of something else. Although there is no strict convention for using either yay or way

#

So it's just what sounds better in those cases

#

"every" = "eryevay"
"another" = "otheranay"
"under" = "erunday"
"island" = "andislay"
"elegant" = "egantelay"

agile portal
#

i love how the gaming chat program is named discord aka disagreement between people which is very fitting

and the work chat program is named slack which is also very fitting as most people slack off on work o- o

#
foo = list(range(10))

even_squared_foo = [item_sq for item in foo if (item_sq := item ** 2) % 2 == 0]
#

^ example of where i might use it (walrus )

upbeat peak
#

@primal bison I love the name and wish it worked xD

primal bison
upbeat peak
#

damn, for me it said life has no Module 'gf' (idk the error messages too well)

#

xD

agile portal
#

@buoyant kestrel record this and make it audiobook with author's permission? 😮

#

he does but still

fresh sail
#

EyhayOssbay,Iyayon'tdayowknayatwhayIyayamyayoingday,Iyayamyayustjayollowingfayethayirectionsday

#

Eyhay Ossbay, Iyay on'tday owknay atwhay Iyay amyay oingday, Iyay amyay ustjay ollowingfay ethay irectionsday

rocky charm
#

3.1.1.31100128

fresh sail
#

Runes are the letters in a set of related alphabets known as runic alphabets. Runes were used to write various Germanic languages before the adoption of the Latin alphabet and for specialised purposes thereafter. In addition to representing a sound value (a phoneme), runes can be used to represent the concepts after which they are named (ideogra...

rapid vapor
#

have fun, bye 👋🏽

agile portal
#

@rocky charm @buoyant kestrelhttps://semver.org/#spec-item-10 <-- so its build metadata in general but in matt's case its the actual current build number which is similar to how we do it in .Net

honest pasture
#

!e print("3".isalpha())

timid fjordBOT
#

@honest pasture :white_check_mark: Your eval job has completed with return code 0.

False
honest pasture
#

Alpha = alphabet not alphanumeric

#

!e print("3".isalnum())

timid fjordBOT
#

@honest pasture :white_check_mark: Your eval job has completed with return code 0.

True
buoyant kestrel
#

prefixNonLetters += word[0]

leaden drift
honest pasture
#

!e print(dir(""))

timid fjordBOT
#

@honest pasture :white_check_mark: Your eval job has completed with return code 0.

['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'removeprefix', 'removesuffix', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
potent crow
#

?

honest pasture
#

!e print("2.5".isdigit())

timid fjordBOT
#

@honest pasture :white_check_mark: Your eval job has completed with return code 0.

False
leaden drift
#

the .

#

yes

agile portal
#

!e print("2.5".isnumeric())

timid fjordBOT
#

@agile portal :white_check_mark: Your eval job has completed with return code 0.

False
potent crow
#

special character to have some function in a string

honest pasture
#

!e print("2.5".isdecimal())

timid fjordBOT
#

@honest pasture :white_check_mark: Your eval job has completed with return code 0.

False
honest pasture
#

isdecimal(self, /)
Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and
there is at least one character in the string.
#

I do not understand

leaden drift
#

tab and endline

potent crow
#

/t = tab
/n = newline

leaden drift
#

newline*

potent crow
#

ah

#

my bad

fresh sail
#

< >

leaden drift
#

is the \r also the same thing?

potent crow
leaden drift
#

oh

potent crow
#

\r\n

#

win

#

\

leaden drift
#

double \

potent crow
#

\

#

damn it escapes

honest pasture
#

isnumeric vs isdigit is the world's dumbest thing

leaden drift
#

🤣

potent crow
#
\\
leaden drift
#

pretty sure it's in utf-8 encoding when scraping websites

potent crow
#

yeah

#

mostly

honest pasture
#

I cannot describe how dumbfounded I am at the differences between isnumeric, isdigit, and isdecimal

buoyant kestrel
#

Yeah that's thrown me for a loop

honest pasture
#

the difference is literally just which esoteric unicode characters they support

agile portal
#

!e

print(""""hello" 'world'""")
timid fjordBOT
#

@agile portal :white_check_mark: Your eval job has completed with return code 0.

"hello" 'world'
buoyant kestrel
#

@carmine current 👋

honest pasture
#

!e

print("""
hello

this has newlines
""")```
icy raven
#

!e

a = ["hello""world"]
print(a)
timid fjordBOT
#

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

['helloworld']
#

@honest pasture :white_check_mark: Your eval job has completed with return code 0.

001 | 
002 | hello
003 | 
004 | this has newlines
leaden drift
#

return it

#

\r

#

🤣

#

still works

potent crow
leaden drift
#

yes

potent crow
#

I agree

carmine current
#

meh i cant spoiler code blocks

potent crow
#

wtf

#

it vanished

carmine current
#

discord itself documents that codeblocks count as a spoiler tag ending

leaden drift
#
def printTable(data):
    data = sorted(data, key=len)

    for row in data:
        for col in row:
            print(col,end=' ')
        print()
potent crow
#

!e

def printTable(data):
    data = sorted(data, key=len)

    for row in data:
        for col in row:
            print(col,end=' ')
        print()
leaden drift
#

thank you!

leaden drift
#

!e

def printTable(data):
    data = sorted(data, key=len)

    for row in data:
        for col in row:
            print(col,end=' ')
        print()


tableData = [['apples', 'oranges', 'cherries', 'banana'],
             ['Alice', 'Bob', 'Carol', 'David'],
             ['dogs', 'cats', 'moose', 'goose']]


printTable(tableData)
timid fjordBOT
#

@leaden drift :white_check_mark: Your eval job has completed with return code 0.

001 | apples oranges cherries banana 
002 | Alice Bob Carol David 
003 | dogs cats moose goose 
potent crow
#

!e

def printTable(data):
    data = sorted(data, key=len)

    for row in data:
        for col in row:
            print(col,end=' ')
        print()
printTable()
timid fjordBOT
#

@potent crow :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 8, in <module>
003 | TypeError: printTable() missing 1 required positional argument: 'data'
potent crow
#

brueh

#

cringe

honest pasture
potent crow
#

!e

def printTable(data):
    data = sorted(data, key=len)

    for row in data:
        for col in row:
            print(col,end=' ')
        print()
printTable('hello')
timid fjordBOT
#

@potent crow :white_check_mark: Your eval job has completed with return code 0.

001 | h 
002 | e 
003 | l 
004 | l 
005 | o 
potent crow
#

Magic girl you should try 'leek'

primal bison
#

!e

timid fjordBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

honest pasture
#

!timeit print('hi')

timid fjordBOT
#

@honest pasture :white_check_mark: Your timeit job has completed with return code 0.

500000 loops, best of 5: 631 nsec per loop
agile portal
#

think i gotta go now :x i might join back later or on thursday cya guys later :3

leaden drift
#

bye

primal bison
#

!e def printTable(data):
data = sorted(data, key=len)

for row in data:
    for col in row:
        print(col,end=' ')
    print()

printTable('hello')

timid fjordBOT
#

@primal bison :white_check_mark: Your eval job has completed with return code 0.

001 | h 
002 | e 
003 | l 
004 | l 
005 | o 
honest pasture
#

!timeit ([*range(900_000_0)])

primal bison
#

!e

timid fjordBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code block. Code can be re-evaluated by editing the original message within 10 seconds and clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!*

primal bison
#

the code is too big

honest pasture
#

!timeit

from math import sqrt
for n in range(900_000_0):
  sqrt(n)
potent crow
#

!e

x = 2
while True:
  x *= x
timid fjordBOT
#

@potent crow :warning: Your eval job timed out or ran out of memory.

[No output]
potent crow
#

lol

timid fjordBOT
#

@honest pasture :white_check_mark: Your timeit job has completed with return code 0.

1 loop, best of 5: 877 msec per loop
honest pasture
#

#bot-commands

potent crow
#

!e

import requests
req = requests.get('https://api.myip.com/').json()
print(req)
timid fjordBOT
#

@potent crow :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'requests'
potent crow
#

damn

#

!e

import os
print(os.getcwd())
timid fjordBOT
#

@potent crow :white_check_mark: Your eval job has completed with return code 0.

/snekbox
carmine current
#

!e ```py
def printTable(table):
col_l = [len(max(col, key=len)) for col in table]
for row in zip(*table):
print(" | ".join(item.rjust(col_l[i]) for i, item in enumerate(row)))

table = [["aaaaaaaa", "aaa", "a"],["bbb", "bbbbbb", "bb"],["ccc", "cccccccccc", "ccc"]]
printTable(table)

timid fjordBOT
#

@carmine current :white_check_mark: Your eval job has completed with return code 0.

001 | aaaaaaaa |    bbb |        ccc
002 |      aaa | bbbbbb | cccccccccc
003 |        a |     bb |        ccc
potent crow
#

!e

import os
print(os.listdir())
timid fjordBOT
#

@potent crow :white_check_mark: Your eval job has completed with return code 0.

['Pipfile.lock', 'Pipfile', 'config', 'snekbox', 'user_base', 'tests', 'LICENSE']
potent crow
#

!e

import os
os.remove(Pipfile.lock)
timid fjordBOT
#

@potent crow :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | NameError: name 'Pipfile' is not defined
leaden drift
#

what are you trying to do?

#

oh

potent crow
#

!e

import os
os.remove('Pipfile.lock')
timid fjordBOT
#

@potent crow :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | OSError: [Errno 30] Read-only file system: 'Pipfile.lock'
leaden drift
#

okay

buoyant kestrel
#

#bot-commands

potent crow
#

k

#

good night everybody

icy raven
#

!e

def printTable(data):
    n = len(max( max(d, key=len) for d in data))
    # print(n)
    for row in data:
        for col in row:
            # print(len(x))  
            print( " " * (n - len(col)) + col, end= "  ")
        print()
            
data = [["hello", "world dddd"], ["hi", "world"]]
printTable(data)
timid fjordBOT
#

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

001 |      hello  world dddd  
002 |         hi       world  
leaden drift
#

hmm

#

!e

timid fjordBOT
#
Missing required argument

code

buoyant kestrel
#

!stream 833767295993905242

timid fjordBOT
#

✅ @mild goblet can now stream until <t:1652810247:f>.

icy raven
#

I think furyo is feeling pressured cause alot of people are watching...

leaden drift
#

!e

data = [i for i in range(4)]

for i in range(len(data)):
  print(data[i])

print('part 2')
for i in data:
  print(i)
timid fjordBOT
#

@leaden drift :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 1
003 | 2
004 | 3
005 | part 2
006 | 0
007 | 1
008 | 2
009 | 3
buoyant kestrel
honest pasture
#

This dark theme is perfect IMO

#

!e

a = []
a.append(a)
print(a)
timid fjordBOT
#

@honest pasture :white_check_mark: Your eval job has completed with return code 0.

[[...]]
icy raven
#

... is also pass

buoyant kestrel
#

!e

a = []
a.append(a)
print(a)
print(repr(a))
timid fjordBOT
#

@buoyant kestrel :white_check_mark: Your eval job has completed with return code 0.

001 | [[...]]
002 | [[...]]
honest pasture
#

The same as the ellipsis literal “...”. Special value used mostly in conjunction with extended slicing syntax for user-defined container data types. Ellipsis is the sole instance of the types.EllipsisType type

leaden drift
#

!e

def printTable(data: list):
    a = 0
    for row in data:
        current_data = ' '.join(row)
        if len(current_data) > a:
            a = len(current_data)

    for i in data:
        current_data = ' '.join(i)
        print(current_data.center(a,' '))


tableData = [
    ['apples', 'oranges', 'cherries', 'banana'],
    ['Alice', 'Bob', 'Carol', 'David'],
    ['dogs', 'cats', 'moose', 'goose']
    ]


printTable(tableData)
timid fjordBOT
#

@leaden drift :white_check_mark: Your eval job has completed with return code 0.

001 | apples oranges cherries banana
002 |     Alice Bob Carol David     
003 |     dogs cats moose goose     
leaden drift
#

:/

#

oh well

icy raven
#
for row in data:
     for col in row:
          ...

@leaden drift

leaden drift
buoyant kestrel
icy raven
leaden drift
#

oh

fresh sail
honest pasture
#

!eol 3.6

leaden drift
#

!el 3.5

timid fjordBOT
#

for-else

In Python it's possible to attach an else clause to a for loop. The code under the else block will be run when the iterable is exhausted (there are no more items to iterate over). Code within the else block will not run if the loop is broken out using break.

Here's an example of its usage:

numbers = [1, 3, 5, 7, 9, 11]

for number in numbers:
    if number % 2 == 0:
        print(f"Found an even number: {number}")
        break
    print(f"{number} is odd.")
else:
    print("All numbers are odd. How odd.")

Try running this example but with an even number in the list, see how the output changes as you do so.

honest pasture
#

!release 3.6

lament geyser
#
​No Category:
  help Shows this message

Type !help command for more info on a command.
You can also type !help category for more info on a category.
icy raven
#

!e

data = ["hello", "hi", "bbbbbbbbb", "z"]
data = sorted(data, key=len)
print(data)
timid fjordBOT
#

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

['z', 'hi', 'hello', 'bbbbbbbbb']
icy raven
mild goblet
#

are you guys able to hear me ?

fresh sail
#

Can't hear you

#

you are muted and deafened.

tall crystal
#

Write a method that, efficiently with respect to time used, finds the n-th lowest selling book in the list. Each element of the sales list represents a single sale of a book with that book's id. The n-th lowest selling book is the book that has more sales than n-1 books. Assume that book sales counts are unique. For example, nth_lowest selling([5, 4, 3, 2, 1, 5, 4, 3, 2, 5, 4, 3, 5, 4, 5], 2) should return 2. In the list, the book with the id 1 was sold once, id 2 twice, id 3 three times, id 4 four times, and id 5 five times, making the book with the id 1 the lowest selling book in the array and id 2 the second-lowest selling book.
def nth_lowest_selling(sales, n):
"""
:param elements: (list) List of book sales.
:param n: (int) The n-th lowest selling element the function should return.
:returns: (int) The n-th lowest selling book id in the book sales list.
"""
return None

if name == "main":
print(nth_lowest_selling([5, 4, 3, 2, 1, 5, 4, 3, 2, 5, 4, 3, 5, 4, 5], 2))

green kettle
#

!e

timid fjordBOT
#
Missing required argument

code

fair shore
#

def main():
print("Introducing magic Six!")
def magicSix(a,b):
a = 0
b = 0
magicSix = 6
a = int(input("What is your input for A? "))
b = int(input("What is your input for b? "))
if a or b or (a + b) or (a - b) != 6
return('Not a Magic 6')
elif a or b == 6
return ("Magic 6!")
else:
if (a + b) == 6 or (a - b) == 6:
return("Magic 6!")

print("magicSix", a,b))
main()

#

what is syntax error for if a or b or (a + b) or (a - b) != 6

#

not sure how to fix

magic void
#

#p snoop dog

primal bison
#

you guys gotta try this script

umbral crow
#

i am noob coder

#

i only know how to write about storys

#

in python

#

nothing else

leaden drift
#

🤣

#

How are you Mr. Hemlock

agile portal
#

i'm here if i don't forget

#

which i do quite often

buoyant kestrel
buoyant kestrel
#

It's right down near the bottom

buoyant kestrel
#

Thanks. I can never remember how to do that.

upbeat mirage
#

We're making automated bots for games? I hear there's one for TF2.

#

Makes the game unplayable though

leaden drift
buoyant kestrel
#

TIL

leaden drift
#

and tomorrow you use!

buoyant kestrel
#

Ooo, I like that follow up to that.

leaden drift
#

fix the string

upbeat mirage
#

BRB getting a burrito

leaden drift
#

never 🙂

#

🤣

#

to many sponsor

icy raven
#

This conversation is brought to you by Nord VPN

buoyant kestrel
#

More like NERD VPN

leaden drift
icy raven
upbeat mirage
#

wait when did we get gopnik hemlock?!?

buoyant kestrel
#

-sighs- Still amazed someone made and added that

proper cobalt
#

incredible

icy raven
agile portal
#

we need this

icy raven
#

@buoyant kestrel we still don't have linux penguin in pydis

#

[this is a public service announcement]

buoyant kestrel
icy raven
upbeat mirage
leaden drift
icy raven
#

which hemlock is typing

upbeat mirage
#

conda install -c conda-forge zombiedice

solemn marsh
#

What's Magical Girl doing?

upbeat mirage
#

We got a Mr. Hemlock suggesting conda. let's gooooooo

#

chocolatey

solemn marsh
#

What's @fresh sail doing? I can't recognize it.

leaden drift
#

zombiedice

solemn marsh
#

Yes

upbeat mirage
solemn marsh
#

Thanks 🙂

leaden drift
#

do ctrl + on vscode

icy raven
#

ctrl + what?

solemn marsh
#

Wow, speed running Python.

buoyant kestrel
#

CTRL + +

solemn marsh
#

?

upbeat mirage
#

Alt + F4

leaden drift
icy raven
#

haha

leaden drift
#

I understand what the C means now

upbeat mirage
#

⊞ + L

leaden drift
#

what kind of error?

solemn marsh
#

A very intriguing conversation.

#

Look to the left-hand side margin.
Everyone is Mr.Hemlock.

icy raven
leaden drift