#off-topic-lounge-text

1 messages · Page 12 of 1

dull anvil
#

(iirc I tested phind.com just before 3.5 became widely available)

#

tbf they allow a lot more for the model to work on

#

but, from what I remember, many other models easily passed that test at the time

#

since it's a trivial question

#

solved by adding four letters to one of the identifiers

hollow wyvern
#

Did it get it? I hit my o1 preview limit so I had to do it with o1-mini

To make your Rust code compile and pass all the provided tests, you'll need to adjust the trait bound on the bind function. Specifically, change the trait bound from Fn to FnOnce. This is necessary because some of your closures capture variables by move, which requires the FnOnce trait.

Here's the corrected code:

fn bind<T, F: FnOnce(T) -> Option<T>>(f: F, fa: Option<T>) -> Option<T> {
    match fa {
        Some(a) => f(a),
        None => None,
    }
}

// don't change anything below

fn main() {
    assert_eq!(bind(|x: i32| Some(x + 3), Some(2)), Some(5));
    assert_eq!(bind(|x: i32| Some(x + 3), None), None);
    assert_eq!(bind(|_: i32| None, Some(2)), None);
    assert_eq!(bind(|_: i32| None, None), None);
    
    assert_eq!(bind(|x: &str| Some(x), Some("apple")), Some("apple"));
    assert_eq!(bind(|_: &str| Some("banana"), Some("apple")), Some("banana"));
    
    let banana = "banana".to_string();
    assert_eq!(
        bind(|_: String| Some(banana), Some("apple".to_string())),
        Some("banana".to_string()),
    );
}

Explanation of Changes

  1. Trait Bound Adjustment:
    • Before: F: Fn(T) -> Option<T>
    • After: F: FnOnce(T) -> Option<T>
#

The FnOnce trait is more flexible as it allows the closure to consume variables it captures (i.e., take ownership). This is essential for closures that move captured variables, such as the closure in your last test case where banana is moved into the closure.

  1. Ensuring Proper Usage of bind:

    • The bind function remains generic and works with different types, including i32, &str, and String.
    • By using FnOnce, you ensure that all closures, whether they capture by reference or by move, are supported.
  2. Including main Function:

    • To run the assertions, they need to be inside a main function or a test module. Here, they're placed inside main for simplicity.

Additional Notes

  • Why Not Fn or FnMut?

    • Fn: Suitable for closures that do not consume any captured variables. However, your last test case requires moving banana, which Fn cannot handle.
    • FnMut: Allows mutable access to captured variables but still doesn't support moving ownership like FnOnce.
  • Ownership Considerations:

    • When dealing with owned types like String, it's common to require FnOnce because the closure might need to take ownership of the variable.

By making this change, your bind function becomes more versatile and can handle all the provided test cases without any compilation errors.

dull anvil
#

yeah, o1 mini can do it seems like

#

(unlike 4o mini)

hollow wyvern
dull anvil
#

these four are the ones that AI has passed so far

hollow wyvern
dull anvil
#

from my attempts to get AI to do it, its best results (i.e. the ones that can be built at all) caused memory leaks

#

oh, and also, giving the AI the link (if it's capable of interpreting HTML) is effectively giving it the solution because that's embedded on the page

#

some services/models with that capability enabled can unobfuscate the solution but still can't explain it

hollow wyvern
dull anvil
#

I guess it's overtrained to put main even if it's not needed

hollow wyvern
#

I really want to try with o1 preview but I need to wait till September 20 to reset limits 💀

dull anvil
dull anvil
#

it almost explains itself that it can do better

#

but doesn't inline the static

hollow wyvern
dull anvil
#

it did not address covariance at all in the solution

hollow wyvern
dull anvil
# hollow wyvern

seems mostly fine except for misunderstating what "positive" means

#

so AI can finally understand associated output types I guess

#

although

#

that code is terribly cursed

#

hmm

#

but okay enough for a pass

#

it's slightly misusing the word Strategy which is surprising given how much Java has definitely got into its training data

hollow wyvern
dull anvil
#

it's definitely a massive improvement compared to previous models I've seen attempt these

keen badge
#

@glossy otter I have come to you once again to request screenshare perms

#

Sorry hemlo @buoyant kestrel

maiden maple
#

@neon portal Is your way a good practice or I can do like this?

neon portal
#

!zen

timid fjordBOT
#
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

neon portal
#

"Explicit is better than implicit."

#

"Namespaces are one honking great idea -- let's do more of those!"

#

I believe mine is good practice given zen.

maiden maple
neon portal
#

My pleasure.

maiden maple
#

@unborn sorrel Can I get stream perms?

unborn sorrel
#

!stream 1047793849008914512 1h

timid fjordBOT
#

✅ @maiden maple can now stream until <t:1726506239:f>.

maiden maple
#

@neon portal What is the purpose of utils.py?

#

asking you

#

hmm

#

Thanks

#

Brb

primal bison
#

E

jolly rain
#

Hi

sly spade
#

@DH

#

@still peak

#

where r u from

#

i am fron India

#

u know any experienced python dev?

dull anvil
#

what's the threshold for "experienced"

sly spade
#

experience with automation bots?

#

selenium

dull anvil
#

what are you using those "bots" for?

sly spade
#

will lyk on voice chat later

#

pretty condfidentiakl

dull anvil
#

casually playing to spend time and ending up with a top 428 result

dull anvil
#

the real gameplay starts when statistics get involved

#

those are important for winrate, but help with speed records too

#

since often it's faster to guess rather than go safe

dull anvil
#

2.7 is officially dead

#

very cursed

#

reminds of how Pascal is used in schools and universities still

dull anvil
#

stable because no one actually uses it

#

where I live exams allow:
С++, Java, C#, Pascal, Python

#

I'm actually surprised C# is there, didn't expect that

#

@primal bison 👋

#
docker run -it --rm python:2.7
#

!gil

timid fjordBOT
#
Print and return

Here's a handy animation demonstrating how print and return differ in behavior.

See also: /tag return

dull anvil
#

rawr

#

what did I do

#

.tag gil

#

.t gil

vivid terraceBOT
#

The command you are trying to time doesn't exist. Use .help for a list of commands.

dull anvil
#

I have no idea what I'm doing with those commands nvm

#

@still peak if you have Docker installed and need to use Python 2.7, then you can just start the interpreter as is

#

@slate axle in case of Python, there isn't really any PSF-approved stuff

#

so yeah, maybe somewhat official, but not official official

#

@jolly rain helper means part of staff but not a moderator

#

if you have any concerns, DM @subtle palm

#

I meant there is no PSF-approved certification

#

as far as I know

slate axle
dull anvil
#

Python Software Foundation

primal bison
#

Dude

#

I’m not vetoed

runic mirage
#

Hi everyone! I'd like to stream my progress on a project to share it with the community but I'm not able to do that. Are there any rules to use this voice channel?

#

I've checked the rules channel and other channels to see if I can do that\

#

But haven't found anything yet

maiden maple
runic mirage
runic mirage
last cobalt
#
def convolucao(matriz: list, mascara: list):
    count = 0
    matriz_final = []
    for k in range(len(matriz)):
        nova_matriz_temp = []
        for l in range(len(matriz[k])):
            numero_final = abs((matriz[k][l] * mascara[2][2]) 
             + (matriz[k-1][l] * mascara[1][2] if matriz[k-1][l] in matriz else 0)
             +(matriz[k-1][l-1] * mascara[1][1] if matriz[k-1][l] in matriz else 0)
             +(matriz[k][l-1] * mascara[2][1] if matriz[k-1][l] in matriz else 0)
             +(matriz[k+1][l-1] * mascara[3][1] if matriz[k-1][l] in matriz else 0)
             +(matriz[k+1][l] * mascara[3][2] if matriz[k-1][l] in matriz else 0)
             +(matriz[k+1][l+1] * mascara[3][3] if matriz[k-1][l] in matriz else 0)
             +(matriz[k][l+1] * mascara[2][3] if matriz[k-1][l] in matriz else 0)
             +(matriz[k-1][l+1] * mascara[1][3] if matriz[k-1][l] in matriz else 0))
            
            nova_matriz_temp.append(numero_final)

        matriz_final.append(nova_matriz_temp)
    return matriz_final
sobel_x = [[1, 0, -1], [2, 0, -2], [1, 0, -1]]
sobel_y = [[1, 2, 1], [0, 0, 0], [-1, -2, -1]]
molten marsh
#

then it should be GM LUA

glad kettle
#

@maiden maple

#

why i cant talk?

#

@quick oasis

#

why i cant talk?

maiden maple
timid fjordBOT
#
Voice verification

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

glad kettle
#

i still cant talk

restive hornet
#

heyy coders

#

im new in coding

#

just one month i have started python

#

can someone tell me how can build my logic strong

dry spade
hollow wyvern
hollow wyvern
dull anvil
hollow wyvern
# dull anvil hmm

oh ok try this one. It has all the things we tried last time but wit o1 preview

#

if it doesnt load I'll just send screenshots

dull anvil
#

still no content

hollow wyvern
hollow wyvern
dull anvil
#

I can't test if it actually compiles, but

bind -- fail (I know it won't compile);
get functions -- pass (creative but massively overengineered; the AI is clearly not trained enough on VTable code);
boolstream -- fail (fixed variance but broke the interface);
all errors -- pass (but code is unacceptably bad, mini did way better);

hollow wyvern
gusty heart
#

heyyy

#

guyzzz

#

can u help

#

me with

#

one

#

thinggg

#

p;zzz

#

i m newbiw

#

soo

hollow wyvern
azure kelp
#

brudda

#

is

#

trying

#

to get the

#

50 word

#

limit

#

xD

azure kelp
cold lintel
#

👍

#

!stream 417449379088171008

timid fjordBOT
#

✅ @atomic spire can now stream until <t:1727363133:f>.

cold lintel
#

@atomic spire Would you prefer to stream up in VC0, or is here fine?

#

Just thought I'd ask

tight ridge
#

who know scraping

buoyant kestrel
#

!stream 1041366872882413632

timid fjordBOT
#

✅ @trim knot can now stream until <t:1727366329:f>.

buoyant kestrel
astral stag
#

what do you guys think of this im trying to train VGG16 to recognize pictures

formal stump
#

That's what im wondering

dull anvil
#

(rn not busy)

#

apache 2.0 license allows commercial use afaik

dull anvil
#

everyone is using Linux commercially

#

and that's GPL

#

not really

#

you must publish modifications

#

> modified or derivative

#

the main issue is linking of libraries

dull anvil
#

well, laws don't really protect either

dull anvil
#

can you provide the same paid service on your own?
if yes, then BSL

#

BSL prevents that

#

as in others can't resell your product

dull anvil
neon portal
dull anvil
#

BSL normally is applied to some sort of service;
something that you can run, not a library

#

if you don't sell your own thing, others are free to sell that thing because BSL doesn't apply in that case

#

i.e. they don't compete with your business because there is no business

#

BSL often comes up as a result of a relicensing, for example, in the case of Redis

#

it did not make as much of an impact because many resellers were already using forks and reimplementations

#

so for cloud companies it was only "should we continue calling this Redis or not?"

#

I'd prefer having an actual business model instead

#

Oxide are open-sourcing everything they have in part because software isn't what they're selling

#

this type of scientific research is a completely separate field from business

#

exactly
there is no product

#

it's still mostly just research and speculation

#

funding and grants is not a stable business model

#

quantum is just a money burning pit at the moment, so trying to apply the same principles, that production software uses, will likely fail

#

IBM recently acquired HashiCorp, and that's more reality-adjacent

#

how would companies be using the project?

#

if at all

#

support/consulting contracts seem like a reasonable option for that case

night lily
#

!e ```py
class BubbleGrouper:
def init(self, k):
self.data = {i: {i} for i in range(k)}

def entangle(self, a, b):
    union = self.data[a] | self.data[b]
    for key in union:
        self.data[key] = union

grouper = BubbleGrouper(4)
print(grouper.data)
grouper.entangle(0, 1)
print(grouper.data)
grouper.entangle(2, 3)
print(grouper.data)
grouper.entangle(1, 2)
print(grouper.data)```

timid fjordBOT
dull anvil
#

whenever résumé discussions come up, I remember this

night lily
#

There are probably optimisations, but...eh.

dull anvil
#

there is disjoint-set/union-find thing

#

idk how to implement it

#

including "unrelated" things is fine afaik

#

graphic design sounds beneficial to mention

#

and, moreover, it is not unrelated to software engineering

night lily
#

I probably could have used a list instead of a dictionary, actually.

#

!e ```py
class BubbleGrouper:
def init(self, k):
self.data = [{i} for i in range(k)]

def entangle(self, a, b):
    union = self.data[a] | self.data[b]
    for index in union:
        self.data[index] = union

grouper = BubbleGrouper(4)
print(grouper.data)
grouper.entangle(0, 1)
print(grouper.data)
grouper.entangle(2, 3)
print(grouper.data)
grouper.entangle(1, 2)
print(grouper.data)```

timid fjordBOT
dull anvil
#

see what the company specifically asks for

#

oh, Oxide has recently opened a position for a software engine
time to read through it

#

if C#, then Java too

#

Java is very slowly outengineering C#

#

Java is everywhere

#

"if Java is so bad, then who put it in three billion devices?"

silk monolith
#

Are you guys looking for a job?

#

Have you ever tried freelancing?

sick mountain
dull anvil
#

for freelancing it's still somewhat important to write down what you can do and what your experience is I'd expect

silk monolith
#

freelancing is very competitive, right

#

but, you can pick a niche

#

and have more probabilities to get a job

sick mountain
silk monolith
#

more reviews, you can validate your work and with it, increase the prices fairly

#

It's hard asf ngl

#

In my case, Linkedin never worked

#

to get a job

#

nobody even checks your resume and just getting ignored at cold speaking to recruiters

dull anvil
#

I don't even have a résumé

silk monolith
#

make a portfolio

dull anvil
#

for dual-license it's simpler to have the paid one provide something specific to its users not just the right of use of normally copyleft software in commercial setting

#

and also you can't really do copyleft+commercial entirely right

#

when you do that, you're kind of almost violating your own license

#

it can only work okay-ish-ly if all the copyleft code you're making the product based on is your own

#

so for external contributions it means copyright assignment

dull anvil
#

though, again, that works better with services not libraries

#

with libraries it's integration consulting only; there is no deployment to provide support for (there is nothing to deploy)
((either way it's just "company pays you so they can get you to help them use it"))

primal bison
#

Ummm

#

Hi

astral stag
worn crane
#

Your post said you are trying to train so I figure that's what you mean. I'd love to train AI or build AI models but not sure where to start lol

astral stag
#

proper dataset *

worn crane
#

Those pretrained models were built by someone, no?

astral stag
#

i guess yes

worn crane
primal bison
#

!e

import random


print("str")
difficulty = input("What difficulty will you like? (E)ffortless, E(a)sy, (M)edium, (H)ard, (I)nsane, E(x)treme, (U)nreal, Im(p)ossible: ")
if difficulty.upper() == "E": # difficulties
    secret_num = random.randint(5, 25)
elif difficulty.upper() == "A":
    secret_num = random.randint(5, 49)
elif difficulty.upper() == "M":
    secret_num = random.randint(5, 69)
elif difficulty.upper() == "H":
    secret_num = random.randint(5, 140)
elif difficulty.upper() == "I":
    secret_num = random.randint(2, 300)
elif difficulty.upper() == "X":
    secret_num = random.randint(2, 1000)
elif difficulty.upper() == "U":
    secret_num = random.randint(2, 3965)
elif difficulty.upper() == "P":
    secret_num = random.randint(2, 8000)

secret_num_found = False

while not secret_num_found: # check if you have the number
    guess = input("Guess a number: ")
    percentage_closeness = int((1 - (abs(secret_num - int(guess)) / abs(secret_num))) * 100)
    percentage_closeness = max(0, min(percentage_closeness, 100))
    if percentage_closeness == 100:
        print(f"The secret number was {secret_num}! congrats!")
        secret_num_found = True
    else:
        print(f"You are {percentage_closeness}% close to the secret number!")
        
        print(secret_num)
#

awh

plucky kettle
#

!e
py```
difficulty_ranges = {
"E": (5, 25),
"A": (5, 49),
"M": (5, 69),
"H": (5, 140),
"I": (2, 300),
"X": (2, 1000),
"U": (2, 3965),
"P": (2, 8000)
}

#

Use something like this as an alternative to the if statements

fossil juniper
#

languid fulcrum
#

hi i just downloaded visual code studio can someone recomend me a good tutorial to start?

worn crane
#

My AI identifies as a ditzy big butt chocolate woman

vague tangle
#

!e

timid fjordBOT
#
Missing required argument

code

vague tangle
#

Oh I see

stone chasm
#

Hello , anyone here have experienced deploying flask app in HEROKU with dependencies of tf.keras

The build always failed for slugsize is 600mb while on heroku it's 500mb..

whole fjord
#

hello community, i was wondering if anyone can help me in regards to how to run a test file on a file that i am using to type code on? I am a little confused on how to do it

echo thorn
#

Hi everyone,i'm a beginner to this coding world.can anyone give advice on how to become a freelancer. So, what level of tech skills people expect from a freelancer. Also, what are the easy skills to learn through which I can start my freelancing career.

#

So what are the ways we can use python and chatgpt to do freelancing.

quasi spindle
echo thorn
#

Ok bro

hollow wyvern
# echo thorn Hi everyone,i'm a beginner to this coding world.can anyone give advice on how to...

To start freelancing in coding, first learn the basics of programming. Most clients want you to know one skill well, like HTML, CSS, or JavaScript. Web development is a good skill to start because many people need it, and it’s easier for beginners. You can also learn WordPress or how to make simple websites. As you get better, practice solving problems and talking to clients clearly.

echo thorn
#

Ok bro

steep whale
#

any one can help me with this error it come's when I want to start the bot

PS D:\Upload\MusicBots\MusicBotGskr\music_bot> python main.py TOKEN: ( MY TOKEN I CAN'T SHERE IT ) Traceback (most recent call last): File "D:\Upload\MusicBots\MusicBotGskr\music_bot\main.py", line 30, in <module> asyncio.run(main()) File "D:\Upload\MusicBots\Python\Lib\asyncio\runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "D:\Upload\MusicBots\Python\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Upload\MusicBots\Python\Lib\asyncio\base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "D:\Upload\MusicBots\MusicBotGskr\music_bot\main.py", line 25, in main await bot.add_cog(help_cog(bot)) ^^^^^^^^ NameError: name 'help_cog' is not defined

velvet nacelle
#

name 'help_cog' is not defined 😉 so you are missing something

runic mirage
#

Hi everyone! I asked for permission to live stream my coding sessions to get some experience with people seeing me working at the end I couldn't get access to any channel. Currently, I'm solving CTF challenges with python and I'd like to use any channel at 10 pm EST. I know I would be given access for a short period of time to start with and later I could use channels for longer.

river cave
#

hey guys i need help with converting my code into an .exe (not for malisious reasons ofc), my code is consistant of 2 folders with 2 .py files, one being the main title that will activate the game and the other the game, it also uses png's and mp3's. i tried looking it up and tried using pyinstaller, py2exe, auto-py-to-exe. but nothing works, i also tried reinstalling python and updating it. if you can help me it would be great but i dont mind if this would be too much yapping of me and too complicated. -eeuwa

blissful hare
fleet brook
hollow wyvern
hollow wyvern
fleet brook
#

no i was poiting it out ot someone in the VC

#

we were talking about webdev and making css dynamic

harsh basin
#

hmm why cant i share my screen

woven urchin
#

@night lily bro i dont have perms to speak

dusty sorrel
#

@unborn sorrel what are you working on?

#

@unborn sorrel are you going to use any api?

#

noice

livid rock
#

can anyone stream live coding here?

surreal olive
#

Yo

rancid ledge
#

Yo

maiden maple
#

@neon portal Hi

unique hinge
#

Write a function in Python that accepts one numeric parameter. This parameter will be the measure of an angle in radians. The function should convert the radians into degrees and then return that value.

While you might find a Python library to do this for you, you should write the function yourself. One hint you get is that you’ll need to use Pi in order to solve this problem. You can import the value for Pi from Python’s math module.

#

hello i need help could someone help me ?

echo estuary
#

Hello @fossil juniper
I see you are developing both the client and the api
What would be its purpose?

echo estuary
fossil juniper
slim goblet
#

!e

__import__("builtins").__dict__.clear()
print("Hello")
timid fjordBOT
slim goblet
#

!e

__import__("builtins").__dict__.clear()
class A:
  pass
timid fjordBOT
primal bison
#

HI

modest canyon
#

How can I obtain the ‘video’ role on this server to enable live streaming?

cinder shell
#

express? @fossil juniper

#

sorry for the ping

fair helm
#

abc = 123

#

@hallow jasper

echo estuary
#

@analog badge
What language is this?

#

And what's this things purpose?

near lagoon
#

for i in range(3):
For j in range(i):
Print(i + j)

#

how does this work

#

@jolly rain

#

im in the vc

fair helm
#

!e

#

e

#

gabagoo ¯_(ツ)_/¯

#

@primal bison

buoyant kestrel
#

!stream 1222215759086747740 30M

timid fjordBOT
#

✅ @woven urchin can now stream until <t:1730134060:f>.

still flicker
#

Ill be back

buoyant kestrel
#

A unique multiplayer game built on a free Web API. The best sandbox platform to learn a new skill or apply your knowledge in a fun and meaningful way. Use any programming language with our RESTful API to control the most powerful fleet in universe.

dull anvil
#

!e

print(1.609344.as_integer_ratio())
timid fjordBOT
buoyant kestrel
#

!stream 1222215759086747740 30M

timid fjordBOT
#

✅ @woven urchin can now stream until <t:1730136769:f>.

woven urchin
#

Thank you @buoyant kestrel

primal bison
#

🙂

#

It worked

tender plover
#

hi everyone! I am new, does anyone here build there own applications on IOS?

azure sable
#

!e

for i in range(100):
  print(i)
timid fjordBOT
woven urchin
#

May I get permissio to stream my screen again

buoyant kestrel
#

!stream 1127458312938598460

timid fjordBOT
#

✅ @vocal oar can now stream until <t:1730300735:f>.

buoyant kestrel
#

!doc collections.Counter

timid fjordBOT
#

class collections.Counter([iterable-or-mapping])```
A [`Counter`](https://docs.python.org/3/library/collections.html#collections.Counter) is a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict) subclass for counting [hashable](https://docs.python.org/3/glossary.html#term-hashable) objects. It is a collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The [`Counter`](https://docs.python.org/3/library/collections.html#collections.Counter) class is similar to bags or multisets in other languages.

Elements are counted from an *iterable* or initialized from another *mapping* (or counter):

```py
>>> c = Counter()                           # a new, empty counter
>>> c = Counter('gallahad')                 # a new counter from an iterable
>>> c = Counter({'red': 4, 'blue': 2})      # a new counter from a mapping
>>> c = Counter(cats=4, dogs=8)             # a new counter from keyword args
buoyant kestrel
#

!stream 30M

timid fjordBOT
#
Bad argument

Member "30M" not found.

buoyant kestrel
#

!stream 1127458312938598460 30M

timid fjordBOT
#

✅ @vocal oar can now stream until <t:1730303710:f>.

buoyant kestrel
#

!e

from collections import Counter

ham = "dsflkjsdafkjjj"
ham_counter = Counter(ham)

beef = "abcdefg"
beef_counter = Counter(beef)

print(len(ham_counter) == ham_counter.total())
print(len(beef_counter) == beef_counter.total())
timid fjordBOT
west geyser
#

bw

buoyant kestrel
#

Why do I feel like this thing is about to start walking like an AT-ST

#

Okay good, I added enough random thoughts so that the code isn't right on the screen

vapid finchBOT
#
Command not found

Command "#xE000" is not found

buoyant kestrel
#

Dafuq? Oh right, it's for SirRobin

west geyser
#

why if None:

#

@silent rose be carefull simplfying your code by using less variables, it can get messy and long if you do it too much

silent rose
west geyser
#

i use len(s) == len(set(s)) in code

#

ord works for unicode too

#

not just ascii

buoyant kestrel
#

Oh huh

#

I actually didn't know that

#

I don't know why I assumed it was just ascii...

#

What did you say the speed of completion was for yours?

cold lintel
#

"Powers of i" sounds interesting 👀

#

Have you learned about complex numbers?

silent rose
cold lintel
#

So, you don't really need to know much about complex numbers for this problem.

#

I would start by listing out the first e.g. 10 powers of i, and see if there's a pattern.

#

i to the 0 is 1.
i to the 1 is 1 * i == i.
i to the 2 is i * i == -1.
i to the 3 is -1 * i == -i.
i to the 4 is -i * i == 1.
i to the 5 is 1 * i == i.
...

#

Yeah, electrical engineers use j because they use i for current.

devout breach
#

use whatever calculates fastest within giant loops

woven marten
#

😂

cold lintel
buoyant kestrel
lethal sage
#

hello yall

devout breach
#

its open source - learn your math inside it , its python

buoyant kestrel
#

Whelp, my implementation didn't work

#

No wait

#

I'm an idiot

neon portal
#
def pofi(n):
    answer = 1j**n
    
    if abs(answer.imag) <= 1e-8:
        answer = answer.real
    if abs(answer.real) <= 1e-8:
        answer = answer.imag * 1j

    match answer:
        case 1j:
            return "i"
        case -1j:
            return "-i"
        case 1:
            return "1"
        case -1:
            return "-1"
        case 0:
            return "0"
#

Super ugly hehe.

buoyant kestrel
#
def pofi(n):
    mod_n = n % 4
    ham = 1j ** mod_n
    match ham:
        case (0+1j):
            return 'i'
        case (-1+0j):
            return '-1'
        case (0-1j):
            return '-i'
        case (1+0j):
            return '1'
        
#

!e

print(1j ** 426)
neon portal
#

It's a trend.

timid fjordBOT
neon portal
#

Yeh.

buoyant kestrel
#
def pofi(n):
    return ['1','i','-1','-i'][n%4]

This is the one that is both clever but I don't like it

#
def pofi(n):
    if n % 4 == 0:
        return '1'
    
    if n % 4 == 1:
        return 'i'
    
    if n % 4 == 2:
        return '-1'
    
    return '-i'

cold lintel
#

It's basically just a time-wasting exercise yeah 😄

buoyant kestrel
#

Oh speaking of, I need to file my bug report for Phasmo

cold lintel
#

They're like my equivalent of doing sudokus

woven marten
#

brb .. gotta have dinner

cold lintel
#

I agree with you actually. Textbooks are great

#

I always say more structured resources (e.g. books and courses) are generally better.

buoyant kestrel
#

Fun fact, Phasmophobia doesn't support voice recognition on console yet. So I was attempting to talk to the spirit box for half an hour last night and was just talking to myself like an idiot

#

Hooray

#

Although when I was saying "Give me a sign" my wife would follow up with "hit me baby one more time" (Britney Spears reference)

#

I'm glad I married someone with the same goofy sense of humor

dull anvil
#

the thing I'm using to configure the switch segfaults quite consistently

#

can opera offer the same

woven marten
#

back

fringe latch
#

code golfed 1 liner

#

inb4 "less lines isnt always better"

dull anvil
fringe latch
#

the wildest line of shit ive done (just now)

def solution(roman : str) -> int:
    """complete the solution by transforming the roman numeral into an integer"""
    nums = {"M":1000, "D": 500, "C":100, "L": 50, "X":10, "V":5, "I":1}
    return sum([-nums[x] if list(nums.keys()).index(x) > list(nums.keys()).index(roman[min(m+1, len(roman)-1)]) else nums[x] for m, x in enumerate(roman)])
glossy knoll
#

helllo world

#

hello world

glossy knoll
woven urchin
#

@torpid blaze Hey I see you're online, are you able and willing to give me permission to stream my screen temporarily in live-coding vc?

Or do you know who to ping to ask for perms?

torpid blaze
#

It needs to be a moderator I think, and they need to be in the room with you

woven urchin
#

@unborn sorrel Hey I see you're online, and I had a quick question, is it true a moderator needs to be in the voice channel at the time as someone streaming given the permission?

woven urchin
#

Thank you

gusty blade
#

yo

#

@woven marten

#

you there bruv?

#

yo mroj

#

@stray forum

#

bro's rewriting the dictonary

#

what's bro doing

stray forum
#

yo

gusty blade
#

yoooooooooooooo

#

waaaaaaaaaaaaaaasaaaaaaaaaaaaaaaaaap

stray forum
#

sorry bro cant stay no more i have some math test tomorrow

gusty blade
stray forum
#

cya

woven marten
#

@finite flame did you say something?

#

this

finite flame
#

yea

woven marten
#

just polishing the theme switching

gusty blade
#

yo @woven marten

woven marten
gusty blade
#

nothing much

rich vale
#

how can i get the permission to stream my code

west nest
#

Im not sure but im also interested in finding out how I can stream coding

night lily
west nest
#

Thank you, @night lily

pure fractal
#

I have a google form survey on my profile for school. Please complete it if you have time it would really help me.

lilac pebble
#

@hoary steppe

primal bison
#

Hello guys
may i can ask a website related question?

hoary steppe
primal bison
#

it's Discord bot verification bot. Card bot game.

#

is there any chance to visit a website without knowing my ip and also without knowing i am using any vpn to hide ip.

primal bison
lilac pebble
#

what do you have to hide

primal bison
primal bison
#

but i cant do coz i already did once if i do other i can got bl.

#

?

#

if u know Please share with me.

hoary steppe
#

who's us?

primal bison
#

i think i am only

vale bone
#

@gusty blade do you use Arch btw?

gusty blade
calm violet
#

dead chat

exotic zodiac
#

leetcoding now

thin spoke
#

hi everyone

#

is anyone doing anything interesting

woven marten
#

uff just pushed a decent update +684 -581

#

when the code is nice & formatted, it looks so pretty

thick fog
#

!code

timid fjordBOT
#
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.

thick fog
#

!code

hours=int(input("enter the number of hours you worked"))
rate=int(input("enter your hourly rate"))
try:
  if hours<=40:
    pay=hours*rate
  else:
    pay=(((hours-40)*1.5)*rate)+(40*rate)
  print("your pay is",pay)
except ValueError:
  print("please enter a valid number")
primal bison
#
print("worldisnotgood")
wanton horizon
#
print(“hello world”)
#

Nice

warm hatch
#

print("Hello")

peak ice
warm hatch
rotund briar
#

print(“hello world”)

rotund briar
wanton horizon
#

[CODE]

#
[CODE]
warm hatch
warm hatch
lunar bone
#

bolo

rotund briar
#

test

#

oooooo

#

thx lol

sly spade
#

i got my first paid internship yall

late warren
narrow tendon
#

hey ?

last zenith
#

is any one online ?

#

?

#

here

timid fjordBOT
#

:incoming_envelope: :ok_hand: applied timeout to @bold glen until <t:1732109393:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

tight ridge
#

!code

timid fjordBOT
#
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.

tight ridge
#
import string

alphabets = string.ascii_lowercase
username = 'Osamabinladen'
username2 = 'adolfhitler'
username3 = 'saddamhussain'


def gen_key(word):
    key = ''
    for i in word.lower():
        to_num = alphabets.index(i) + 1
        key = key + str(int(str(to_num)[0])+int(str(to_num)[1])) if to_num > 10 else key + str(to_num)

    return key

print(gen_key(username))
print(gen_key(username2))
print(gen_key(username3))

(keys must go to algorithm)

i dont know wtf is this

night lily
wind abyss
#

its key @night lily just called username 1 - 3 looks like its printing off the keys which are these username = 'Osamabinladen'
username2 = 'adolfhitler'
username3 = 'saddamhussain'

#

can do it a better way if yall want me to code some for yall

nimble belfry
#

please provide in basketball terms

pastel hatch
#

Hi

sacred elm
#

Do you remember me?

wooden musk
#

uhh no

primal bison
#

hi guys i am new here ! i have a school project and i have no ideas what to make and i am a beginner in python like a beginner beginner ...

#

and i know like flow of control basic python modules , tuples . lists and string manipulation and dictionary just this for now .

#

so, any help ?

polar scaffold
#

@aster

mental apex
#

@primal bison Can we collaborate?

neat mantle
#

hey

#

can anyone help me do picture recongnitions in python i cant find good tutorials please if ye just tell here

brave cairn
clear furnace
#

hey guys can someone help me change a code i have ?

hidden lynx
#

you can post it here, someone would help you out

primal bison
#

@mental apex sure! but i am not that great with python . hope you wont mind.

wanton magnet
#

From the snow-clad peaks of the Himalayas to the sun-drenched beaches of Kerala, its natural diversity is breathtaking.

#

Verdant valleys, arid deserts, and lush forests cradle ancient temples, forts, and palaces, each narrating tales of a glorious past.

#

The Ganges flows like a sacred thread binding the nation, while the vibrant cities pulsate with modernity and tradition.

#

India’s festivals, marked by vivid colors and boundless joy, mirror its rich cultural soul. Truly,

#

India is a mesmerizing confluence of nature, heritage, and an indomitable spirit.

pulsar sun
#

Friends, I am trying to create a heat map in Pycharm and it keeps giving me an error. The code that works in Colab does not work on Macbook Pro M4 Pro processor. I am using Pycharm as an IDE. Can you please help me?

#

@rough sparrow can you check it bro 😦

rough sparrow
weary raft
#

hello can someone help me

slow wind
#

Hello @cursive quest

cursive quest
#

sup

slow wind
#

how are you doing brother?

cursive quest
#

good how about you

slow wind
#

just chillin

#

are you working?

cursive quest
#

yea doing some coding

#

u?

slow wind
#

same

#

What are you working on?

cursive quest
#

building an API for work

slow wind
#

Are you using Django?

cursive quest
#

no im using flask

timid grove
#

working on an ETF tracker in collab using yfinance and the dates can not be caluclated correctly. lmk if anyobdy could help me

rough sparrow
wheat cosmos
#

!code

timid fjordBOT
#
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.

wheat cosmos
#

print("o")

#

!code

#

hello?

#

!code

#

Eh

timid fjordBOT
#
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.

wet quail
rough sparrow
late warren
rough sparrow
unique hinge
#

@feral eagle hey do they drug test for weed at computer science jobs ? are they rare?

feral eagle
#

i've never been tested for any of the jobs i've had. but idk about all of them tbh. can't imagine they would though tbh. i haven't worked for a good few years at this point but i just graduated so i guess i'll find out 😄

unique hinge
#

because i see you have dope as your name and im interested in getting back into dope i have pain thats why

#

but jobs i worked for drug test me there arent tech jobs though

#

i am in texas and you caught my eye

feral eagle
#

most things are... 🤣

unique hinge
feral eagle
#

you might want to talk to people that you know are in the US and have a tech job

primal bison
#

are there any inidans

#

those who know hindi

brisk halo
#

I dont text I just use voice can I get permissions?

nimble belfry
#

@ king deyo, gotta meet requirements first

#

Hello, would like some help on following:

#

my graph does not seem accurate.

late warren
nimble belfry
#

It's a data science program

nimble belfry
#

I couldn't find the reply (maybe It got buried or in other channel), but thank you to the person that answered!

lethal raptor
lethal raptor
runic grotto
#

```print(self_hate)```
deft furnace
#

yh

timid fjordBOT
#

:incoming_envelope: :ok_hand: applied timeout to @deft furnace until <t:1733689129:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

The <@&831776746206265384> have been alerted for review.

faint lion
# deft furnace yh

!warn 1182841481254404167 Spamming to pass the voice gate will get your voice banned. Just engage the community normally. If you need help, open a help thread: #❓|how-to-get-help

timid fjordBOT
#

:x: The user doesn't appear to be on the server.

hollow wyvern
#

I dont forget, I dont forgive. Its testing time

dull anvil
#

ig it focuses on the first part

#

maybe cutting it off will cause it to focus on solving

hollow wyvern
primal bison
#

hi

queen grotto
#

ok so i dont have this much python experience but i made a code in python wich imitates the blackjack game. plz help me if you have any comments about the code bcz i am new at python

import random

def blackjack() :
end = False
playerCount = 0
aiCount = 0

while not end :
    userInput = input("play : ")
    if userInput == "" or userInput == " " or userInput == "yes" :
        playerNr = random.randint(1,11)
        aiNr = random.randint(1,11)
        playerCount += playerNr
        aiCount += aiNr
        print("your total : " + str(playerCount))
        print("opponent total : " + str(aiCount))
        print("--------------------------------------------")
        print()
        if playerCount >= 21 :
            end = True
        elif aiCount >= 21 :
            end = True
        
        if end and playerCount >= 21 or aiCount >= 21 :
            if playerCount > aiCount :
                print("you lost with " + str(playerCount))
                print("opponent won with " + str(aiCount))
                print("_______________________________________________")
                print()
            elif aiCount > playerCount :
                print("you won with " + str(playerCount))
                print("opponent lost with " + str(aiCount))
                print("_______________________________________________")
                print()
                
    elif userInput == "end" or userInput == "no" or userInput == "stop" :
        end = True

blackjack()

buoyant kestrel
#

@wary folio Yo

rich moss
buoyant kestrel
#

@rich moss Can you toss the function in here that's doing the edge highlighting?

rich moss
#
        for pos in region:
            for dir in Vec2(0, 0).adj():
                if pos + dir not in region:
                    self.canvas["fg_color"][pos] = lerp_colors(
                        self.canvas["fg_color"][pos], WHITE, 0.75
                    )
jade plover
#

amir ali

#

where are you from

#

A.C.E where are you from

tender tangle
dusky bear
#

I m From Brazil

#

and you guys

sinful shadow
#

It would save you from rechecking who won again

#

Something I find useful is using formatted strings (f-strings) to print out information

For example,
”Hello, “ + str(name) would become f”Hello, {name}” where the name variable is inside of curly braces

#

Sorry for the curled quotes

tight ridge
#

i found 1xbet source code

import random

with open('data.txt', 'r') as datas:
    textes = datas.readlines()

de_data = {}
ids = []
for i in textes:
    splitted = i.split(',')
    id = splitted[0].split('=')[1].strip()
    money = int(splitted[1].split('=')[1].strip())
    ids.append(id)
    de_data[id] = money

def money():
    ranid = ids[random.randint(0, len(ids) - 1)] 
    ranmoney = random.randint(100, 500)
    
    if random.randint(0,10) > 7:
        print('id:', ranid, 'win:', ranmoney)
        de_data[ranid] += ranmoney
    else:
        print('id:', ranid, 'lost:', ranmoney)
        de_data[ranid] -= ranmoney

for i in range(5000):
    money()

def update_data():
    with open('data.txt', 'w') as write_file:
        for id, money in de_data.items():
            write_file.write(f'id={id}, money={money}\n') 

update_data() ```
keen badge
#

@unborn sorrel @buoyant kestrel I sent someone an exe and it opened command prompt now im on their pc.

#

Hi

woven marten
#

@arctic crypt Hello 🙂

#

sorry no mic

#

only chat 😄

queen grotto
sinful shadow
gusty crest
#

can anyone tell me wts wrong

sinful shadow
#

oh and it should be counter += 1, not counter = +1

sinful shadow
sturdy current
#

Hello everyone, i have been doing a lot of reading on python and trying to code the example but whenever i tried to write something on my own. I don't even know where to start from. Can anyone help me

high monolith
#

!resources

timid fjordBOT
#
Resources

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

high monolith
#

I bet there are some great resources there. Ideally, you need some projects to make. Then figure out what you need to build that project. start small. Maybe a tic tac toe game?

#

You'll learn more by doing than by reading or watching a video.

sturdy current
#

Thanks man.

sinful shadow
#

:D

mild vapor
#
print("************************")
print(" Enter the right option ")
print("************************")

print("")
question1 = input("press Y for 1st question: ")
print("")

if question1 == "y" or "Y":

    print("Circumference of circle is _______")
    print("(a) 4*pi*r")
    print("(b) 8*pi*r")
    print("(c) 2*pi*r")
    print("(d) 17*pi*r")

answer = input("write the right option: ")

if answer == "c":
    print("c is the right option (✔)")

else:
    print(f"{answer} is not the right option (❌)")
#
print("************************")
print(" Enter the right option ")
print("************************")

print("")
question1 = input("press Y for 1st question: ")
print("")

if question1 == "y" or "Y":

    print("Circumference of circle is _______")
    print("(a) 4*pi*r")
    print("(b) 8*pi*r")
    print("(c) 2*pi*r")
    print("(d) 17*pi*r")

answer = input("write the right option: ")

if answer == "c":
    print("c is the right option (✔)")

else:
    print(f"{answer} is not the right option (❌)")

#Question no. - 2
#*******************************************************************************************************************************************************
#*******************************************************************************************************************************************************

print("")
question2 = input("press Y for 2nd question: ")
print("")

if question2 == "y" or "Y":
    print("Area of circle is _______")
    print("(a) 2*pi*r")
    print("(b) pi*r*square")
    print("(c) pi*h*2")
    print("(d) 6*pi*r")

answer = input("write the right option: ")

if answer == "b":
    print("b is the right option (✔)")

else:
    print(f"{answer} is not the right option (❌)")

#Question no. - 3
#*******************************************************************************************************************************************************
#*******************************************************************************************************************************************************

print("")
question3 = input("Press Y for 3rd question: ")
print("")

if question3 == "y" or "Y":
    print("Square of of 15 is _______")
    print("(a) 25")
    print("(b) 144")
    print("(c) 165")
    print("(d) 225")

answer = input("Write the right option: ")

if answer == "d":
    print("(d) is the right option")

else:
    print(f"{answer} is not right option")
sturdy current
#

You can also use (pass) clause to the if 'y' statement

timid fjordBOT
#
The or-gotcha

When checking if something is equal to one thing or another, you might think that this is possible:

# Incorrect...
if favorite_fruit == 'grapefruit' or 'lemon':
    print("That's a weird favorite fruit to have.")

While this makes sense in English, it may not behave the way you would expect. In Python, you should have complete instructions on both sides of the logical operator.

So, if you want to check if something is equal to one thing or another, there are two common ways:

# Like this...
if favorite_fruit == 'grapefruit' or favorite_fruit == 'lemon':
    print("That's a weird favorite fruit to have.")

# ...or like this.
if favorite_fruit in ('grapefruit', 'lemon'):
    print("That's a weird favorite fruit to have.")
orchid lark
orchid lark
#

also it should be 1-13, not 1 to 11. you could also put a thing that sets it to say "ace" "jack" "queen" and "king" on numbers 1, 11, 12 and 13. and for ace, it should be 11 at first and then if ur about to die it becomes a 1, because ace you get to choose between 1 and 11

drifting roost
hazy bough
#
name = input("Hello, what's your name? ")
if name.strip() == "":
    print("Please enter your name.")
else:
    response = input(f"\nHello {name}, how are you today? (please enter good or bad)")
while True:
 if response.strip() == "good":
     print("Well Thats Good To Hear!")
     break
elif response.strip() == "bad":
   print("Well theats not good :(")
   break
elif:
    print("Please select a valid answer")

im having an issue with this and im not sure how could someone help me

hazy bough
dull anvil
#

I'm assuming you meant something like this:

name = input("Hello, what's your name? ")
if name.strip() == "":
    print("Please enter your name.")
else:
    response = input(f"\nHello {name}, how are you today? (please enter good or bad)")
while True:
    if response.strip() == "good":
        print("Well Thats Good To Hear!")
        break
    elif response.strip() == "bad":
        print("Well theats not good :(")
        break
    elif:
        print("Please select a valid answer")
        response = # fill in this part yourself
#

hmm

hazy bough
#

other than the obvious indent corrections

dull anvil
#

if your code, spaces are placed differently: elif and second elif are outside the while and aren't aligned with the if

lofty sundial
#

who can make me a script or help me

hazy bough
dull anvil
lofty sundial
dull anvil
lofty sundial
#

i want to make a script that will look for a word/button and it will take my cursor and click the button with the word on it

dull anvil
#

what do you need that for? where are you looking for that word/button?

lofty sundial
dull anvil
#

is it a single-player game?

lofty sundial
#

no

hazy bough
#

AHA i forgot to add a condition to the second elif and fixed the indentions on my own

dull anvil
#

we can't help with gaining a competitive advantage in multiplayer games since that often goes against their rules/terms of service

dull anvil
#

!rule 5

timid fjordBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

hazy bough
#

name = input("Hello, what's your name? ")
if name.strip() == "":
    print("Please enter your name.")
else:
    response = input(f"\nHello {name}, how are you today? (please enter good or bad)")
while True:
   if response.strip() == "good":
         print("Well Thats Good To Hear!")
         break
   elif response.strip() == "bad":
         print("Well theats not good :(")
         break
   elif response.strip() == "":
       print("Please select a valid answer")

does this look neat to anyone?

dull anvil
#

seems like they left

#

¯_(ツ)_/¯

hazy bough
#

i thought .strip() was needed for whitespaces/blanks

hazy bough
#

it works but i want to know if it looks neat to others

dull anvil
#

have you tried running it with wrong inputs?

hazy bough
#

i forgot about that haha

hazy bough
dull anvil
#
name = input("Hello, what's your name? ")
if name.strip() == "":
    print("Please enter your name.")
else:
    response = input(f"\nHello {name}, how are you today? (please enter good or bad)")
# <-- here, `response` might be undefined
hazy bough
#

when inputting an incorrect response it loops print("Please select a valid answer") forever

#

i screwed it up somehow

dull anvil
#
while True:
    if response.strip() == "good":
        print("Well Thats Good To Hear!")
        break
    elif response.strip() == "bad":
        print("Well theats not good :(")
        break
    elif response.strip() == "":
        # this doesn't run when you input something wrong and non-empty
        print("Please select a valid answer")
    # `response` isn't updated here => loop just repeats
#

once you figure this out, then you should be able to do the same with name on your own

hazy bough
#

while loops arent my strongsuit haha

#
name = input("Hello, what's your name? ").strip()
if name.strip() == "":
    print("Please enter your name.")
else:
   
  while True:
       response = input(f"\nHello {name}, how are you today? (please enter good or bad)").strip()
       if response.strip() == "good":
             print("Well Thats Good To Hear!")
             break
       elif response.strip() == "bad":
            print("Well theats not good :(")
            break
       else:
           print("Please select a valid answer")

when putting this into VSC i get a invalid syntax error on line one....

#

i cant know if ive fixed it until then haha

hollow wyvern
#

just go announced not dropped hahah\

swift ice
#

o3 is trash

hollow wyvern
hollow wyvern
# swift ice o3 is trash

Unironically, and I'm genuinely not exaggerating. This model is likely better at math than every single person on this server except for maybe the top 1%.

If you are not a bright undergrad or above, you are not better then this model. I can confidently say that.

hollow wyvern
# swift ice o3 is trash

If you actually care about the results, I would suggest this video. Goes over the pros and cons.

Also no, the benchmarks are not contaminated. It has not seen the problems. Dont even try that one

modest canyon
waxen elk
#

anyone looking to help with an impossible project?

swift ice
strong garden
#

my_time=int(input("Enter the time in seconds: "))

for x in range(my_time,0,-1):
    seconds = x % 60
    minutes = int(x/60)%60
    hours = int(x/3600)
    print(f"{hours:02}:{minutes:02}:{seconds:02}")
    time.sleep(1)



print("Time is up")
#

Can somebody help me with the above code

#

newbie

dull anvil
#

what's the issue?

#

ah

dull anvil
#

for integer division, there is //

#

though int(a / b) is mostly fine, it's not exactly the same thing

#

!e

import time

my_time=5

for x in range(my_time,0,-1):
    seconds = x % 60
    minutes = int(x/60)%60
    hours = int(x/3600)
    print(f"{hours:02}:{minutes:02}:{seconds:02}")
    time.sleep(1)

print("Time is up")
timid fjordBOT
dull anvil
strong garden
#

Code is working fine.. Need help with minutes = int(x/60)%60

dull anvil
#

without involving floats, that line can be written as:

minutes = x // 60 % 60
#

you can also use divmod

#

!e

x = 11111
total_minutes, seconds = divmod(x, 60)
hours, minutes = divmod(total_minutes, 60)
print(f"{hours:02}:{minutes:02}:{seconds:02}")
timid fjordBOT
strong garden
#

let me try.. newbie.. please don't mind

dull anvil
#

!d divmod

timid fjordBOT
#

divmod(a, b)```
Take two (non\-complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. With mixed operand types, the rules for binary arithmetic operators apply. For integers, the result is the same as `(a // b, a % b)`. For floating\-point numbers the result is `(q, a % b)`, where *q* is usually `math.floor(a / b)` but may be 1 less than that. In any case `q * b + a % b` is very close to *a*, if `a % b` is non\-zero it has the same sign as *b*, and `0 <= abs(a % b) < abs(b)`.
dull anvil
#

^ docs for what divmod does

dull anvil
#

since you've just shared it publicly

tardy holly
#

🙂

tardy holly
dull anvil
#

I don't know what it's even supposed to do

dull anvil
tardy holly
#

i know

tardy holly
dull anvil
#

port scanning and IP identification is something we can't help with here because it's too easy to utilise for malicious uses (even though your usecase might be completely fine)

#

^ is the problem directly related to either of those two? @tardy holly
or is it about using discord.py/asyncio/etc. in general?

tardy holly
#

its when running the code

#

it just says a eror

woven marten
#

live coding, text only.. no talk

buoyant kestrel
#

Still working on more of the same, @woven marten?

#

Or is this a different project

woven marten
#

fancy js dropdown currently

#

polishing it

buoyant kestrel
#

Niiice

sturdy geyser
#

@buoyant kestrel

buoyant kestrel
neon portal
#

Don't just use if-else chains. Learn to use dictionaries with lambdas as well.

#

If you have code where only one gets executed, it'll be faster.

#

You're a beginner until you're not.

#

At this point, I think pythonic is about elegant code that runs well.

#

Get too stuck on one style, and you'll never improve.

#

Learning syntax and what does what is doable within a month, especially if you have prior experience with another language.

#

Learning WHERE and WHEN to use something, that you need to make mistakes and learn.

ocean echo
neon portal
#

That doesn't have a clock. You'll have to experience it at your own subjective pace. My approach is to try to make packages. One way or another you'll make every mistake eventually.

neon portal
#

Do you have python basics down?

#

Like what a variable is, what if-else blocks are, what a loop is, etc.?

ocean echo
# neon portal Do you have python basics down?

Honestly I'm new I started 3 days ago.... I'm learning it from a yt video I try to cover the exercises myself and try to do extra that is not in the question and I use gpt after my code is done to get suggestions for better....

ocean echo
buoyant kestrel
#

@prime yoke probably better talk in here

neon portal
# ocean echo Honestly I'm new I started 3 days ago.... I'm learning it from a yt video I try ...

Okay, that's not really good. Instead, try this course. It has videos, lecture notes, etc., and has a proper structure.
https://ocw.mit.edu/courses/6-0001-introduction-to-computer-science-and-programming-in-python-fall-2016/

MIT OpenCourseWare

6.0001 Introduction to Computer Science and Programming in Python is intended for students with little or no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems and to help students, regardless of their major, feel justifiably confident of their ability to write small p...

buoyant kestrel
#

The built in text channel in the voice chats are.... annoying if no one is streaming

neon portal
neon portal
ocean echo
neon portal
#

All good. Anything I say is only a suggestion. You're the person who has to do it.

buoyant kestrel
sturdy geyser
#

@obtuse nebula

obtuse nebula
keen narwhal
#

how do i get screenshare permissions?

void talon
#

ask a mod when they're around while they're around to supervise

simple marten
lethal galleon
#

came to watch

#

@copper cloud

copper cloud
copper cloud
somber island
#

the 50 messages limmit to talk is annoying

wheat cosmos
#
print("Hello!"```
#

!py

devout breach
#

talking is over rated

long briar
#

who will code?

devout breach
#

code monkeys

long briar
#

nice

devout breach
#

so does any one use python as a front to pass data to C++ or RUST

long briar
#

speakers go to sleep

devout breach
#

zoom to chat 0

#

the pied piper of code rooms @sour seal

sour seal
#

Why ur not talking

#

/??\

#

voice verification

#

or smth like that

plucky dune
dim vault
#

@twilit quarry what u up to

neon portal
sour seal
#

Hey how to stream inlive coding vc

trail tundra
#

0

#

'0'

vivid robin
#

yo how do you hack the nasa?

fresh dagger
#

Okay why I don't have permission to speak in voice chat

indigo zinc
#

لا اله الا الله

#

محمد رسول الله

thick coyote
fleet swan
#

i survived a 50h coding session, needed one and a half packet of cigarettes, i hate quantitative finance, i wnt to die or to get drunk

#

i don't smoke or drink, i didn't hate my coworkers/friends, i didn't hate HR to much, now i do

primal bison
#

to get verified you need a few things that are listed on the voice-verification channel

#

be online for 3 10 minute increments

#

post 50 messages without spamming (like I am right now)

#

and be on the python server for 3 days

#

then you can go to the voice verification channel and ask it to unban you from speaking

mild vapor
#

!py

timid fjordBOT
#
System Python

Why Avoid System Python for Development on Unix-like Systems:

  • Critical Operating System Dependencies: Altering the system Python installation may harm internal operating system dependencies.
  • Stability and Security Concerns: System interpreters lag behind current releases, lacking the latest features and security patches.
  • Limited Package Control: External package management restricts control over versions, leading to compatibility issues with outdated packages.

Recommended Approach:

  • Install Independent Interpreter: Install Python from source or utilize a virtual environment for flexibility and control.
  • Utilize Pyenv or Similar Tools: Manage multiple Python versions and create isolated development environments for smoother workflows.
fleet swan
# cyan viper Dont quants do mainly math

Yeah, some of us develop models, a lot of models, and test them, a lot of tests, if some of the models are nice we test them with live data against our current running models, the one that wins the race get to be the main until it is dethroned. Sometimes people get a inspiration and start testing one kind of model with different stuff modified and keep on with it, I like the TFT model as it is a good base to work with and most of my work starts from there, I like to read the studies published along with the models and do the same tests that thei to in the paper(if there is code mentioned then nice if not I speculate on my own). You can see how it is alot of work and for someone starting in the business I have to work tomorrow to take advantage of the market holiday

livid cloak
boreal hawk
#

Can someone help me code

odd harness
#

ty for absolutly nothing chatgpd

granite rain
sharp pagoda
#

that's really cool

winter relic
sullen cove
gray flint
#

DO MORE WITH YOUR DATA Visualize, optimize, and 
troubleshoot with Redis Insight Redis Insight is our free graphical interface for analyzing Redis data across all operating systems and Redis deployments with the help of our AI assistant, Redis Copilot. Learn more Works with your stack: How it works Take control of your data Use intuitive […]

wispy basin
#

Thanks!

magic oxide
#

hi

gray flint
livid cloak
livid cloak
livid cloak
wispy basin
#
def total():
    print("Welcome to the tip calculator")
    while True:
        total_bill = input("Please input the bill amount: ")
        how_many_split = input("How many people to split the bill?: ")
        how_much_tip = input("What percent would you like to tip? 10, 15, 20? or custom: ")
        if total_bill.isnumeric() and how_many_split.isnumeric() and how_much_tip.isnumeric():
            print(calculate_tip(int(how_much_tip), int(total_bill), int(how_many_split)))
            exit(0)
        else:
            print("That's not a valid number.")
def calculate_tip(tip_percentage, total_amt, split):
    tip_decimal = tip_percentage / 100
    total_w_tip = total_amt + (total_amt * tip_decimal)
    total_pp = total_w_tip / split
    rounded_total_pp = round(total_pp, 2)
    print(f"Your bill is ${rounded_total_pp} per person.")

total()
neon portal
#
def calculate_tip(
        tip_percentage: float,
        total_amount: float,
        num_pax: int
    ) -> float:
    """ Calculate the total fee per pax including tip.

    Parameters
    ----------
    `tip_percentage` : float
        The percentage of tip to be given. Must be between 0.0 and 100.0.
    `total_amount` : float
        The total amount of the bill.
    `num_pax` : int
        The number of people to split the bill.

    Returns
    -------
    `total_fee_per_pax` : float
        The total fee per pax including tip.

    Raises
    ------
    ValueError
        - If `tip_percentage` is not between 0.0 and 100.0.

    Usage
    -----
    >>> calculate_tip(10, 100, 2)
    """
    if tip_percentage < 0 or tip_percentage > 100:
        raise ValueError(
            "Tip percentage must be between 0.0 and 100.0. "
            f"Received: {tip_percentage}"
        )

    tip_multiplier = tip_percentage / 100

    # Add the tip to the total amount
    total_amount = total_amount + (total_amount * tip_multiplier)

    total_fee_per_pax = total_amount / num_pax

    # Round off the total fee per pax to 2 decimal places
    # to allow for easier dispension of change
    total_fee_per_pax = round(total_fee_per_pax, 2)

    return total_fee_per_pax

def total() -> None:
    """ Calculate the total fee per pax including tip.
    """
    print("Welcome to the tip calculator!")

    while True:
        bill = abs(float(input("Please input the bill amount: ")))
        num_pax = abs(int(input("How many people to split the bill?: ")))
        tip_amount = abs(int(input("What percent would you like to tip? 10, 15, 20? or custom: ")))

        total_fee_per_pax = calculate_tip(tip_amount, bill, num_pax)

        print(f"Each person should pay: ${total_fee_per_pax}. Thank you for eating at Brain Fuck!")
        break

total()
#

Points:

  • Get in the habit of using type annotation.
  • Get in the habit of writing verbose and clear variable and function names.
  • Add comments to explain the WHY not the WHAT.
  • Document your code where possible/needed.
  • Be mindful of how you handle input() as it will by default return a string.
  • Keep doing what you're doing!
serene crystal
neon portal
#

Just put in the time, and you'll get through the dog days.

naive mesa
#

just coding

#

or trying to

#

i can not

#

i can hear you though

crisp bridge
#

@stuck fox and @naive mesa hello

naive mesa
#

I forget how to be verified for talking

#

ahh

#

I dont have enough messages yet. I have been in for five months. It saids i need 50 messgaes but im at around 30

#

I suppose so, I am still attempting to learn python but its hard

#

ahhh, I bet and so far pycharm and juts some youtube videos

#

I start my next semster of college but they dont teach it where im at

#

so I either gotta wait or

#

Yea just DM it to me, Id love the resources

crisp bridge
#
MIT OpenCourseWare

This subject is aimed at students with little to no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems. It also aims to help students, regardless of their major, feel justifiably confident in their ability to write simple programs that allow them to accomplish useful goa...

naive mesa
#

How long do these take to get through?

#

Yea, I would like to just take a week or so

#

and commit as much as possible

#

I know I know heh

#

But I have college starting in two weeks or so

#

and would like to learn as much as possible before it starts back up again

#

and so far I am undecided in a major

#

I just finished my first semster and am just doing gen eds. And I have not, I am very new to all this

#

and am looking to learn a skill

#

Try new things, see what im interested in mainly

#

Id like to get through a course or two and deicde if i want to contiue also i have not

crisp bridge
#
naive mesa
#

Gotcha

#

and I just want to do something with my time

#

I was so-so at it. I understood it just had bad teachers

#

thus far I enjoy it, I am just trying to understand it, lots to learn

#

but thank your for the resources, so definitly start with TTML

#

HTML

#

and yes

#

i can send you the video ive been working on

#

if youd like

#

I mean i have just been using the free resources

#

but this one so far has been good

#

i am about half way through

#

the video, trying to understand everything

#

i think i can speak now

#

give me just a second

crisp bridge
#

hello @stable falcon

young karma
#

Can I be able to use phone for Python

dull anvil
young karma
weak maple
#

What are some beginner level python projects to make?

dull anvil
#

what I use on Android for Python is:
termux + neovim

but, though powerful, that's a somewhat non-trivial setup

young karma
dull anvil
#

there are also some Python-specific apps available, you can find those wherever you install apps from

dull anvil
#

as for which alternatives are good -- that I don't know

young karma
#

@dull anvil can you teach me termux

dull anvil
#

there isn't really that much to teach that'd be different from regular Linux

young karma
dull anvil
young karma
#

Ok

dull anvil
#

there is no other conversation currently happening in this channel, so there is no reason to move elsewhere

young karma
#

Ok

#

So,I have downloaded GitHub

#

App

dull anvil
#

termux-app_v0.118.1+github-debug_arm64-v8a.apk file?
(or termux-app_v0.118.1+github-debug_universal.apk)

young karma
#

My device can not download termux from play store

dull anvil
#

after installation, within the app,

pkg install -y vim

then

vimtutor

latter is just a tutorial for the text editor (Vim)

#

if at any point this feels too difficult/unintuivite, it's probably a good idea to just search for a different, purpose-built app

young karma
#

I'm on it right now

#

What the criteria to sign in on GitHub

#

Because it shows password and username is not correct

dull anvil
#

you don't need the GitHub app

#

that page is the latest stable release of termux

young karma
#

Downloaded successfully

#

Next thing to do

dull anvil
#

that apk itself should be installable as is

young karma
#

Installed

dull anvil
#

vimtutor might open with a somewhat unusable width, you can zoom in/out using regular zoom gestures

young karma
#

Yes,it open

#

What next

dull anvil
#

it should look something like this

young karma
#

Yes

#

Exactly

dull anvil
#

the editor that's opened is called Vim, and that text describes how to use it

young karma
#

Ok

dull anvil
#

try going through the tutorial; if by the end of lesson 1.1 you're comfortable with using such editor, then you can try continuing a bit further until you're confident enough you can do basic editing with it

#

termux has arrow buttons on screen and provides scroll, so you don't have to limit yourself to using only the keyboard

young karma
#

So,if anything I don't understand again I will chat you

young karma
#

Hi

#

@dull anvil hi good day

cursive bough
young karma
indigo zinc
#

look

#

see

#

where cmd?

#

cmd room

wispy basin
#

@deft yarrow hello

raven crater
#

hello

wispy basin
#

v0

#

langflow, langchain

#

langchain is the open source code for RAG flow stuff

raven crater
#

@stray sable ?

stray sable
primal bison
pseudo sorrel
#

when im asking for admin perm in my programm script written in python

#

administrator permission

#

i want the administrator permission keeping runing my program

#

actualy when i ask for admin perm

#

the program stop

#

and dont restart

#

i think this is cause my ide is not running again the script

winged pivot
#

Hello Everyone

toxic kernel
toxic kernel
#

Hi greeuceauna

radiant apex
#

hi

#

i am trying to run my code on my mac and its not woking

toxic kernel
radiant apex
#

it works fine on my pc

toxic kernel
radiant apex
#

here is wht i get

radiant apex
#

any one here use mac

toxic kernel
#

You can ask people in the chats , the other one is afk

forest sundial
radiant apex
#

i already installed it

#

do i have to run pip. in my cmb

forest sundial
#

Go into your python file directory and type python3 name.py

radiant apex
#

yh where do i get that from

forest sundial
#

Get what?

radiant apex
#

the python file directory

#

i am new to mac

#

os

forest sundial
#

Do you not know where you've installed your file to?

radiant apex
#

nah bro