#voice-chat-text-0

1 messages Β· Page 175 of 1

whole bear
#

Me?

sacred crag
#

I would love to be able to use linux But it just isn't compatible with my company's ecosystem. Although Powershell does support a lot of commands And more all the time And I absolutely love WSL

sacred crag
#

nooooo

#

thank god not. we are very Microsoft based

#

I did try but using one drive on Linux is basically asking for trouble

somber heath
#

@naive abyss πŸ‘‹

#

!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.

naive abyss
#

πŸ‘‹

sacred crag
#

@somber heath I'm yet to hit the 50 message target.

#

I must be close

#

i'll use the 12 to describe the project I'm doing,

naive abyss
#

How can I know how many messages I have sent?

sacred crag
#

Ukraine currently cannot be accessed by plane
(I'm on desktop app)

somber heath
sacred crag
#

Someone has created a handy website with guides on how to access ukraine via various land borders. it's agreat and comprehensive guide but it's unforunateley not in english

gentle flint
#

there are 42 results, so you've sent 42 messages

naive abyss
#

Thank you. (43)

sacred crag
#

I would suggest a download directory and A long term download directory, the script would empty the downloads directory

#

can't beat @somber heath . Talking is definitely faster than typing

#

it's 7.40 am here

sacred crag
#

Sorry did someone mention my name I wasn't listening

whole bear
#

Am spy

sacred crag
#

I sell Hosting plans happy to give you a free account

#

but it'll be UK hosted.

somber heath
#

@night ruin πŸ‘‹

night ruin
#

Hi, I don't have permissions to talk

somber heath
wise cargoBOT
#
Voice verification

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

night ruin
#

Ahh, all i clear

somber heath
#

@merry cobalt πŸ‘‹

sacred crag
#

People are bouncing in and out

unborn storm
#

n(n+1)/2 is the sum of integers from 1 to n.
It is also the binomial coefficients for 2 within n, i.e. the number of ways to pick 2 elements from a set of n elements.
n(n-1)/2 is the sum in integers from 1 to n excluded (so from 1 to n-1). It is the number of links you can make between n point, so it is also the number of glass sounds you will hear if n persons are cheering.

#

the proof is pretty simple also

#

binomial coefficients

#

it is if you are counting things with math ^_^
It is one of the most basic combinatorial tools

#

binomial coefficients appear in a lot of areas

#

nice

#

haha yeah that is sad. Also why i'm doing both CS and math bachelors.

vivid jacinth
#

yes

stoic chasm
#

my mic is not on

whole bear
#

Ok

somber heath
#

@sand ermine I said the web browser version of Discord behaves worse than the desktop client version of Discord.

#

@sand ermine Your audio activation sensitivity is also a bit high.

#

@wispy rover πŸ‘‹

#

@dull nexus πŸ‘‹

dull nexus
#

hi

sacred crag
#

I'm back

#

canberra

wispy rover
#

Hey : )

#

I wanna talk in voice chat but I need to send messages still

#

I really need help with a beginner problem 😭

#

bruh

sacred crag
#

just like this

wispy rover
#

I read them all : )

#

yep haha

whole bear
#

That’s ok homie just keep going

wispy rover
#

yes yes : )

whole bear
#

Peridot bestie so how’s ur day v

#

Like what’s going on bestie

wispy rover
#

its good, have family visiting

whole bear
#

Omg sound soo cool what you cooking

sacred crag
#

has anyone noticed anything? @somber heath

wispy rover
#

its like really beginner lmao

echo garden
#

FINALLY got the stupid headphones away from the origami wires

wispy rover
#

I will send you the code via message if thats ok

echo garden
#

i have the unfortunate obligation of attendings someones funeral today 😦

whole bear
echo garden
#

@somber heath you have a good evening? or having rather? i just woke a little while ago.

#

@whole bear baby...

stoic chasm
wispy rover
#

oop

wispy rover
#

I send you a friend request by the way opal

somber heath
echo garden
somber heath
wispy rover
#

i want to be able to talk lmao

sacred crag
#

cmd

echo garden
stoic chasm
#

py -3

#

python3

#

python

somber heath
#

Isn't Wagner sniffing around there, too?

echo garden
wispy rover
#

hey @somber heath was it ok if i messaged you that code?

dry jasper
unborn storm
somber heath
wise cargoBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

echo garden
#

@somber heath the sigh of relief when china said " uh, no, we don't like" to russia.

somber heath
#

A very strong message of disapproval, indeed.

echo garden
#

really

#

so, a ruse?

somber heath
#

Saying one thing, doing another.

stoic chasm
#

rotate(90, rectangle())
R
E
C
T
N
G
L
E

somber heath
#

Shocker.

echo garden
#

sneaky

echo garden
somber heath
wispy rover
#

my file isnt uploading?

somber heath
#

It's uploading and being killed by the bot.

#

!code

wise cargoBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

wispy rover
#

i formatted it correctly

#

bruh

#

sorry

#

can you copy that?

somber heath
#

Edit it.

wispy rover
#

slay

#

got it?

somber heath
#

Add the py

#

You got it. 😁

wispy rover
#

awesome

somber heath
#

See how much code you can remove.

#

I'm not in a ready position to run your code.

wispy rover
#

are you going to be running it?

somber heath
#

No.

whole bear
#

Hello

sacred crag
#

Canadians are practically North American Brits

dry jasper
#

or french guys πŸ˜„

whole bear
#

It's 30 degres here

#

hii

turbid sandal
#

@echo garden Sorry for your loss

warped raft
#

@turbid sandal hello
what's the story

rugged root
whole bear
#

its raining here

cerulean ridge
#

@somber heath grippy socks like this?

whole bear
#

these are called barefoot shoes

rugged root
#
Function GetFolderPath() As String
    Dim FileDialog As Object
    Dim SelectedFolder As String
    
    ' Create a FileDialog object as a Folder Picker dialog
    Set FileDialog = Application.FileDialog(msoFileDialogFolderPicker)
    
    ' Show the dialog and capture the user's selection
    If FileDialog.Show = -1 Then
        ' Get the selected folder path
        SelectedFolder = FileDialog.SelectedItems(1)
        GetFolderPath = SelectedFolder
    Else
        ' User Canceled the dialog
        GetFolderPath = ""
    
    ' Clean up
    Set FileDialog = Nothing
End Function
sweet lodge
#

u wot

#

VBA?

rugged heron
warped raft
#

if any one is interested in doing clash of code feel free to joing us

rugged root
sweet lodge
#

huh

#

yeye

uncut meteor
#

!e

from typing import Callable, TypeAlias


def is_longer_than_10(s: str) -> bool:
    return len(s) > 10


def is_cool(s: str) -> bool:
    return "cool" in s


Rule: TypeAlias = Callable[[str], bool]
DEFAULT_RULES: frozenset[Rule] = frozenset({
    is_longer_than_10,
    str.isalpha,
    str.isascii,
})

items: list[str] = []


def add(item: str, rules: frozenset[Rule] = DEFAULT_RULES) -> None:
    if all(rule(item) for rule in rules):  
      items.append(item)


add("hello")
add("abcdefghijk")
add("abcdefghijkcool", DEFAULT_RULES | {is_cool})
print(items)
wise cargoBOT
#

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

['abcdefghijk', 'abcdefghijkcool']
uncut meteor
#

would probs make RuleList class and allow for + to just add one rule rather than using the set union

dry jasper
#

πŸ‘‹ @vocal basin

#

do you have a idea how i can create a queue with the following logic?

vocal basin
#

I think it might be simpler to just have everything as AsyncIterable

#

with a function flatten: AsyncIterable[AsyncIterable[T]] -> AsyncIterable[T]

#

how is error handling done?

#

(or supposed to be done)

dry jasper
#

error handeling for the sorting?

vocal basin
#

are you getting url lists asynchronously?

#

or is it all static pre-generated?

dry jasper
#

they are saved in a mariaDB, and i fetch them from there

vocal basin
#

do you have enough RAM to just store them in a list?

dry jasper
#

no i dont think so

#

the lists are GB's

vocal basin
# dry jasper

you're trying to interleave them, right?
i.e. to make queueing balanced/fair

dry jasper
#

yes

#

because once i have connectec to a URL, i cant connect to a URL belonging to the same domain for 5 secs

vocal basin
#

separate queues per each domain + priority queue of domains

noble solstice
vocal basin
#

priority queue would contain pairs (time_to_next_connection, domain)

#

there's also another way

#

just have separate task per each domain

#

and asyncio.sleep(5) inside

sharp gulch
#

Do I need to download code runner for Python vs code and is this orange text bad

vocal basin
#

it seems to have ran successfully

#

you're doing print(type(something)), right?

vocal basin
#

all good then, it works

sharp gulch
#

And do I have to download code runner

vocal basin
#

it's okay as it is, seems like

#

this is just path to interpreter

#

i.e. it's not an error

sharp gulch
#

Ok thanks

vocal basin
#

@dry jasper are you using Python 3.11?

vocal basin
#
async def from_domain(domain, queue):
    async for url in urls_of(domain):
        await queue.put(url)
        await asyncio.sleep(5)
#

(this without priority queue, just regular one)

#

isn't guaranteed to interleave domains fairly, but will ensure timeout

dry jasper
#

normaly a timeout is not needed it the urls got distributed evenly

vocal basin
#

queue can be size-limited, so producers of URLs don't proceed until there are consumers waiting on the other end

dry jasper
#

because there are multiple tousand of domains, and before it is able the finish the first iteration the 5 seconds should be over

vocal basin
#
async def run(domains):
    queue = asyncio.Queue(maxsize=1)
    async with consume(queue):
        async with asyncio.TaskGroup() as tg:
            for domain in domains:
                tg.create_task(from_domain(domain, queue))
#

inner async with waits for all tasks to finish on exit

#

outer async with would wait for consumers to finish existing work, then stop them

#

(consumers are expected to call queue.task_done when then finish work on one url)

#

and consume's exit would just queue.join then .cancel consumers' tasks

noble solstice
#

is there any difference b/w trees and graph other than forming cycle?

vocal basin
#

connected acyclic undirected graph = tree

#

direction can be introduced into such tree by choosing a node as a root and edge directions such that any node can be reached from root

noble solstice
#

a tree can be directed a directed tree?

vocal basin
#

trees from graph theory don't involve directions

#

but what you usually find as a data structure, has parent-child relation defined for each edge

noble solstice
vocal basin
#

acyclic directed graphs are useful for describing data structures

noble solstice
vocal basin
#

you can pick one node as a root

#

then all directions are trivially derived

desert vector
#

great discussion fellas

scarlet halo
#

ys

#

yes

#

i know

vocal basin
#

in some interpretation of what "tree" is

scarlet halo
#

so 2 cant lead into 1

vocal basin
#

if root needs to exist and is defined as a node which you can reach any other node from

scarlet halo
#

<t:1691772240:R>

vocal basin
#

alternate between different ways of learning

willow light
#

And what if I just listen to your keystrokes and memorize what each letter sounds like?

#

Oh wait.

#

Β―_(ツ)_/Β―

#
var x = 5;

vs

let x: number = 5;
#

!e
print("Hello\tWorld")

wise cargoBOT
#

@willow light :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello	World
willow light
#

hot take: tabs and spaces are equally important, so we should use them interchangeably, but randomized

rugged root
vocal basin
#

print(..., sep="\t") when too lazy to set up proper logging but want to have better output alignment

willow light
#

oh I just use logging.log()

vocal basin
#

I mean so it looks roughly like a table, even with different lengths of elements

willow light
#

Or I'll just write logs to Redis and hope to god it doesn't break datadog

brisk bridge
#

What's the name of new language that coders using against python? I couldn't remember that

amber raptor
#

log to stdout

vocal basin
#

!e

for i in [1, 11, 111]:
    print(i, i, i, sep="\t")
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 1	1	1
002 | 11	11	11
003 | 111	111	111
vocal basin
#

eh

rugged root
#
x = 5
print(x)
vocal basin
#

doesn't work here

willow light
#

Now I need a pythonic equivalent of console.table

#

would be useful for a project I've been working on

#

(current project at work is entirely in sh and terraform)

amber raptor
#

phone pictures of screens, straight to jail

willow light
#

I was halfway through replying with a phone picture of you saying that but I thought better

#

It's friday, no need to annoy Rabbit.

vocal basin
#

there is table output in Jupyter

rugged root
vocal basin
#

part of the idea is to have it less manual, with automatic widths

#

but for that you'd have to pre-process everything

#

as you can't resize what you previously printed

#

\t allows it roughly aligned if lengths are similar without lookahead

#

you can also increase widths when needed

#

overall alignment is broken but it gets correct eventually

#

randomly guess widths, crash on overflow

willow light
#

I keep thinking this when it comes to spice

whole bear
#

πŸ˜‚πŸ˜‚

vocal basin
#

sunos?

vocal basin
#

there's also wasi
haven't seen it used

rugged root
#

Which one is that?

vocal basin
#

for, like, non-wasm application of same format

#

server-side wasm

#

kind of

#

allegedly

rugged root
#

Interesting

vocal basin
#

there are also regional versions of chrome for tracking use data

rugged root
#

Back in a sec

vocal basin
#

idk what China has for that

willow light
#

As someone whose entire social media presence these days is YouTube, Discord, and Mastodon....

vocal basin
#

I used to pay for nitro

#

but now, well, Russia, can't pay

#

it seems to use less bandwidth on deafen, but far from 0

willow light
#

I pay for "Unlimited" with Verizon and it's sooo expensive.

And "Unlimited" is in quotes for a reason

vocal basin
willow light
#

Something something raw radar files are 700 MB each, and I'm downloading six of them every seven minutes.

#

except during storms when it becomes 30 seconds

vocal basin
#

I host a Nextcloud server, seems good enough

amber raptor
#

I just pay for Dropbox

willow light
#

!pip netcdf

wise cargoBOT
#

A package to prevent Dependency Confusion attacks against Yandex.

willow light
#

oh not that

vocal basin
#

ohno Yandex

willow light
#

!pip netcdf4

wise cargoBOT
#

Provides an object-oriented python interface to the netCDF version 4 library

willow light
#

there it is

#

or just use this

#

!pip xarray

wise cargoBOT
willow light
#

basically the same data structure

willow gate
#

guys how can customize terminal like this?

amber raptor
#

Read the manual on your terminal

willow light
willow gate
vocal basin
#

idk about powershell/cmd.exe

willow gate
#

its mac terminal

vocal basin
#

zsh?

willow gate
willow light
#

!e

curl https://api.weather.gov/stations/KBOS/observations/latest | jq '.properties'
wise cargoBOT
#

@willow light :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 1
002 |     curl https://api.weather.gov/stations/KBOS/observations/latest | jq '.properties'
003 |          ^^^^^
004 | SyntaxError: invalid syntax
willow light
#

oh right

vocal basin
willow gate
vocal basin
#

or very similar

willow light
#

for satellite data you can get away with using this:

#

!pip MetPy

wise cargoBOT
#

Collection of tools for reading, visualizing and performing calculations with weather data.

willow light
#

!gh WRF

willow gate
#

its looks good

willow light
upper arch
#

WTF

willow gate
#

icon are diffrent

upper arch
willow light
willow gate
#

i saw this in mosh video

willow light
vocal basin
willow gate
willow light
#

PDM is love, PDM is life.

willow light
#

THANK GOD

#

!pip sympy

wise cargoBOT
upper arch
willow light
#

My TI-89 Titanium has entered the chat.

velvet tartan
#

Same, I’ve never used it too πŸ˜‚

#

It’s the end of an era though. Farewell, Cortana. 🫑

upper arch
#

Hey siri

willow light
#

Namespaces are one honking good idea, let's do more of those!

stuck furnace
#

Bram Moolenaar

#

πŸ‘‹

#

Nah just joined

willow light
#

Eventually I want to see this end up in a slide deck at work

upper arch
#

how bout that

willow light
#

I found the motherlode

stuck furnace
#

!ytdl

wise cargoBOT
#
Our youtube-dl, or equivalents, policy

Per Python Discord's Rule 5, we are unable to assist with questions related to youtube-dl, pytube, or other YouTube video downloaders, as their usage violates YouTube's Terms of Service.

For reference, this usage is covered by the following clauses in YouTube's TOS, as of 2021-03-17:

The following restrictions apply to your use of the Service. You are not allowed to:

1. access, reproduce, download, distribute, transmit, broadcast, display, sell, license, alter, modify or otherwise use any part of the Service or any Content except: (a) as specifically permitted by the Service;  (b) with prior written permission from YouTube and, if applicable, the respective rights holders; or (c) as permitted by applicable law;

3. access the Service using any automated means (such as robots, botnets or scrapers) except: (a) in the case of public search engines, in accordance with YouTube’s robots.txt file; (b) with YouTube’s prior written permission; or (c) as permitted by applicable law;

9. use the Service to view or listen to Content other than for personal, non-commercial use (for example, you may not publicly screen videos or stream music from the Service)
stuck furnace
#

Nick's OS πŸ˜„

#

It's pretty good

stuck furnace
#

Sounds like hell lol

willow light
#

"Oh, you like python? Name every python module"

upper arch
#

proceeds to name every python module in explicit detail while having a stroke

scarlet halo
#

progamer

#

ur cool

upper arch
#

ye

#

thnx

scarlet halo
#

np

upper arch
#

u2

scarlet halo
#

lets gooooo

proper grove
scarlet halo
#

gtg

oblique ridge
#

the following is actual code i've found in production:```python
def foo( bar='lorem',
baz=False,
spam='prod',
eggs=False
):

bar     = 'lorem'   if bar else 'ipsum'
baz     = True      if baz else baz
eggs    = True      if eggs else False  # this is all ass but this line hurt me the most
spam    = camelCase(getEnv()) if not eggs else camelCase('prod')
#
# my_module
for i, item in mylib.iiter(myDict):
    ...

# mylib
def iiter(dict):
    return iter(dict.items())
#
def foo(calculators, bar):
    ...
    return dict([(c, (c.resultSet(), bar)) for c in calculators])  # this legit is a performance hit
    # `return {c, (c.resultSet(), bar) for c in calculators}` can be from 65% - 140% faster
#
config['lorem']         = True if foo not in ['bar'] else False
config['ipsum']         = True if foo not in ['bar'] else False
config['dolor']         = True if foo not in ['bar'] else False
config['sit']           = True if foo not in ['bar'] else False  # instead, you can just do this
# `config['bar'] = True if foo != 'bar' else False`

logger.info( f"lorem     : {config['lorem']}"  )
logger.info( f"ipsum     : {str(config['ipsum'])}" )  # don't need to wrap with str(), that's what the fstring does already 
logger.info( f"dolor     : {str(config['dolor'])}" )  # and the lines above and below this showcase that
logger.info( f"sit       : {config['sit']}" )
vocal basin
#

iiter situation is excusable sometimes

#

for example, if that function had or is planned to have a different implementation

#

maybe including filtering, sorting, etc.

oblique ridge
#

hmm maybe. just haven't found it used anywhere like that every time i've seen it

vocal basin
#

but
dict as parameter name is inexcusable

oblique ridge
#

but eggs = True if eggs else False hurt me so much

vocal basin
#

there are cases adjacent to that, which are reasonable

#

when condition isn't bool

#

in seems to cast everything to bool

oblique ridge
#

per-interpreter GIL in 3.12

vocal basin
#

in C API now

#

and this a version later

#

Altair BASIC is a discontinued interpreter for the BASIC programming language that ran on the MITS Altair 8800 and subsequent S-100 bus computers. It was Microsoft's first product (as Micro-Soft), distributed by MITS under a contract. Altair BASIC was the start of the Microsoft BASIC product range.

#

so, yes, Gates did take part in developing a compiler, and that's kind of important to know given what consequences it had on proprietary software in general
https://en.wikipedia.org/wiki/An_Open_Letter_to_Hobbyists

"An Open Letter to Hobbyists" is a 1976 open letter written by Bill Gates, the co-founder of Microsoft, to early personal computer hobbyists, in which Gates expresses dismay at the rampant software piracy taking place in the hobbyist community, particularly with regard to his company's software.
In the letter, Gates expressed frustration with mo...

wary brook
#

hi

oblique ridge
#

have fun with all web safe sRGB colors in Luv space

desert wolf
wispy belfry
#

So speak with confidence and be rich.
No college degree necessary.

rugged root
#

Not entirely wrong

wispy belfry
#

JR makes interview a journey and ask precise questions that touch real interest of who he interviews.

#

Joe Regan or Impact Theory?

#

Man of culture

whole bear
#

victoria monet

proper grove
#

Play World of Tanks TODAY! pretty please https://tanks.ly/3O9rGBX

Oppenheimer Nukes Barbie AKA BarbieHeimer is a romantic thriller noir film directed by Martin Scorsese, and stars Tom Shelby, also known as Cillian Murphy and sometimes goes by the name J Robert Oppenheimer. He crafts a nuclear bomb to nuke Barbie land and Margot Robbie as well ...

β–Ά Play video
rugged root
#

Finally finished it

sweet lodge
rugged root
#

It was the easiest way to achieve what I needed, especially since this will be used by accountants and will need to be done potentially monthly

#

So just having it all packed away in Excel itself made the most sense

#

Makes it available, means I don't have to install Python on multiple computers

sweet lodge
rugged root
#

Okay so

sweet lodge
#

I’m not quite following the logic

rugged root
#

It takes a folder of excel files, dumps all the sheets into a single workbook and names them either BS for balance sheet or IS for income statement along with the client number for the sheet name

sweet lodge
#

Nice

rugged root
#

There's a way to do that on a per file basis built into excel, just not a per folder basis

sweet lodge
#

I’ve spent literally months working on my Excel combining

rugged root
#

Fun right?

#

SO great. TOTALLY NOT SARCASM

whole bear
#

hey

rugged root
#

Yo

whole bear
#

how are you guys

rugged root
#

Exhasuted. You?

whole bear
#

bored

sweet lodge
# rugged root SO great. TOTALLY NOT SARCASM

Lol
I’m handling a couple million dollars, and management is β€” basically like β€œthis better be right because we can’t double check it”
Fucking terrifying

whole bear
#

I'm sorry that u feel exhasuted

vocal basin
#

too lazy to split stuff up into multiple commits

rugged root
rugged root
whole bear
rugged root
#

I'll be heading home shortly, so that'll do it

vocal basin
whole bear
vocal basin
#

"imagine manually writing + Send 800 times, because there is no sane way to automate it"

#

"Citrus maxima"

sweet lodge
# rugged root Wait wait wait, what do you mean there's no way to double check it

Not that it’s β€œnot possible”, just that…. I think they just get overwhelmed because of the amount of data.

But β€” I do have automated tests and I do manual review, I just don’t get a second set of human eyes

And even when I do…. We fucked up the first year we had the project, and I was trying to understand the data, and my boss said β€œI need you in my office RIGHT NOW to figure this out!!”. I showed up in his office, and…. Spent over an hour fixing typos in the seven additional Excel files he had created for himself just to get the data correct before we could even start reviewing it

elfin bone
#

Hello people

dreamy grove
#

Ello all 😁

bright shoal
#
dictionary = {}
print("enter name and grade")

active = True
i = ""
while active:
    
    if i.lower() != "exit":
        name = input("enter name: ")
        grade = input("enter grade: ")
        dictionary[name] = grade
    else:
        active = False
    
    i = input("enter 'exit' when you are done: ")
for name, grade in dictionary.items():
    print(name, grade)

this program prints enter 'exit' when you are done twice when i enter exit someone help

wind raptor
#

!code @bright shoal

wise cargoBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

bright shoal
wind raptor
#

Thanks

bright shoal
#

thanks

wind raptor
bright shoal
#

i fixed it
thanks

wind raptor
#
dictionary = {}
print("enter name and grade")

while True:
    i = input("enter 'exit' when you are done: ")
    if i.lower() == "exit":
        break
    name = input("enter name: ")
    grade = input("enter grade: ")
    dictionary[name] = grade

for name, grade in dictionary.items():
    print(name, grade)
bright shoal
#
dictionary = {}
print("enter name and grade")

active = True
i = ""
while active:
    
    if i.lower() == "exit":
        active = False
    else:
        name = input("enter name: ")
        grade = input("enter grade: ")
        dictionary[name] = grade
        i = input("enter 'exit' when you are done: ")
for name, grade in dictionary.items():
    print(name, grade)
cunning lake
#

ok

#

not rude at all....

#

if some one want to talk . i am in this voice chat πŸ˜…

#

never mind forget it

minor elm
#

Why Hello

#

I created my first game

#

Very Basic

#

hahaha

#

where would i indent?

#

I get an error

#

Ahhh

somber heath
#

!code

wise cargoBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

minor elm
#

!import random

bet = int(input("Bet Ammount:"))

roll = random.randint(1,100)

if roll >50:print
("You rolled " + str(roll) + str(roll) + "You Loose")

else:
print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))

wise cargoBOT
#
Star / Wildcard imports

Wildcard imports are import statements in the form from <module_name> import *. What imports like these do is that they import everything [1] from the module into the current module's namespace [2]. This allows you to use names defined in the imported module without prefixing the module's name.

Example:

>>> from math import *
>>> sin(pi / 2)
1.0

This is discouraged, for various reasons:

Example:

>>> from custom_sin import sin
>>> from math import *
>>> sin(pi / 2)  # uses sin from math rather than your custom sin

β€’ Potential namespace collision. Names defined from a previous import might get shadowed by a wildcard import.
β€’ Causes ambiguity. From the example, it is unclear which sin function is actually being used. From the Zen of Python [3]: Explicit is better than implicit.
β€’ Makes import order significant, which they shouldn't. Certain IDE's sort import functionality may end up breaking code due to namespace collision.

How should you import?

β€’ Import the module under the module's namespace (Only import the name of the module, and names defined in the module can be used by prefixing the module's name)

>>> import math
>>> math.sin(math.pi / 2)

β€’ Explicitly import certain names from the module

>>> from math import sin, pi
>>> sin(pi / 2)

Conclusion: Namespaces are one honking great idea -- let's do more of those! [3]

[1] If the module defines the variable __all__, the names defined in __all__ will get imported by the wildcard import, otherwise all the names in the module get imported (except for names with a leading underscore)
[2] Namespaces and scopes
[3] Zen of Python

minor elm
#

!code import random

bet = int(input("Bet Ammount:"))

roll = random.randint(1,100)

if roll >50:print
("You rolled " + str(roll) + str(roll) + "You Loose")

else:
print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))

wise cargoBOT
#
Formatting code on discord

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.

For long code samples, you can use our pastebin.

minor elm
#

ok

somber heath
#

!indent

wise cargoBOT
#
Indentation

Indentation is leading whitespace (spaces and tabs) at the beginning of a line of code. In the case of Python, they are used to determine the grouping of statements.

Spaces should be preferred over tabs. To be clear, this is in reference to the character itself, not the keys on a keyboard. Your editor/IDE should be configured to insert spaces when the TAB key is pressed. The amount of spaces should be a multiple of 4, except optionally in the case of continuation lines.

Example

def foo():
    bar = 'baz'  # indented one level
    if bar == 'baz':
        print('ham')  # indented two levels
    return bar  # indented one level

The first line is not indented. The next two lines are indented to be inside of the function definition. They will only run when the function is called. The fourth line is indented to be inside the if statement, and will only run if the if statement evaluates to True. The fifth and last line is like the 2nd and 3rd and will always run when the function is called. It effectively closes the if statement above as no more lines can be inside the if statement below that line.

Indentation is used after:
1. Compound statements (eg. if, while, for, try, with, def, class, and their counterparts)
2. Continuation lines

More Info
1. Indentation style guide
2. Tabs or Spaces?
3. Official docs on indentation

minor elm
#

Thank You!

#

The game works but I want to save the Winnings (Total)

somber heath
#

!e py v = 5 v = v + 3 print(v)

wise cargoBOT
#

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

8
minor elm
#

Ahhh i see

somber heath
#

!e py v = 5 v += 3 print(v)

wise cargoBOT
#

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

8
minor elm
#

Got ya

somber heath
#

!d while

wise cargoBOT
#

8.2. The while statement

The while statement is used for repeated execution as long as an expression is true:


while_stmt ::=  "while" assignment_expression ":" suite
                ["else" ":" suite]
``` This repeatedly tests the expression and, if it is true, executes the first suite; if the expression is false (which may be the first time it is tested) the suite of the `else` clause, if present, is executed and the loop terminates.

A [`break`](https://docs.python.org/3/reference/simple_stmts.html#break) statement executed in the first suite terminates the loop without executing the `else` clause’s suite. A [`continue`](https://docs.python.org/3/reference/simple_stmts.html#continue) statement executed in the first suite skips the rest of the suite and goes back to testing the expression.
minor elm
#

How would i write, If my else statment was true to add to the Total... but if my "if statment" was true to take away from the total?

#

Ahhhh

#

That's what I needed

#

I'm still trying to get it working

#

mmm

#

So in my code, It asks for bet lets say 100, if they wiln it doubles to 200. How would i store this ammount for the next time they want to bet again?

#

Okay

#

So I would use a for loop?

#

Yes

#

Okay

#

Does the while go at the bottom of this code?

somber heath
#

!e py import random while random.randint(0, 4) != 3: print('Helllo!') print('Bye!')

wise cargoBOT
#

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

001 | Helllo!
002 | Bye!
minor elm
#

okay

#

got it

#

import random

while Ballance < 4000
#restart game and ask user to bet
#Else let the user know they have beaten the game

bet = int(input("Bet Ammount:"))

roll = random.randint(1,100)

if roll >50:print("You rolled " + str(roll) + str(roll) + "You Loose")

else: print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))

Ballance = bet x2
Ballance = Ballance

#

!import random

while Ballance < 4000
#restart game and ask user to bet
#Else let the user know they have beaten the game

bet = int(input("Bet Ammount:"))

roll = random.randint(1,100)

if roll >50:print("You rolled " + str(roll) + str(roll) + "You Loose")

else: print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))

Ballance = bet *2
Ballance = Ballance

wise cargoBOT
#
Star / Wildcard imports

Wildcard imports are import statements in the form from <module_name> import *. What imports like these do is that they import everything [1] from the module into the current module's namespace [2]. This allows you to use names defined in the imported module without prefixing the module's name.

Example:

>>> from math import *
>>> sin(pi / 2)
1.0

This is discouraged, for various reasons:

Example:

>>> from custom_sin import sin
>>> from math import *
>>> sin(pi / 2)  # uses sin from math rather than your custom sin

β€’ Potential namespace collision. Names defined from a previous import might get shadowed by a wildcard import.
β€’ Causes ambiguity. From the example, it is unclear which sin function is actually being used. From the Zen of Python [3]: Explicit is better than implicit.
β€’ Makes import order significant, which they shouldn't. Certain IDE's sort import functionality may end up breaking code due to namespace collision.

How should you import?

β€’ Import the module under the module's namespace (Only import the name of the module, and names defined in the module can be used by prefixing the module's name)

>>> import math
>>> math.sin(math.pi / 2)

β€’ Explicitly import certain names from the module

>>> from math import sin, pi
>>> sin(pi / 2)

Conclusion: Namespaces are one honking great idea -- let's do more of those! [3]

[1] If the module defines the variable __all__, the names defined in __all__ will get imported by the wildcard import, otherwise all the names in the module get imported (except for names with a leading underscore)
[2] Namespaces and scopes
[3] Zen of Python

minor elm
#

py

import random

while Ballance < 4000
#restart game and ask user to bet
#Else let the user know they have beaten the game

bet = int(input("Bet Ammount:"))

roll = random.randint(1,100)

if roll >50:print("You rolled " + str(roll) + str(roll) + "You Loose")

else: print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))

Ballance = bet *2
Ballance = Ballance

#

import random

while Ballance < 4000 
#restart game and ask user to bet 
#Else let the user know they have beaten the game

bet =  int(input("Bet Ammount:"))

roll = random.randint(1,100)

if roll >50:print("You rolled " + str(roll) + str(roll) + "You Loose") 

else: print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))


Ballance = bet *2
Ballance = Ballance 

#

Thanks ahha

#

Sorry i was getting confused with somthing else

#

that kept popping up

#

πŸ˜‹

#

import random

while Ballance < 4000: 
#restart game and ask user to bet 
#Else let the user know they have beaten the game

bet =  int(input("Bet Ammount:"))

roll = random.randint(1,100)

if roll >50:print("You rolled " + str(roll) + str(roll) + "You Loose") 

else: print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))


balance = bet*2
balance = balance 

#

import random

while Ballance < 4000: 
#restart game and ask user to bet 
#Else let the user know they have beaten the game

    bet =  int(input("Bet Ammount:"))

    roll = random.randint(1,100)

    if roll >50:print("You rolled " + str(roll) + str(roll) + "You Loose") 

    else: print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))


    balance = bet*2
    balance = balance 

#

import random

while balance < 4000: 
#restart game and ask user to bet 
#Else let the user know they have beaten the game

    bet =  int(input("Bet Ammount:"))

    roll = random.randint(1,100)

    if roll >50:print("You rolled " + str(roll) + str(roll) + "You Loose") 

    else: print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))


    balance = bet*2
    balance = balance 

#

Need to add a variable for balance

#

balance =

#

hmm

#

What should i say balance is?

#

0

#

ohh 100

#

So they have somthing

#

yeah

somber heath
#

@pallid sundial πŸ‘‹

minor elm
#

py if balance > 1

somber heath
#

!d and

wise cargoBOT
#
and

6.11. Boolean operations


or_test  ::=  and_test | or_test "or" and_test
and_test ::=  not_test | and_test "and" not_test
not_test ::=  comparison | "not" not_test
``` In the context of Boolean operations, and also when expressions are used by control flow statements, the following values are interpreted as false: `False`, `None`, numeric zero of all types, and empty strings and containers (including strings, tuples, lists, dictionaries, sets and frozensets). All other values are interpreted as true. User-defined objects can customize their truth value by providing a [`__bool__()`](https://docs.python.org/3/reference/datamodel.html#object.__bool__) method.

The operator [`not`](https://docs.python.org/3/reference/expressions.html#not) yields `True` if its argument is false, `False` otherwise.
somber heath
#

!e py print(5 > 0 and 5 < 10)

wise cargoBOT
#

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

True
minor elm
#

Will it only print if both are true?

west lion
#

!e

print(5 < 0 and 5 < 10)
wise cargoBOT
#

@west lion :white_check_mark: Your 3.11 eval job has completed with return code 0.

False
west lion
#

!e

print(5 < 0 or 5 < 10)
wise cargoBOT
#

@west lion :white_check_mark: Your 3.11 eval job has completed with return code 0.

True
west lion
#

!e

print(5 = 0 or 5 < 10 or 1 = 2 or 1= 3 or 1=1)
small heart
#

h

somber heath
#

!e py print(0 < 5 < 10)

wise cargoBOT
#

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

True
minor elm
#

Interesting

west lion
#

!e

print(5 == 0 or 5 < 10 or 1 == 2 or 1 == 3 or 1==1)
wise cargoBOT
#

@west lion :white_check_mark: Your 3.11 eval job has completed with return code 0.

True
minor elm
#

import random
balance = 200

while balance < 0: 
    print("GAMEOVER!")
    or balance >4000:
    print("YOU HAVE WON THE GAME!")
#restart game and ask user to bet 
#Else let the user know they have beaten the game

    bet =  int(input("Bet Ammount:"))

    roll = random.randint(1,100)

    if roll >50:print("You rolled " + str(roll) + str(roll) + "You Loose") 

    else: print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))


    balance = bet*2



#

These are great!

teal flower
#

My favorite people

minor elm
#
import random
balance = 200

while balance < 0: 
    print("GAMEOVER!")
while balance > 4000:
    print("YOU HAVE BEATEN THE GAME!")
#restart game and ask user to bet 
#Else let the user know they have beaten the game

    bet =  int(input("Your Ballace is " "Bet Ammount:"))

    roll = random.randint(1,100)

    if roll >50:print("You rolled " + str(roll) + str(roll) + "You Loose") 

    else: print("You rolled " + str(roll) +(" WINNER! Total Win = ") + str(bet *2))


    balance = bet*2

#

can I have 2 while like this?

somber heath
#

Yes, but the question is if you want to or not.

desert wolf
#

!e

import random

balance = 1000

while balance < 4000:
bet = random.randint(1, balance)

print(f"Your balance is {balance}. Bet Amount: {bet}")

roll = random.randint(1, 100)

if roll > 50:
    print("You rolled " + str(roll) + ". You Lose")
    balance -= bet
else:
    print("You rolled " + str(roll) + ". WINNER! Total Win = " + str(bet * 2))
    balance += bet

if balance <= 0:
    print("You have run out of money. Restarting game.")
    balance = 1000
elif balance >= 4000:
    print("Congratulations! You win!")
wise cargoBOT
#

@desert wolf :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | Your balance is 1000. Bet Amount: 383
002 | You rolled 33. WINNER! Total Win = 766
003 | Your balance is 1383. Bet Amount: 1354
004 | You rolled 59. You Lose
005 | Your balance is 29. Bet Amount: 15
006 | You rolled 96. You Lose
007 | Your balance is 14. Bet Amount: 4
008 | You rolled 1. WINNER! Total Win = 8
009 | Your balance is 18. Bet Amount: 2
010 | You rolled 75. You Lose
011 | Your balance is 16. Bet Amount: 12
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/QKXAS6IKTTHDROWIJW73D4B2YM

minor elm
#

Wow so I was close

#

Now just need to slow down the loop and treat each bet individually

#

"So the game can be played"

whole bear
#

Hi @somber heath

#

How are you doing?

minor elm
#
import random

balance = 1000

while balance < 4000:
    

    bet = input("Your balance is" + balance + "Bet Amount: ")

    roll = random.randint(1, 100)

    if roll > 50:
        print("You rolled " + str(roll) + ". You Lose")
        balance - bet
    else:
        print("You rolled " + str(roll) + ". WINNER! Total Win = " + str(bet * 2) + balance)
        balance + bet
        

    if balance <= 0:
        print("GAME OVER!")
       
        
    elif balance >= 4000:
        print("Congratulations! You win!")
#

It almost works

#
import random

balance = 1000

while balance < 4000:
    

    bet = input("Your balance is" + balance + "Bet Amount: ")

    roll = random.randint(1, 100)

    if roll > 50:
        print("You rolled " + str(roll) + ". You Lose")
        balance = balance - bet
    else:
        print("You rolled " + str(roll) + ". WINNER! Total Win = " + str(bet * 2) + balance)
        balance = balance + bet
        

    if balance <= 0:
        print("GAME OVER!")
       
        
    elif balance >= 4000:
        print("Congratulations! You win!")
somber heath
#

!d f-string

wise cargoBOT
somber heath
#

!f-string

wise cargoBOT
#
Format-strings

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.

minor elm
#
import random

balance = 1000

while balance < 4000:
    

    bet = input(f"Your balance is" + {balance} + "Bet Amount: ")

    roll = random.randint(1, 100)

    if roll > 50:
        print("You rolled " + str(roll) + ". You Lose")
        balance = balance - bet
    else:
        print("You rolled " + str(roll) + ". WINNER! Total Win = " + str(bet * 2) + balance)
        balance = balance + bet
        

    if balance <= 0:
        print("GAME OVER!")
       
        
    elif balance >= 4000:
        print("Congratulations! You win!")
lilac rock
#

πŸ‘‹

#

chill, lot of people misread it first time πŸ˜†

whole bear
#
print(f"Your balance is {balance}. Bet amount: ") 

This is how f-strings work right?

#

Ah okay

minor elm
#
    bet = input(f"Your balance is" + {balance} + "Bet Amount: ") ```
#

Balance is not showing in output

lilac rock
#

what happen when I plug dict or list to it? will it auto spread it?

whole bear
somber heath
#

!e py age = 20 name = 'Peter' print(f'Hello. Your name is {name} and you are {age} years old.')

wise cargoBOT
#

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

Hello. Your name is Peter and you are 20 years old.
whole bear
#
bet = input(f"Your balance is {balance} Bet Amount 50.")
hollow jacinth
#

!e

print(1 + 1)
wise cargoBOT
#

@hollow jacinth :white_check_mark: Your 3.11 eval job has completed with return code 0.

2
#
Missing required argument

code

#
Command Help

!eval [python_version] <code, ...>
Can also use: e

Run Python code and get the results.

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

The starting working directory /home, is a writeable temporary file system. Files created, excluding names with leading underscores, will be uploaded in the response.

If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside them.

By default, your code is run on Python 3.11. A python_version arg of 3.10 can also be specified.

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

minor elm
#

!e
bet = input(f"Your balance is" + {balance} + "Bet Amount: ")

wise cargoBOT
#

@minor elm :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     bet = input(f"Your balance is" + {balance} + "Bet Amount: ")
004 |                                       ^^^^^^^
005 | NameError: name 'balance' is not defined
minor elm
#

!e import random

balance = 1000

while balance < 4000:

bet = input(f"Your balance is {balance}" + "Bet Amount: ")

roll = random.randint(1, 100)

if roll > 50:
    print("You rolled " + str(roll) + ". You Lose")
    balance = balance - bet
else:
    print("You rolled " + str(roll) + ". WINNER! Total Win = " + str(bet * 2) + balance)
    balance = balance + bet
    

if balance <= 0:
    print("GAME OVER!")
   
    
elif balance >= 4000:
    print("Congratulations! You win!")
wise cargoBOT
#

@minor elm :x: Your 3.11 eval job has completed with return code 1.

:warning: Note: input is not supported by the bot :warning:

001 | Your balance is 1000Bet Amount: Traceback (most recent call last):
002 |   File "/home/main.py", line 8, in <module>
003 |     bet = input(f"Your balance is {balance}" + "Bet Amount: ")
004 |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | EOFError: EOF when reading a line
minor elm
#

Ohh

#

true haha

whole bear
#

I love f-strings

minor elm
#

I'm still confused as to why balance is not showing as int

whole bear
#

!e

import string
alphabets = string.characters
print(alphabets)
#

my bad. it's ascii_letters

minor elm
#
import random

balance = 1000

while balance < 4000:
    

    bet = input(f"Your balance is {balance}" + "Bet Amount: ")

    roll = random.randint(1, 100)

    if roll > 50:
        print("You rolled " + str(roll) + ". You Lose")
        balance = balance - bet
    else:
        print("You rolled " + str(roll) + ". WINNER! Total Win = " + str(bet * 2) + balance)
        balance = balance + bet
        

    if balance <= 0:
        print("GAME OVER!")
       
        
    elif balance >= 4000:
        print("Congratulations! You win!")
whole bear
#

!e

import string
alphabets = srting.ascii_characters
print(alphabets)
hollow jacinth
#

!e

balance = 10
print(f"Your balance is {balance}" + "Bet Amount: ")
wise cargoBOT
#

@hollow jacinth :white_check_mark: Your 3.11 eval job has completed with return code 0.

Your balance is 10Bet Amount: 
whole bear
#

me and my spelling mistakes xD

lilac rock
#

need to drop off, bye all πŸ‘‹

minor elm
#

I poseted my code

#

No changes

whole bear
#

Imma go as well. got an exam tomorrow

minor elm
#

🀨

#

haha allgood

#

This is the code i'm running

#

Could you try run the code?

#

Lets see if it's a user error

#

Visual Code

hollow jacinth
minor elm
#

Okay Now I can see

#

Not sure what went wrong

#

what happens when you place a bet?

hollow jacinth
#
Your balance is 1000Bet Amount: 10
You rolled 63. You Lose
Traceback (most recent call last):
  File "/home/betagmr/main.py", line 14, in <module>
    balance = balance - bet
TypeError: unsupported operand type(s) for -: 'int' and 'str'
minor elm
#

Okay

#

How do i type cast to int?

hollow jacinth
#
bet = int(input(f"Your balance is {balance}" + "Bet Amount: "))
minor elm
#

haha

minor elm
#

I added the change and i get this

#

It works when I loose

#

But when I win it crashes

hollow jacinth
#
print("You rolled " + str(roll) + ". WINNER! Total Win = " + str(bet * 2) + balance)
print(f"You rolled {roll}. WINNER! Total Win = {bet * 2 + balance}")
minor elm
#

f string is amazing!!!

#

MY GAME IS COMPLETE GUYS!

unborn storm
#

nice

minor elm
#

Thanks for all the help, This was the best learning i have had! ❀️ give my game a run if you like πŸ™‚ Enjoy

#

balance = 1000

while balance < 4000:
    

    bet = int(input (f"Your balance is = {balance} " + "Bet Amount: "))

    roll = random.randint(1, 100)

    if roll > 50:
        print(f"You rolled {roll} You Lose")
        balance = balance - bet
    else:
        print(f"You rolled {roll}. WINNER! Total Win =  {bet * 2}")
        balance = balance + bet
        

    if balance <= 0:
        print("GAME OVER!")
       
        
    elif balance >= 4000:
        print("Congratulations! You win!")  ```
somber heath
#

@eager sequoia πŸ‘‹

unborn storm
#

Hi @somber heath

#

@somber heath what text editor do you use ?

#

I guess a one that has graphical features, considering your beautiful generated-art project

#

ok, unusual but i guess i understand it

unborn storm
#

bye @somber heath @cunning lake @echo garden

somber heath
#

@quaint cloud πŸ‘‹

#

@whole bear πŸ‘‹

whole bear
#

Heya

#

Just voice verifying

echo garden
#

hi

whole bear
#

@somber heath Can't voice verify, sorry

#

It's a new account

#

Yeah

#

My bad fellas

somber heath
#

@thick moon πŸ‘‹

whole bear
#

Nah, I didn't

somber heath
#

@trail stag πŸ‘‹

whole bear
#

where did you get the idea that it was unpaid?

wind raptor
#

Hello @hexed saddle

hexed saddle
#

Hello

forest zodiac
forest zodiac
#

@wind raptor

#

brb

wind raptor
whole bear
#

@forest zodiac

vocal basin
#

this is only valid for waterfall

#

because this is waterfall

wind raptor
#

Yeah, it's missing all the sprint cycles where it goes through each of these things in every sprint, but I think it gets the point across

vocal basin
wind raptor
vocal basin
wind raptor
#

Oh yeah, that is cool

whole bear
#

gtg for now, see you guys

wind raptor
#

Have a good one

vocal basin
#

functionally, that seems similar to non-empty enum variants in Rust

#

enum variant in Rust is basically just a semi-anonymous struct definition;
except for how pub gets handled, I think

#

(pub inside enums is an error, but not a syntax error)

#

rust-analyzer doesn't even seem to error at that

#

oh, no, it does

#

okay, so, rust-analyzer treats it as syntax error

wind raptor
#

Well that's good

scarlet halo
#

yo

scarlet halo
#

whatsthat

vocal basin
#

it starts the same way as this

quick cloak
whole bear
#

?

#

?LaTeX

#

.latex $x = \frac{-b\pm\sqrt{b^2-4ac}}{2a}$

viscid lagoonBOT
whole bear
#

.latex $x =\LaTeX

viscid lagoonBOT
#
Failed to render input.

No logs available.

vocal basin
#

.latex

a \\
b
viscid lagoonBOT
whole bear
#

.latex $x = \LaTeX

viscid lagoonBOT
#
Failed to render input.

No logs available.

quick cloak
#

.latex

\begin{align}
    \omega(t,x) &= \frac{1}{\sqrt{1-(\frac{x}{t})^2}} \\
    &= \frac{1}{\sqrt{1-(\frac{x^{2}}{t^{2}})}} \\
    &= \frac{1}{\sqrt{\frac{1}{t^{2}}(t^{2} - x^{2})}} \\
    &= \frac{1}{\frac{1}{t}\sqrt{(t^{2} - x^{2})}} \\
    &=\frac{t}{\sqrt{t^2 - x^2}} \\
\end{align}
viscid lagoonBOT
vocal basin
#

eh

#

needs to be absolute

prime kayak
#

guys

#

is anyone here to verify me for voice?

whole bear
#

.latex

\font\donteveruseoutsidecartoons="Comic Sans MS" at 14pt
\font\donteveruseoutsidecartoonstwo="Comic Sans MS/IB:slant=.3pt" at 22pt
\input tikz
\usetikzlibrary{shapes.callouts,positioning}
\tikzpicture[mycallout/.style={draw,ellipse callout,inner sep=1.2ex,
    callout relative pointer={#1}}]
  \node[mycallout={(.5cm,-.5cm)}] (ico) {\donteveruseoutsidecartoons Be rational};
  \node[mycallout={(-.5cm,-.5cm)}, right=of ico] (pco) {\donteveruseoutsidecartoons Get real};
  \node[below=.1ex of ico.pointer] {\donteveruseoutsidecartoonstwo i};
  \node[below left=.1ex of pco.pointer] {\donteveruseoutsidecartoonstwo Ο€\vphantom(};
\endtikzpicture
\bye
vocal basin
wise cargoBOT
#
Voice verification

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

prime kayak
#

!voice

quick cloak
#

`

whole bear
#
\font\donteveruseoutsidecartoons="Comic Sans MS" at 14pt
\font\donteveruseoutsidecartoonstwo="Comic Sans MS/IB:slant=.3pt" at 22pt
\input tikz
\usetikzlibrary{shapes.callouts,positioning}
\tikzpicture[mycallout/.style={draw,ellipse callout,inner sep=1.2ex,
    callout relative pointer={#1}}]
  \node[mycallout={(.5cm,-.5cm)}] (ico) {\donteveruseoutsidecartoons Be rational};
  \node[mycallout={(-.5cm,-.5cm)}, right=of ico] (pco) {\donteveruseoutsidecartoons Get real};
  \node[below=.1ex of ico.pointer] {\donteveruseoutsidecartoonstwo i};
  \node[below left=.1ex of pco.pointer] {\donteveruseoutsidecartoonstwo Ο€\vphantom(};
\endtikzpicture
\bye
prime kayak
#

b = 1
b.replace(2)
print (b)

what is the code problem?

vocal basin
#

!e

b = 1
b.replace(2)
print(b)
wise cargoBOT
#

@vocal basin :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 2, in <module>
003 |     b.replace(2)
004 |     ^^^^^^^^^
005 | AttributeError: 'int' object has no attribute 'replace'
prime kayak
#

why?

vocal basin
#

where did you get ".replace" from?

whole bear
#
b = "1"
b = b.replace("1", "2")
print(b)
prime kayak
wise cargoBOT
#

@prime kayak :white_check_mark: Your 3.11 eval job has completed with return code 0.

2
vocal basin
prime kayak
vocal basin
#

!e

b = 1
b = 2
print(b)
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

2
scarlet halo
#

!e

print("balls")
wise cargoBOT
#

@scarlet halo :white_check_mark: Your 3.11 eval job has completed with return code 0.

balls
scarlet halo
#

LETS GOOO

prime kayak
#

it was only for practice

vocal basin
whole bear
#

!e```py
print(" ".join(["hello", "world"])

vocal basin
#

!e

print(str(["Hello", "World!"])[1:-1].replace("'", ""))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

Hello, World!
vocal basin
#

"joined late by some number of seconds, had to compress the code somewhat"

vocal basin
#

can also filter by 1 .__and__

#

!e

print(*filter(1 .__and__, range(11+1)))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

1 3 5 7 9 11
vocal basin
#

I wonder if it can run code from spoiler blocks

#

!e
||```py
print("test")

wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

test
vocal basin
#

o

vocal basin
#

I wonder why it freezes the timer after joining

#

very odd bug

whole bear
#

can't see anyone

#

oh now i see you

vocal basin
#

the timer resumed

vocal basin
#

ah, for cycles

#

for just duplicates I prefer this
||```py
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
s = set()
c = 0
while c < len(nums):
r = min(c+1000, len(nums))
s.update(nums[c:r])
c = r
if len(s) != c:
return True
return False

#

because it

  1. short-circuits
  2. chunked, therefore fast
#

@whole bear depends on text editor

#

some persist history after restarts

#

you can also enable auto-save

whole bear
vocal basin
#

installed

#

seems like

velvet tartan
#

Installed too

whole bear
#

@verbal zenith do you want to play?

#

i am setting the time to 60mins, sounds good?

vocal basin
#

yes

whole bear
#

code: DrGAH4dJb9

#

type this in the leetroom right side pane

#

4 questions, you have to click on it

vocal basin
#

there's a problem
I have them all solved

#

I'll reset without memorising

#

at least I'll try

velvet tartan
#

I can't join this one. I need to work on reading and other stuff right now 😦

quick cloak
vocal basin
#

another way is to learn how existing tools do that

#

for example, renpy

#

... which you can extend further on your own

whole bear
#

Are the examples of that Alisa like videos explaining how to start that

velvet tartan
vocal basin
whole bear
#

Thank you

vocal basin
#

system itself is written in Python and configured via Python-like code

quick cloak
#

you can customize every aspect of your operating system, here is an example of someone making a beautiful "riced" linux @whole bear

#

another really pretty example:

vocal basin
#

more effort for simple customisation
less effort for deep customisation

#

powershell works on linux too

quick cloak
vocal basin
#

> what was difficult on linux
wi-fi

#

just no, never again

#

ssh on windows just worked for me

vocal basin
#

I use a separate computer for Linux, works quite good

#

@quick cloak "*nix" not unix

#

linux isn't unix

#

unix-like but not unix

#

Solaris, BSD, MacOS -- unix, afaik

#

@verbal zenith posix

#

using VirtualBox is necessary evil

#

it used to be Sunℒ️ VirtualBox

#

just like Java

#

I was recently helping someone with virtualbox, and the course they were following still had Sunℒ️ in the screenshots

#

it requires quite a lot of thinking to get things done in Rust

#

starting with Rust has its benefits, but it's difficult

verbal zenith
vocal basin
#

it's not as forgiving as GCd or manual-memory-management languages

royal cipher
#

hola guys

verbal zenith
royal cipher
#

How you doin?

vocal basin
#

for most things, the difference from C/Java/Python is not fundamental, at least in appearance

#

and some elements are just simpler

verbal zenith
royal cipher
vocal basin
royal cipher
vocal basin
#

not mentioning traits, because that's far far away from beginner level programming, I think

vocal basin
royal cipher
verbal zenith
verbal zenith
#

The concept of a trait is much more understandable than the application

vocal basin
#

!kindling

wise cargoBOT
#
Kindling Projects

The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.

vocal basin
#

though not ordered

royal cipher
#

@vocal basin I am a beginner to web developer.....can you guide me through what should be good for me to do now to keep my progress good

vocal basin
#

static sites or ones with server-side functionality?

royal cipher
#

static

vocal basin
#

it doesn't provide any sort of roadmap but it provides tools to learn

royal cipher
#

thats good

#

will this also help me with backend or server side sites

#

?

vocal basin
#

it has two examples of server-side frameworks

#

Django (for Python) and Express (for Node)

#

anything else server-side usually has its own dedicated documentation/tutorials

frozen owl
#

HELLLOOOOOOOO

frozen owl
#

regret learning high level shit as first lang

royal cipher
#

@vocal basin Understood Thanks for your help

frozen owl
#

ppl NEED to learn important basics and good habits 100%

vocal basin
#

VS Code without extensions is just a text editor + terminal

frozen owl
#

yeah

#

but like

vocal basin
#

keyword "without extensions"

frozen owl
#

not a lot of ppl are going for vanilla vscode

vocal basin
#

for C# and Rust that ordering isn't defined

vocal basin
#

@whole bear @verbal zenith
404
||```py
class Solution:
def sumOfLeftLeaves(self, root: Optional[TreeNode], left=False) -> int:
match root:
case TreeNode(val=val, left=None, right=None) if left:
return val
case TreeNode(left=left, right=right):
return self.sumOfLeftLeaves(left, True) + self.sumOfLeftLeaves(right, False)
case _:
return 0

258
||```py
num and (num % 9 or 9)
```||
136
||```py
reduce(xor, nums)
```||
121
||```py
max(0, max(map(sub, prices, accumulate(prices, min, initial=float('inf')))))
```||
vocal basin
#

yes

#

last three have all the boilerplate omitted for simplicity

#

(there's obviously return and other stuff in the solution)

#

can play another

#

the issue is that it picks early ones, and I have all easy solved up to around #700

#

oh, 222 got demoted

whole bear
#

code: FCJJI44rBL

frozen owl
vocal basin
#

leetrooms

frozen owl
frozen owl
#

783?

#

wtf

#

there's no 1475

pine depot
#

anyone familiar with robin-stocks module?

vocal basin
#

yes, still here

#

no, not busy

#

it can be done without extra data storage

#

(except for call stack)

#

one option is to use a more general function
||```py
def solve(left, root, right):
if root:
return min(
solve(left, root.left, root.val),
solve(root.val, root.right, right),
root.val - left,
right - root.val,
)
else:
return float('inf')

class Solution:
def minDiffInBST(self, root: Optional[TreeNode]) -> int:
return solve(float('-inf'), root, float('inf'))

#

another is to use a generator
||```py
def nodes(root: Optional[TreeNode]):
if root:
yield from nodes(root.left)
yield root.val
yield from nodes(root.right)

class Solution:
def minDiffInBST(self, root: Optional[TreeNode]) -> int:
return -max(starmap(sub, pairwise(nodes(root))))

#

!e

from itertools import pairwise

print(*pairwise(range(5)))
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

(0, 1) (1, 2) (2, 3) (3, 4)
vocal basin
#

!d itertools.pairwise

wise cargoBOT
#

itertools.pairwise(iterable)```
Return successive overlapping pairs taken from the input *iterable*.

The number of 2-tuples in the output iterator will be one fewer than the number of inputs. It will be empty if the input iterable has fewer than two values.

Roughly equivalent to:

```py
def pairwise(iterable):
    # pairwise('ABCDEFG') --> AB BC CD DE EF FG
    a, b = tee(iterable)
    next(b, None)
    return zip(a, b)
```...
vocal basin
#

all values of nodes in root are between left and right

#

I think it can be simplified further

#

so it's just the smallest range any subtree falls into
||```py
def solve(left, root, right):
if root:
return min(
solve(left, root.left, root.val),
solve(root.val, root.right, right),
)
else:
return right - left

#

this is derived from pairwise-based solution

#

, which is almost equivalent to collecting nodes into a list, then comparing differences between adjacent elements

whole bear
#

i like this ❀️

vocal basin
#

also, it uses the fact that, for each pair of adjacent values, one of two nodes is a parent to another

#

(otherwise there'd be a common parent, value of which is between them, therefore they aren't adjacent)

#

yes, not immediate

#

like, not parent, but something else, idk the term

#

yes, another option is to return min/max per subtree

#

should work too

#

but it's more difficult to accumulate

#

so, instead of moving min/max values upwards to the parent, it moves root.val downwards to children

sacred crag
#

hi @whole canopy πŸ‘‹

sacred crag
#

hi @sterile tusk πŸ‘‹

empty dawn
#

Hello everyone

#

@sacred crag

sterile tusk
sacred crag
sterile tusk
#

I'm beginner

#

and you?

sacred crag
#

That's great where are you up to.
I'll say something super controversial. I've been working with Python programmers for years but never actually learnt to programme
I'm quite an advanced prompt engineer and I now use chat GPT to write my software. And of course produce unit tests.

sterile tusk
sacred crag
#

Show my friend isn't with me he could help me with the Spanish. Do you have any other programming background

sterile tusk
wicked tangle
#

how can i speak in this chat

sacred crag
#

!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.

sacred crag
worldly roost
#

Hi

limber copper
#

hi

sacred crag
limber copper
#

how are you @worldly roost

sacred crag
#

A unit test in Python is a way to test a small "unit" of code, usually a single function or method, in isolation. The goal is to validate that each part of a program is working as expected.

Some key points about Python unit testing:

Unit tests are usually written using the unittest module in the Python standard library. This provides tools for creating test cases, assertions, test runners etc.
A unit test typically exercises one method or function. It feeds in various inputs and verifies the outputs are as expected.
Good unit test cases cover both nominal/valid inputs, as well as edge cases like empty inputs, exceptions, special values etc.
Unit tests are organized into test classes and test cases that group together similar tests.
Test driven development (TDD) is a development process that relies on first writing unit tests that fail, then writing code to make them pass.
Unit testing requires writing additional code, but pays off in the long run with more robust, less buggy applications.
Unit tests can be run automatically, and often integrated into CI/CD pipelines to validate each change.
Important Python unittest features include test fixtures, mocks, parametrized tests, test runners and more.
So in summary, unit testing is a key technique for software quality and reliability, and the unittest framework provides powerful tools for it in Python. Writing effective unit tests takes practice, but pays dividends.
From claude.ai

worldly roost
sacred crag
#

Eats, Shoots & Leaves: The Zero Tolerance Approach to Punctuation is a non-fiction book written by Lynne Truss, the former host of BBC Radio 4's Cutting a Dash programme. In the book, published in 2003, Truss bemoans the state of punctuation in the United Kingdom and the United States and describes how rules are being relaxed in today's society....

#

A panda walks into a cafΓ©. He orders a sandwich, eats it, then draws a gun and fires two shots in the air.

"Why?" asks the confused waiter, as the panda makes towards the exit. The panda produces a badly punctuated wildlife manual and tosses it over his shoulder.

"I'm a panda," he says at the door. "Look it up."

The waiter turns to the relevant entry in the manual and, sure enough, finds an explanation.

"Panda. Large black-and-white bear-like mammal, native to China. Eats, shoots & leaves."

vocal basin
pine depot
#

I've got this stupid problem.
I get a dict with nested list, then another nested dict. how can i pull something within a dict, in a list, then in a dict

vocal basin
#

collection[key][index][key]?

#

or iteratively?

pine depot
#

like

{'id': '912083012', 'cost_variables': [{'currency': '12938018', 'direct_cost': 'I WANT THIS'}]}
#

ive just been staring at code for like 10 hours

#

and my brain is off

vocal basin
#

is list always only one element long?

pine depot
#

its always the same size, num of elements, but no, its like 15 long

vocal basin
#
[element['direct_cost'] for element in d['cost_variables']]
pine depot
#

can i not do it iteratively

#

alisa ur a godsend btw

#

i would never have structured it like this (but the api...)

vocal basin
#

!e

d = {'id': '912083012', 'cost_variables': [{'currency': '12938018', 'direct_cost': 'I WANT THIS'}]}
print([element['direct_cost'] for element in d['cost_variables']])
wise cargoBOT
#

@vocal basin :white_check_mark: Your 3.11 eval job has completed with return code 0.

['I WANT THIS']
vocal basin
#

it will output a list with the same length as the original list

pine depot
#

how can i pull just the value

vocal basin
#

do you know the exact index?

pine depot
#

yeah but i dont have enough experience to know if it will change

#

so idk if it's SAFE

#

it's a real-money trading bot

#

so im nervous lol

vocal basin
#

do you need to get the value for the specific value of 'currency'?

pine depot
#

specific value of 'direct_cost"

vocal basin
#

what do you pick the index based on?

pine depot
#

whatever the value for the key 'direct_cost' is

#

i didnt make this abomination of data, its the api im working with

#

lol

vocal basin
#

what does the whole list look like?

pine depot
#

i gotta blur data gimme a min

#

i tabbed it out for readability in a secondary file

#

so i need to grab

stock['cost_bases']['direct_cost_basis']
#

im trying to do something like

some_kinda_function(float(stock['cost_bases']['direct_cost_basis']))
#

nvm im stupid, just needed to do

stock['cost_bases'][0]['direct_cost_basis']
#

ty for your help @vocal basin

#

many hemlock emoji's await your future

somber heath
#

@keen sentinel πŸ‘‹

somber heath
#

@slim gorge πŸ‘‹

turbid sandal
#

Hemlock is loved

somber heath
#

@humble dagger πŸ‘‹

somber heath
#

@loud wigeon πŸ‘‹

turbid sandal
teal flower
#

Hello

teal flower
somber heath
#

@tender loom πŸ‘‹

somber heath
#

@lyric valve @sharp python πŸ‘‹

sharp python
#

can't talk

somber heath
#

!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.

sharp python
#

they require me to send 50 messages

somber heath
#

@prime burrow πŸ‘‹

minor elm
#

Hellooo

#

Do you know much about GUI?

#

Tkinter?

#

Okay I will hold off for now

#

Did you want to play my game?

#

It works okay

#

I want to build a progarm that compares prices of things from one country to another.

#

Is that where Dictonarys come in?

vocal basin
#

I'd expect a more practical solution use some data structure other than just hashmap (dictionary), but for low volumes of data it might be good enough

#

the following mapping is usually easy to construct from data:
country code -> local price

#

local prices aren't necessarily easy to compare

#

you might choose to store dollar equivalent of a price instead

#

(valid at some point in the past)

#

depending on amount an variety of requests, you might choose to store (country, currency, price)

#

also choice of data structure comes from where sorting and other processing happens

#

client-side vs server-side, if you offer up the results to somewhere else

#

(or, just inside the structure or outside)

#

it can also be animated

warm vapor
#

Heyo

vocal basin
#

I should've really been saving components of the video separate from the video
because the pink/purple thing here looks quite good compared to everything else

#

I will now go and try to generate something like this again

unborn storm
#

@somber heath @minor elm The way I would explain complex numbers is :
It is like two numbers together. So you can use them to represent coordinates, or many other things in physics etc.
The whole point is that, they are really together : you can treat them as one number, meaning you can add complex numbers, multiply them etc...
That makes them very practical for operating transformations (translations, rotations, zooms etc...), because instead of re-coding them, you simply do a simple math operation.

somber heath
#

!e py print('123\n456\n789')

wise cargoBOT
#

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

001 | 123
002 | 456
003 | 789
somber heath
#

!e py print(len('\n'))

wise cargoBOT
#

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

1
vocal basin
#

I totally forgot how the code looked like

self.policy: HighLevelPolicy = NCHLP(Randomized())
self.manifold: Manifold = ProjectionalPlane()
turbid sandal
vocal basin
#

yes

scarlet halo
#

yes super

turbid sandal
#

what is this for :

vocal basin
#

type annotations

#

!pep 484

wise cargoBOT
#
**PEP 484 - Type Hints**
Status

Final

Python-Version

3.5

Created

29-Sep-2014

Type

Standards Track