#voice-chat-text-0

1 messages · Page 105 of 1

vocal basin
#
filter(f, a)
# ==
(x for x in a if f(x))
#

second is generator comprehension

#

x is an element

#

a is an iterable

#

f is a ||predicate|| function

#

Pascal -- in 2006-2009 and 2015-2017

#

there's no "since"

#

I'm not coming back to it

#

@cedar solar this

vocal basin
#

because I wasn't really understanding what I was doing back then

#

I had C and Lua experience prior to 2017

#

@whole bear you used float

whole bear
#

wdym

vocal basin
#

example:

expected: 46
got     : 46.0
whole bear
#

i thought i converted it into an integer

#

also

#

you can divide?

vocal basin
whole bear
#

i thought that isnt a thing you can do

vocal basin
wise cargoBOT
#

operator.floordiv(a, b)``````py

operator.__floordiv__(a, b)```
Return `a // b`.
whole bear
#

im so confused

#

was i at least close

vocal basin
#

!e

print(999 // 10)
print(1000 // 10)
print(1001 // 10)
wise cargoBOT
#

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

001 | 99
002 | 100
003 | 100
vocal basin
whole bear
#

oh

#

somewhat close at least

#

i had the right idea

#

average

vocal basin
#

fun fact: it's also a median

whole bear
winter plover
#

mean

#

mean(a, b)

vocal basin
#

!e

from statistics import median, mean
print(round(median([12, 30])))
print(round(mean([12, 30])))
wise cargoBOT
#

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

001 | 21
002 | 21
winter plover
#

math.mean

vocal basin
#

this is just a preset:

import sys
import math
#

you can use most of standard library

#

math shouldn't have it

winter plover
#
def string_to_ascii(file_path:str):
    result = []
    buffer = []
    
    with open(file_path, 'r') as file:
        for char in file.read():
            buffer.append(ord(char))
            if len(buffer) == 3:
                result.append(buffer)
                buffer = []

        if 0 < len(buffer) < 3:
            for i in range(3 - len(buffer)):
                buffer.append(0)
            result.append(buffer)
        
    return result
vocal basin
#

"waiting for bytes to base64"
because the following is something I use at least weekly:

>>> from os import urandom as u
>>> from base64 import b64encode as b
>>> b(u(32))
b'aFWbWO72JVO1T+1oCy6SkXB/aJtXFH0t1bNJ7awdZWw='
#

btw, urandom is cryptographically secure

#

I don't want to come up with variable names

#
  • most one line solutions are more performant
#

and simpler

#

and more functional

whole bear
#

you are really good at python

#

do you have a job?

vocal basin
#

I was talking to some telecom idiots

winter plover
vocal basin
winter plover
#

!d chr

wise cargoBOT
#
chr

chr(i)```
Return the string representing a character whose Unicode code point is the integer *i*. For example, `chr(97)` returns the string `'a'`, while `chr(8364)` returns the string `'€'`. This is the inverse of [`ord()`](https://docs.python.org/3/library/functions.html#ord "ord").

The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in base 16). [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "ValueError") will be raised if *i* is outside that range.
vocal basin
vocal basin
#

and they reply with "OoH jUsT uSe HtTpS"

#

and what if the site doesn't have it?

#

!e

print(*range(10), sep=':')
wise cargoBOT
#

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

0:1:2:3:4:5:6:7:8:9
vocal basin
#

map is an iterator

#

list is iterable

#

range is iterable too

#

no, on iter(list())

winter plover
#

!e ```py
dna = "ATCGCCA"

Write an answer using print

To debug: print("Debug messages...", file=sys.stderr, flush=True)

print(map({'A':'T','G':'C','T':'A','C':'G'}.getitem,dna),sep='')

vocal basin
#

it timed out

winter plover
#

!e ```py
dna = "ATCGCCA"

Write an answer using print

To debug: print("Debug messages...", file=sys.stderr, flush=True)

print(map({'A':'T','G':'C','T':'A','C':'G'}.getitem,dna),sep=''

vocal basin
winter plover
#

!e ```py
dna = "ATCGCCA"

Write an answer using print

To debug: print("Debug messages...", file=sys.stderr, flush=True)

print(map({'A':'T','G':'C','T':'A','C':'G'}.getitem,dna),sep='')

wise cargoBOT
#

@winter plover :white_check_mark: Your 3.11 eval job has completed with return code 0.

<map object at 0x7fe9d2cfd2d0>
vocal basin
#

!e

dna = "ATCGCCA"
print(*map({'A':'T','G':'C','T':'A','C':'G'}.__getitem__, dna), sep='')
print(*({'A':'T','G':'C','T':'A','C':'G'}.__getitem__(c) for c in dna), sep='')
print(*({'A':'T','G':'C','T':'A','C':'G'}[c] for c in dna), sep='')
print(''.join({'A':'T','G':'C','T':'A','C':'G'}[c] for c in dna))
print(''.join([{'A':'T','G':'C','T':'A','C':'G'}[c] for c in dna]))
wise cargoBOT
#

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

001 | TAGCGGT
002 | TAGCGGT
003 | TAGCGGT
004 | TAGCGGT
005 | TAGCGGT
vocal basin
#

* just uses __iter__

#

like for loop

#

!e

class C:
    def __iter__(self):
        yield 1
        yield 11

print(*C())
wise cargoBOT
#

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

1 11
vocal basin
#

!e

def f(*args):
    print(f'{args!r}')

f(1, 11)
wise cargoBOT
#

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

(1, 11)
#

@verbal zenith :white_check_mark: Your 3.11 eval job has completed with return code 0.

3
vocal basin
#

*args passing to a function is common in decorators

#

!e

def f(a,b):
    print(a+b)

args = [1, 2]
f(*args)
wise cargoBOT
#

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

3
verbal zenith
#

!e

def f(a,b):
  print(a+b)
x = (1,2)
f(*x)
wise cargoBOT
#

@verbal zenith :white_check_mark: Your 3.11 eval job has completed with return code 0.

3
winter plover
#

!e ```py
def f(*args):
print(f'{args}')

f(1, 11)

wise cargoBOT
#

@winter plover :white_check_mark: Your 3.11 eval job has completed with return code 0.

(1, 11)
vocal basin
#

!e

a, b, *c = 1, 2, 3, 4, 5
print(f'{a!r} {b!r} {c!r}')
wise cargoBOT
#

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

1 2 [3, 4, 5]
noble solstice
vocal basin
#

!d f-string

wise cargoBOT
noble solstice
#

!doc r

vocal basin
verbal zenith
#

!e

print("hello".__repr__())
hello = "hello"
print(f"{hello!r}")
wise cargoBOT
#

@verbal zenith :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | 'hello'
002 | 'hello'
vocal basin
#

!e

print(f'{"1" + "11"}')
print(f'{"1" + "11"!r}')
print(f'{"1" + "11"=}')
print(f'{"1" + "11"=!r}')
wise cargoBOT
#

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

001 | 111
002 | '111'
003 | "1" + "11"='111'
004 | "1" + "11"='111'
whole bear
#

i have no idea whats going on anymore

#

i just started a month ago

vocal basin
#

ohno

verbal zenith
#

!e

hello = "hi world!"
print(f"{hello=}")
wise cargoBOT
#

@verbal zenith :white_check_mark: Your 3.11 eval job has completed with return code 0.

hello='hi world!'
vocal basin
#

I forgot

#

!e

print(f'{"1" + "11"=!r:>10}')
wise cargoBOT
#

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

"1" + "11"=     '111'
vocal basin
#

5 spaces, 10 chars total

#

!e

print(f'{"1" + "11"=!r:_>10}')
wise cargoBOT
#

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

"1" + "11"=_____'111'
vocal basin
#

!e

print(f'{"1" + "11"=!r:_^11}')
wise cargoBOT
#

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

"1" + "11"=___'111'___
verbal zenith
#
╭─────────────────────────────────────────────────────────────────────────────────
│ .\examples\rps.rat:4:131: Error: Invalid Binary numerical literal '12'
├────┬────────────────────────────────────────────────────────────────────────────
│  0 │ print("Welcome to Rock, Paper, Scissors!"); print("Type 'rock', 'paper' ...
│  1 │ // Rock, Paper, Scissors written in RattleScript
│  2 │
│  3 │ ... ', 'paper', or 'scissors' to play."); print("Type 'quit' to quit."0b12)
│    ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌▲
|    |                                      Invalid Binary numerical literal '12'
│  4 │
│  5 │
╰────┴────────────────────────────────────────────────────────────────────────────
vocal basin
#
"Type 'quit' to quit."0b12
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌~~~▲
#

python isn't slow necessarily
it just does a lot of stuff

winter plover
#
if let Some((w, h)) = term_size::dimensions() {
    println!("Width: {}\nHeight: {}", w, h);
} else {
    println!("Unable to get term size :(")
}
vocal basin
#

!d curses

wise cargoBOT
#

Source code: Lib/curses

The curses module provides an interface to the curses library, the de-facto standard for portable advanced terminal handling.

While curses is most widely used in the Unix environment, versions are available for Windows, DOS, and possibly other systems as well. This extension module is designed to match the API of ncurses, an open-source curses library hosted on Linux and the BSD variants of Unix.

Note

Whenever the documentation mentions a character it can be specified as an integer, a one-character Unicode string or a one-byte byte string.

Whenever the documentation mentions a character string it can be specified as a Unicode string or a byte string.

vocal basin
#

I should re-do the interpreter of my language in Rust
most of the things it's doing are like:

[some_runtime_array[i] for i in some_compiler_array]

and also some tree rotations

#

Arc -- atomic

#

my first challenge solved on codewars was about implementing a mutex

#

(which had to use atomic functions)

#

atomic increment, for example, is guaranteed to increment the value

#

unlike ++i

#

which can run into a race condition

#

atomic -- not intersecting (in some sense)

#

"in exactly one step"

#

it's a CPU-level lock

#

probably

vocal basin
#
A gets     i (10)
B gets     i (10)
B writes ++i (11)
B gets     i (11)
B writes ++i (12)
A writes ++i (11)
#

btw, C code isn't guaranteed to run in the order you wrote it
(which contributes to race condition issues)

open lily
#

I am still stuck in the same place after so many different tries.

#

................

open lily
#

Can I share the entire ipynb so someone can go through with me

#

This is so frustrating

vocal basin
vocal basin
vocal basin
vocal basin
#

or around that

vocal basin
#

from the error, I guess

def get_number_of_jobs_T(technology):  
    #your code goes here
    return technology, number_of_jobs
open lily
#

Yes

#

I couldn't even find the data related to what this question was asking:
Write a function to get the number of jobs for the Python technology.

vocal basin
#

there's a link

#

the same link you posted earlier

open lily
#

Yes

#

It's not in there

vocal basin
#

I think api_url should be it

#

instead of what it is by default

#

the default is locally hosted

open lily
#

I have replaced the url with the link

sour willow
#

wassup AF, Opal

open lily
#

Within that link there's no such wording "python technology" etc

vocal basin
sour willow
#

its like saying building with gcc and compiling the builded image with llvm

vocal basin
#

compiled code layout

#

maybe not as drastic as 10% for real applications but 1~3% for algorithms can be expected
https://youtu.be/r-TLSBdHe1A

Performance clearly matters to users. For example, the most common software update on the AppStore is "Bug fixes and performance enhancements." Now that Moore's Law has ended, programmers have to work hard to get high performance for their applications. But why is performance hard to deliver?

I will first explain why current approaches to evalu...

▶ Play video
vocal basin
bleak orbit
#

!e

wise cargoBOT
#
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!

vocal basin
open lily
#

Can I see how you write the code above

vocal basin
#

the following is pretty much what you already had:

api_url = ...
def get_number_of_jobs_T(technology):
    response = requests.get(api_url)
    if not response.ok:
        raise RuntimeError("something went wrong")
    data = response.json()
    ...  # write implementation here
    return technology, number_of_jobs

and to use data, as it's a list, you'd probably use for loop

# initialise `number_of_jobs`
for job in data:
    ...  # change `number_of_jobs` here

to get skills, it'd require job["Key Skills"] (as you found out earlier)

skills = job["Key Skills"]
if ...:  # check if `skills` contains `technology`
    ...  # change `number_of_jobs`
#

all in one place it'd be:

api_url = ...
def get_number_of_jobs_T(technology):
    response = requests.get(api_url)
    if not response.ok:
        raise RuntimeError("something went wrong")
    data = response.json()
    number_of_jobs = 0
    for job in data:
        skills = job["Key Skills"]
        if technology in skills:
            number_of_jobs += 1
    return technology, number_of_jobs
#

as you're counting the jobs that contain technology in corresponding Key Skills

lone bluff
#

@somber heath hello

somber heath
#

@lone bluff 👋

vocal basin
lone bluff
#

Looks like I dont have the permission yet lol

vocal basin
#

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

lone bluff
#

How are you guys doing

vocal basin
#

or

#
if technology in {skill.strip() for skill in skills}:
    ...
#

and if you want to do caseless comparison:

if technology.casefold() in {skill.strip().casefold() for skill in skills}:
    ...
open lily
#

Let me digest

sour willow
open lily
#

I almost did...

#

But I think I got the logic burnt in my brain so thank you

#

@vocal basin

#

My fkin god...

vocal basin
#

oh, wow a new feature

somber heath
#

@proper creek Your audio quality is poor the the point of being unintelligible.

#

I can also hear myself.

proper creek
#

thats weird

#

i been on other vc

somber heath
#

You may need to restart your client.

#

Or your computer.

proper creek
#

alr one sec

somber heath
#

If you're downloading something, or someone on your internet connection is, that may also be the source of problems.

vocal basin
#

it sounds more like connection issues

#

which may explain why "on other vc" it could've worked better

proper creek
#

wbt now

somber heath
#

Still crap.

spiral shell
#

hello guys

#

just call me ilham @somber heath

#

it's kinda hard to spell it

#

ilham is my real name

#

i have a question

#

what is different between vscode and visual studio

proper creek
vocal basin
vocal basin
somber heath
#

@proper creek I just can't hear a thing you say when you say anything. It's next to pure garble.

proper creek
somber heath
#

I'm not trying to be difficult. It's just awful to listen to.

proper creek
spiral shell
#

@somber heath how about pycharm pro and community?

somber heath
somber heath
spiral shell
proper creek
#

why, pycharm is cool

somber heath
#

IDLE. Because I'm a Luddite.

vocal basin
somber heath
#

I'm not suggesting it's good, I'm just saying it's what I use.

proper creek
somber heath
#

The default one which comes with Python.

proper creek
#

rlly

vocal basin
spiral shell
#

ohh for python wich is better?

proper creek
#

i say pycharm

#

coz its much easier on pycharm

vocal basin
#

Visual Studio does have some support for python but it's not very beginner-friendly

proper creek
#

pycharm is beginner-friendly

#

thats why i like it

vocal basin
spiral shell
vocal basin
spiral shell
#

ohhh thank you

proper creek
#

Pycharm community is a free version of pycharm having limited feature where as pycharm professional is a pro version where you get some extra tools like database development , web development and some advance features.

vocal basin
proper creek
#

i just googled it up

spiral shell
#

thank you guys, it's help alot

proper creek
#

try both vs studio and pycharm

#

i sometimes use vs too

vocal basin
proper creek
#

whatever

vocal basin
#

either you're a student and you get it for free
or you make enough money from it to pay for the license

solar flax
#

anyone in here understand the computer vision ?

vocal basin
#

@midnight agate can hear

spiral shell
#

@midnight agate hello

#

i from indonesia

spiral shell
#

italy?

#

daijobu

somber heath
#

@coarse lily👋

spiral shell
#

@midnight agate i happy to join this server, cuz i not only learn about python but i can talk to peaple, especialy in english so i can practice my english too

#

meeting new person is kinda fun

somber heath
#

@solar flax👋

coarse lily
#

hallow i went help to make game

somber heath
#

Have you chosen a particular framework to use, or...?

solar flax
#

can u guys give me some advice...

somber heath
#

Regarding?

somber heath
coarse lily
somber heath
spiral shell
#

:V

coarse lily
somber heath
#

Can you share the task text?

vocal basin
solar flax
#

yes

vocal basin
#

do you have a specific question?
or are you looking for a more general ("where do I go next"/"what should I remember") advice?

solar flax
#

what is the best to filtering image using opencv to detect of the text ? especially the manga

vocal basin
#

kanji/hiragana OCR?

coarse lily
# somber heath Can you share the task text?

no text but task make game such as https://youtu.be/qYomF9p_SYM

Creating a Mario Maker style game in Python with a level editor, transitions, enemy behaviour, animations, menus and a player camera. It's a really chunky project.

If you want to support me: https://www.patreon.com/clearcode
(You also get lots of perks)

Social stuff:
Twitter - https://twitter.com/clear_coder
Discord - https://discord.com/inv...

▶ Play video
somber heath
#

Okay, so you're probably talking something along the lines of PyGame.

vocal basin
vocal basin
solar flax
# vocal basin kanji/hiragana OCR?

ya..lot a people told me just use the OCR software like tesseract,EASYOCR
but that's not easy to filter the image that can recognize the text

vocal basin
proper creek
#

hey

#

does anyone know how money transfer and pay pal work?

vocal basin
#

SWIFT?

somber heath
proper creek
#

more paypal

vocal basin
#

paypal and other payment processors reduce payment time because they don't actually transfer money instantly

proper creek
#

wbym

coarse lily
#

@somber heath what can i do

vocal basin
somber heath
# coarse lily <@317279909112446976> what can i do

https://www.youtube.com/watch?v=FfWpgLFMI7w I would suggest you start here.

Learn how to use Pygame to code games with Python. In this full tutorial course, you will learn Pygame by building a space invaders game. The course will help you understand the main game development concepts like moving characters, shooting bullets, and more.

💻 Code: https://github.com/attreyabhatt/Space-Invaders-Pygame

🎥 Course created by bu...

▶ Play video
#

@coarse lily Unless, of course, you're new to Python. In which case...https://www.youtube.com/watch?v=YYXdXT2l-Gg&list=PL-osiE80TeTskrapNbzXhwoFUiLCjGgY7

In this Python Beginner Tutorial, we will start with the basics of how to install and setup Python for Mac and Windows. We will also take a look at the interactive prompt, as well as creating and running our first script. Let's get started.

Mac Install: 1:25
Windows Install: 5:44
Installs Complete: 8:37

Watch the full Python Beginner Series he...

▶ Play video
proper creek
#

so what happens when you transfer money through pay pal but the both use different bank

vocal basin
# proper creek so how does it transfer?

actual money transfer happens

  1. when you deposit/withdraw
  2. when paypal moves money from one of its accounts to another (those corporate accounts may be region-separated or in other ways requiring internal transfers)
proper creek
#

where do i get more detail about how it works in detail

vocal basin
#

"deposits" and "withdrawals" may be implicit

proper creek
#

okay umm i have this simple bank management system

#

i made it using python

vocal basin
proper creek
#

so why does some countries does not support pay pal

somber heath
#

@fluid sluice👋

wise cargoBOT
#

Hey @proper creek!

It looks like you tried to attach file type(s) that we do not allow (.rar). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

vocal basin
proper creek
#

hey umm so does anyone know how to make a program which translates big numbers to word

#

like 1000000 = One Million

vocal basin
#

those are usually bundled with localisation software

proper creek
#

localisation software?

vocal basin
#

"words" is a language-specific concept

#

some localisation-related settings/libraries (in PLs such as C#) include culture-specific display of numbers

#

"refactoring"?

coarse lily
#

@somber heathcan open any dask and make pygame

proper creek
vocal basin
proper creek
#

how

#

oh

somber heath
#

@proper creekHave you used the modulus operator before or the divmod function?

proper creek
#

idk what you are talking about

somber heath
#

!d divmod

wise cargoBOT
#

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)`.
proper creek
#

nah

somber heath
#

It's how you can start to decompose numbers.

proper creek
#

wait ima try num2word

somber heath
#

Separating them into constituent parts, mathematically.

#

If someone else has done a project for it, sure. You can use that.

proper creek
#

why do i not understand much about programming

#

i started programming on January

somber heath
#

@mental warren 👋

somber heath
#

With study and practice and eventual greater fluency with the language, you'll start to give yourself the tools to surmount the next obstacle.

proper creek
#

easy

#

num2word worked

#
import num2words
print(num2words.num2words(49827452))
somber heath
#

@cobalt hawk@fickle nimbus👋

fickle nimbus
#

hey

cobalt hawk
#

i need some help with a program, but the problem is that i dont have the ability to speak

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.

cobalt hawk
#

oh alright

#

thanks

fickle nimbus
#

so

#

i

#

have

#

to

#

wait for 50 messages

cobalt hawk
#

yes

#

as to what it says yeah

fickle nimbus
#

do you know about image processing

somber heath
fickle nimbus
#

specifically implementation of bounded box

#

and connected component algo

#

yep

scenic quiver
#
LeetCode

Can you solve this real interview question? Longest Common Prefix - Write a function to find the longest common prefix string amongst an array of strings.

If there is no common prefix, return an empty string "".

Example 1:

Input: strs = ["flower","flow","flight"]
Output: "fl"

Example 2:

Input: strs = ["dog","racecar","car"]
Output: ""...

#

Could you spot the inefficiencies in the solution and provide a better and an efficient solution?

terse needle
# wise cargo

This is pretty cool, in C you can often optimise the code by using inline assembly because the div instruction stores in the int div in rax and remainder in rdx in x86_64 asm

somber heath
#

@quaint dew👋

terse needle
#
int main(void) {
    int a = 5;
    int b = 2;

    int x = (int)a / b;
    int y = a % b;
    
    return 0;
}

compiles to

main:
        push    rbp
        mov     rbp, rsp
        mov     DWORD PTR [rbp-4], 5
        mov     DWORD PTR [rbp-8], 2
        mov     eax, DWORD PTR [rbp-4]
        cdq
        idiv    DWORD PTR [rbp-8]
        mov     DWORD PTR [rbp-12], eax
        mov     eax, DWORD PTR [rbp-4]
        cdq
        idiv    DWORD PTR [rbp-8]
        mov     DWORD PTR [rbp-16], edx
        mov     eax, 0
        pop     rbp
        ret

but you could rewrite this as

main:
        push    rbp
        mov     rbp, rsp
        mov     DWORD PTR [rbp-4], 5
        mov     DWORD PTR [rbp-8], 2
        mov     eax, DWORD PTR [rbp-4]
        cdq
        idiv    DWORD PTR [rbp-8]
        mov     DWORD PTR [rbp-12], eax
        mov     DWORD PTR [rbp-16], edx
        mov     eax, 0
        pop     rbp
        ret
#

eax and edx are the 32 bit versions of rax and rdx

somber heath
#

@whole bear@spring epoch👋

#

@merry peak👋

#

@wicked vessel👋

wicked vessel
#

Hi

terse needle
wicked vessel
#

He also got me through mine

terse needle
#

what a legend

wicked vessel
#

Yep

#

He has a youtube channel calledf FreeScienceLessons

somber heath
#

The IDEA OF CENTER OF GRAVITY plays an enormous role in the affairs of men. In this program we show a number of enchanting and dramatic DEMON¬STRATIONS bearing on the IDEA.

A - In the very first demonstration we show a double-track which serves as an inclined-plane. Things that can roll - when put at the top - should roll downhill. ...

▶ Play video
#

@maiden bone👋

maiden bone
#

hello

vocal basin
warped raft
#

@vocal basin down for some clash of code

#

@somber heath 👋

warped raft
#

@terse needle I also use arduino

somber heath
#

@terse mulch👋

warped raft
#

so what are you doing

vocal basin
#

this syntax reminds me only of C

#

I can't remember anything else that uses {.field = value}

somber heath
#

@regal orchid👋

#

@mortal lark👋

#

@raven solar👋

vocal basin
#

and {field: value} isn't C

#

idk if C++ allows that

somber heath
#

@cedar glacierYahoy. Your screen name pleases me.

warped raft
#

@vocal basin i want to just see this arduino stuff for some time

#

can we do this after about 15 min

vocal basin
#

ok

warped raft
#

thank you

vocal basin
#

@hasty jungle by saying "5 lights" you definitely missed the word "pedestrian"

somber heath
#

@whole bear👋

warped raft
#

@terse needle so when are you doing this in irl

vocal basin
#

@hasty jungle
two for pedestrians
three for cars

somber heath
#

@hollow swallow👋

warped raft
#

@terse needle can i see your code and join you

hasty jungle
#

damn

somber heath
#

@umbral cairn👋

warped raft
#

@terse needle so have you tried sensor detection and stuff
also how to zoom in discord

somber heath
#

Weird pedestrian logic: Zig zag randomly across oncoming traffic. She'll be right.

warped raft
#

@vocal basin

#

could you tell me one thing

#

can you joing live/coding for a sec

somber heath
#

@grave star👋

#

@whole bear👋

#

@floral anvil👋

warped raft
#

@vocal basin thanks for your valuable time

#

didn't know what to do

vocal basin
#

median of three

#

I hoped it was a task to measure triangle area

#

it wasn't

warped raft
#

see you later

somber heath
obsidian dragon
#

Xperza

somber heath
#

@green wave 👋

obsidian dragon
#

big bruddu is whatchin ya

somber heath
#

@bronze matrix👋

bronze matrix
#

m a little new to this sorry

#

thank u

austere onyx
#

any beginners here?

somber heath
#

@solid reef👋

#

@harsh wagon👋

solid reef
#

hi

sturdy panther
#

I didn't intend to join. Felt it would be rude to just leave immediately though!

#

Fine. Bye!

bronze matrix
#

hi agian sorry, m a little new to python but i want to learn "classes"

#

couldn't find where to start

#

yeah i can

#

oh thank u

#

that's better

somber heath
#

!d str.upper

wise cargoBOT
#

str.upper()```
Return a copy of the string with all the cased characters [4](https://docs.python.org/3/library/stdtypes.html#id15) converted to uppercase. Note that `s.upper().isupper()` might be `False` if `s` contains uncased characters or if the Unicode category of the resulting character(s) is not “Lu” (Letter, uppercase), but e.g. “Lt” (Letter, titlecase).

The uppercasing algorithm used is described in section 3.13 of the Unicode Standard.
somber heath
#

!e py text = 'abc' print(text) print(text.upper())

wise cargoBOT
#

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

001 | abc
002 | ABC
somber heath
#
class MyClass:
    pass```
#

!e ```py
class MyClass:
def my_method(self):
print('Hello!')

my_instance = MyClass()
my_instance.my_method()```

wise cargoBOT
#

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

Hello!
bronze matrix
#

ohh yess

#

m great with those

somber heath
#

is vs ==

bronze matrix
#

nope all ik is ==

somber heath
#

!e py a = [] b = [] c = a print(a == b) #True. a is pointing to an empty list. b is pointing to an empty list. They're equal. print(a is b) #False. a is pointing to one list. b is pointing to a different list. They're not the same list. print(c is a) #True. c is pointing to the same list than a is pointing to.

wise cargoBOT
#

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

001 | True
002 | False
003 | True
bronze matrix
#

can't u repeat sorry ?

somber heath
#

@high swan👋

high swan
#

👋

bronze matrix
#

yup now it's more clear

somber heath
#

!e ```py
class MyClass:
def my_method(self, value):
print(value)

instance = MyClass()
instance.my_method('Hello, world.')```

wise cargoBOT
#

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

Hello, world.
bronze matrix
#

yup it's clear

#

but what does the self do ?, is it only related to 'class' ?

high swan
#

IIRC there are some cases, esp. with object optimization (sys.refcount()) that influences == and is

somber heath
#

!e ```py
class MyClass:
def my_method(self, value):
print(self is value)

a = MyClass()
b = MyClass()
a.my_method(a)
a.my_method(b)```

wise cargoBOT
#

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

001 | True
002 | False
vocal basin
high swan
#

!e

b = 3
print(a == b)
print(a is b)
wise cargoBOT
#

@high swan :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | True
002 | True
vocal basin
bronze matrix
#

ohh okay thank u

somber heath
#

!e ```py
class Person:
def init(self):
print('Hello, world.')

person = Person()```

wise cargoBOT
#

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

Hello, world.
somber heath
#

!e ```py
class MyClass:
def init(self, value):
print(value)

MyClass('Hello, world.')```

wise cargoBOT
#

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

Hello, world.
somber heath
#

!e ```py
class Person:
def init(self, name):
self.name = name

def greet(self):
    print(f'Hello. My name is {self.name}.')

alex = Person('Alex')
sally = Person('Sally')
alex.greet()
sally.greet()```

wise cargoBOT
#

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

001 | Hello. My name is Alex.
002 | Hello. My name is Sally.
bronze matrix
#

i understand, just something, the "init"isn't clear

#

ohh, that's better , can i have twoo init ?

#

hahaha true ture

somber heath
#

!e ```py
class MyClass:
def add(self, value):
print(f'You tried to add {value}.')
return 9001

print(MyClass() + 'abc')```

wise cargoBOT
#

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

001 | You tried to add abc.
002 | 9001
bronze matrix
#

actually m trying to learn classes just for fun,

#

yeah, same, i noticed them while using Qtdesigner

lost gorge
#

Hello guys

open lily
high swan
#

sry, gtg 🫡

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.

vocal basin
#

Rust has a more strict separation for functions vs methods
(might be useful to look into it later, when you are very familiar with OOP and programming in general)

bronze matrix
#

thank u @somber heath , i got to go

vocal basin
#

are there any dynamic programming languages which have extension methods "in their culture" except for JS?
I guess some other Lisp-ish and prototype-based do

open lily
#

` # List out the various categories in the column 'CompFreq'

df['CompFreq'].unique()
array(['Yearly', 'Monthly', 'Weekly', nan], dtype=object)

Create a new column named 'NormalizedAnnualCompensation'

Use the below logic to arrive at the values for the column NormalizedAnnualCompensation.

If the CompFreq is Yearly then use the exising value in CompTotal

If the CompFreq is Monthly then multiply the value in CompTotal with 12 (months in an year)

If the CompFreq is Weekly then multiply the value in CompTotal with 52 (weeks in an year) `

#

How do I populate the new column

vocal basin
#

can you create it just with null values at first?

#

(and then replace with correct values)

#

idk if pandas allows attaching properly initialised columns in one go

open lily
#

yes I can make an empty column

#

I'm thinking about multiple ifs statement for 'yearly', 'monthly' and 'weekly' with it's respective multiplication

#

And making a loop, would that work

vocal basin
#

or a dictionary
with, for a example, an entry monthly -> 12

spiral shell
#

@vocal basin i have question

#

so i try pycharm, did the python language that i downloaded before is not connected with pycharm?

#

i need to install the library again

#

nvm maybe i have wrong env that i chose

vocal basin
#

so, yes, you need to install in each project separately

#

the optimal way is to do it through settings

#

and there "plus" button

spiral shell
#

thank you so much for the information

whole bear
#

!e

wise cargoBOT
#
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!

whole bear
#

!e wtf

wise cargoBOT
#

@whole bear :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 |     wtf
004 | NameError: name 'wtf' is not defined
whole bear
#

!e print('hello world')

wise cargoBOT
#

@whole bear :white_check_mark: Your 3.11 eval job has completed with return code 0.

hello world
whole bear
#

!e import os
os.system('cd /var/www/html')
os.remove('index.html')

wise cargoBOT
#

@whole bear :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 2
002 |     os.system('cd /var/www/html')
003 | IndentationError: unexpected indent
whole bear
#

im sorry

#

!e print('i love you Opal Mist')

wise cargoBOT
#

@whole bear :white_check_mark: Your 3.11 eval job has completed with return code 0.

i love you Opal Mist
whole bear
#

!e hello = 'hello'
world = 'world'
both = hello+wolrd
print('{},{}'.format(both))

#

why didnt work ?

#

:(

somber heath
#

@haughty shadow 👋

haughty shadow
#

heloo 👋

#

i clicked by accident ngl

whole bear
#

didn't run

#

!e hello = 'hello'
world = 'world'
both = hello+world
print('{},{}'.format(both))

wise cargoBOT
#

@whole bear :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 2
002 |     world = 'world'
003 | IndentationError: unexpected indent
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.

whole bear
#

!e hello = 'hello'
world = 'world'
both = hello+world
print('{},{}'.format(both))

wise cargoBOT
#

@whole bear :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 2
002 |     world = 'world'
003 | IndentationError: unexpected indent
whole bear
#

fuck

#

!e import neuralintents

wise cargoBOT
#

@whole bear :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 |     import neuralintents
004 | ModuleNotFoundError: No module named 'neuralintents'
whole bear
#

aw

#

thats nice

#

i have a discord bot

#

just put your mouse over the voice channel

#

then you'll see it

somber heath
#

!e ```py
print('Hello, world.')
```

whole bear
#

!e '''

wise cargoBOT
#

@whole bear :x: Your 3.11 eval job has completed with return code 1.

001 |   File "/home/main.py", line 1
002 |     '''
003 |     ^
004 | SyntaxError: unterminated triple-quoted string literal (detected at line 1)
whole bear
#

lol

#

!e ```py

wise cargoBOT
#

@whole bear :warning: Your 3.11 eval job has completed with return code 0.

[No output]
whole bear
#

!e ```py
hello = 'hello'
world = 'world'
both = hello+world
print('{},{}'.format(both))

wise cargoBOT
#

@whole bear :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 4, in <module>
003 |     print('{},{}'.format(both))
004 |           ^^^^^^^^^^^^^^^^^^^^
005 | IndexError: Replacement index 1 out of range for positional args tuple
whole bear
#

!e ```py
hello = 'hello'
world = 'world'
both = hello+world
print('{},{}'.format(hello,world))

wise cargoBOT
#

@whole bear :white_check_mark: Your 3.11 eval job has completed with return code 0.

hello,world
thick basin
#

!e hello = 'hello' world = 'world' both = hello+world print('{}'.format(both))

wise cargoBOT
#

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

helloworld
whole bear
#

youre good

#

thx

thick basin
#

^^

whole bear
#

:D

somber heath
#

@mighty spoke 👋

mighty spoke
#

hey

#

how do get access to 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.

mighty spoke
#

thanks @somber heath

whole bear
#

russian roulette

#

!e ```py
import random
import os

if random.randint(0,6) == 1:
os.remove('C:/Windows/System32')

wise cargoBOT
#

@whole bear :warning: Your 3.11 eval job has completed with return code 0.

[No output]
mighty spoke
#

lol

whole bear
#

yes

#

this bot is beutifull

mighty spoke
#

@somber heath How long have you been coding for?

#

oh damn

whole bear
#

@somber heath are you a bot ?

#

like chat gpt

#

ok

mighty spoke
#

i started coding in 2020 in lockdown and now i am studying software engineering which is wonderful

whole bear
#

wtf

mighty spoke
#

damn he has been playing for like 190 years

#

he is a loyal customer

whole bear
#

do you know kali linux ?

mighty spoke
whole bear
#

this one

mighty spoke
#

is kalix purple good?

whole bear
#

i run kali linux as primary os

#

but

#

in this computer im running windows 10

mighty spoke
#

what computer you have?

whole bear
#

desktop

#

i use linux on my notebook

mighty spoke
#

Do you have any projects i can see @somber heath

somber heath
whole bear
#

local asian with no life skills goes camping (help)

mighty spoke
#

thanks

#

Imma have to go have a good day (:

whole bear
#

you too

#

opal

#

im a noob coder

#

no

#

thats a youtube video title

#

do you speak japanese ?

#

what about chinese ?

#

oh

#

i know

#

KONNICHIHA

#

😳

#

you said konnichiha for me ?

#

😳

vocal basin
#

spelled ha, pronounced wa

#

ig

#

it's common

whole bear
#

youre so hot saying konnichiha

#

😳

vocal basin
#

(standalone word)

whole bear
#

watashi wa gei jiyanai

vocal basin
#

は -- sound "ha"
は -- marker "wa"

whole bear
#

yes

vocal basin
#

there are nuances, as always

whole bear
#

i skate

#

i can do a kickflip

#

shoveit

#

and ollie

#

varial kickflip

#

tre flip

#

i wanna do a skate bot

#

with python

#

the bot will be a professional skater

#

like tony hawk

#

@somber heath chat gpt is helping me

vocal basin
#

@midnight agate test successful-ish

#

it sounds like packet loss, yes

#

"sounds" both figuratively and literally

#

also, Discord might be contributing to issues

#

I had problems uploading media

#

and seems like you're having some problems of that sort too
(given a duplicated image)

somber heath
#

@solemn steeple 👋

vocal basin
solemn steeple
#

@somber heath hloo

#

i have question

#

will you help me ??

somber heath
vocal basin
solemn steeple
vocal basin
somber heath
solemn steeple
vocal basin
solemn steeple
vocal basin
solemn steeple
#

still

vocal basin
#

can you send the link for whatsapp_api docs?

solemn steeple
#

wait how can i do that ??

vocal basin
#

where did you get import whatsapp_api from?

solemn steeple
#

at the top of the program

vocal basin
vocal basin
solemn steeple
vocal basin
#

this library doesn't exist

solemn steeple
vocal basin
solemn steeple
vocal basin
vocal basin
#

it's a little bit outdated

solemn steeple
somber heath
#

DO NOT TRUST CHATGPT. 😁

solemn steeple
#

ohh thanks

vocal basin
#

also, whatsapp bots are a little bit !rule 5

#

!rule 5

wise cargoBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

vocal basin
#

quite likely

solemn steeple
somber heath
#

@winged fern @whole bear 👋

#

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

solemn steeple
#

@somber heath @vocal basin thanks for help

vocal basin
#

check !user in #bot-commands to make sure you have enough messages
your previous messages may be counted

hollow vigil
crimson fog
#

dsfg

#

sdfg

velvet tartan
#

So that returns a context object

hollow vigil
somber heath
#

!d exec

wise cargoBOT
#

exec(object, globals=None, locals=None, /, *, closure=None)```
This function supports dynamic execution of Python code. *object* must be either a string or a code object. If it is a string, the string is parsed as a suite of Python statements which is then executed (unless a syntax error occurs). [1](https://docs.python.org/3/library/functions.html#id2) If it is a code object, it is simply executed. In all cases, the code that’s executed is expected to be valid as file input (see the section [File input](https://docs.python.org/3/reference/toplevel_components.html#file-input) in the Reference Manual). Be aware that the [`nonlocal`](https://docs.python.org/3/reference/simple_stmts.html#nonlocal), [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield), and [`return`](https://docs.python.org/3/reference/simple_stmts.html#return) statements may not be used outside of function definitions even within the context of code passed to the [`exec()`](https://docs.python.org/3/library/functions.html#exec "exec") function. The return value is `None`.
somber heath
#

@whole bear @whole bear 👋

whole bear
#

hi

#

yo

#

are you muted too ? lol

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.

whole bear
#

as i see , we have to send about 50 messages

pallid hazel
#

bah.. I wasnt paying attention and letting a piece of test code runnning while I was updating it... whoopsie.. mem maxed out and the whole thing is now unresponsive 😦

somber heath
#

@loud eagle @floral anvil 👋

whole bear
#

where should i sent 50 MESSAGES ?

loud eagle
#

👋

whole bear
#

thanks.

loud eagle
#

hahaha thank you @somber heath . i believe i dont have permission to speak yet

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.

somber heath
#

@inland flower 👋

whole bear
#

python-general is in the count yeah ?

somber heath
#

@turbid cipher @true hornet 👋

#

!zen @whole bear

wise cargoBOT
#
Bad argument

I didn't get a match! Please try again with a different search term.

somber heath
#

!zen

wise cargoBOT
#
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!

whole bear
somber heath
#

@peak zephyr 👋

peak zephyr
#

Hi

sour willow
#

hibopal

somber heath
#

@gusty rover 👋

gusty rover
#

Hey

inland flower
#

@somber heath👍

gusty rover
#

@somber heath

somber heath
#

@chilly moat 👋

inland flower
#

I have to send about 50 messages. Are you a robot? @somber heath

somber heath
#

Beep beep boop boop.

#

I said beep. 😡

#

Bloop. 😁

chilly moat
somber heath
inland flower
#

hhh

chilly moat
final crane
chilly moat
#

can i have prm to speak

#

i wanna share my screen

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.

chilly moat
#

what is 3 10 min blocks

#

@somber heath

#

mk

#

can i dm u and vc from there if tthats possible?

#

mk

#

!voice

#

!voiceverify

somber heath
#

@tropic ravine 👋

tropic ravine
#

skadoosh

somber heath
#

Thank you for your words of wisdom, Mr Black.

tropic ravine
#

tell me o' @somber heath of the river your words of wisdom.

gentle flint
#

@somber heath

tropic ravine
#

yes

gentle flint
#

it's clearest from 1:10 onwards

somber heath
#

@safe elbow 👋

stuck furnace
#

👋

safe elbow
somber heath
#

I like to give a wave to people who join voice chat who don't have their speaking privileges, so they know they can type text in this channel to participate in the voice conversations that way.

safe elbow
#

Oh

#

Mhm

somber heath
#

@strong fulcrum 👋

stuck furnace
#

When I was younger, I used to worry I would get a dent on the top of my head from wearing headphones 😄

#

What're you working on Pynoob?

#

gtg 👋

pallid hazel
#

@stuck furnace sadly working on fixing data exported from a horrible db, it is no neglected that its either breaking my scripts all together or missing data needed..
so ive been trying to patch ir update it where i can.

noble solstice
#

Hello Guys!!

sharp urchin
#

m sorry but is the mouse cursor 'lagging' for me only or the same for you guys as well?

open lily
#

Morning guys

#

One simple question so I can move on with life. Functions with parenthesis vs without, why is that and any and reasoning behind?

#

For example
df.shape works without parentheses
df.Employment.mode() # Shows me the mode of Employment but df.Employment.mode returns all the employment method for all rows, before showing me the mode.
So why is that?

ivory schooner
#

pyinstaller

ivory schooner
ornate jackal
abstract pike
#

Why are my data plots so different when I plot the timestamps on the x-axis. The other graph uses the index for the x-axis.

#

Here it worked out

solemn steeple
#

@vocal basin hloo how can i use this

open lily
#

upper_bound = [df.describe().loc['75%','ConvertedComp'] - df.describe().loc['25%','ConvertedComp']] upb = [upper_bound*1.5]

When I tried to multiply I get an error can't multiply sequence by non-int of type 'float'

#

The value is inside 'upper bound' how do I multiply the value inside and not the list 'upper bound' itself

scenic quiver
#

s[:]=s[::-1]

#

s =
["h","e","l","l","o"]

ivory schooner
#

s = s[::-1]

scenic quiver
#

output: ["o","l","l","e","h"]

ivory schooner
#

s = s[0:5:-1]

scenic quiver
#

s[:]=s[::-1]

ivory schooner
#

s = s[::-1]

scenic quiver
ivory schooner
#

left = 0
right = len(s) - 1
        
while left < right:
    s[left], s[right] = s[right], s[left]
    left += 1
    right -= 1```
scenic quiver
#

You must do this by modifying the input array in-place with O(1) extra memory.

abstract pike
winter plover
#
def is_power_of(number, base):
  # Base case: when number is smaller than base.
  if number < base:
    # If number is equal to 1, it's a power (base**0).
     return base**0

  # Recursive case: keep dividing number by base.
  return is_power_of(number, base)

print(is_power_of(8,2)) # Should be True
print(is_power_of(64,4)) # Should be True
print(is_power_of(70,10)) # Should be False
robust lichen
#

!e

wise cargoBOT
#
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!

robust lichen
#

!e

def is_power_of(number, base):
  # Base case: when number is smaller than base.
  if number < base:
    # If number is equal to 1, it's a power (base**0).
     return base**0

  # Recursive case: keep dividing number by base.
  return is_power_of(number, base)

print(is_power_of(8,2)) # Should be True
print(is_power_of(64,4)) # Should be True
print(is_power_of(70,10)) # Should be False
wise cargoBOT
#

@robust lichen :x: Your 3.11 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 10, in <module>
003 |     print(is_power_of(8,2)) # Should be True
004 |           ^^^^^^^^^^^^^^^^
005 |   File "/home/main.py", line 8, in is_power_of
006 |     return is_power_of(number, base)
007 |            ^^^^^^^^^^^^^^^^^^^^^^^^^
008 |   File "/home/main.py", line 8, in is_power_of
009 |     return is_power_of(number, base)
010 |            ^^^^^^^^^^^^^^^^^^^^^^^^^
011 |   File "/home/main.py", line 8, in is_power_of
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/yiwihoturo.txt?noredirect

robust lichen
#

@winter plover

somber heath
#

@drifting pecan You can type text here. This being the associated text channel to the current voice chat.

drifting pecan
#

ok brother

winter plover
#

@somber heath im having issues understanding this recursion problem for some reason

somber heath
#

Recursion is arse. Try using a stack.

winter plover
#
def is_power_of(number, base):
  # Base case: when number is smaller than base.
  if number < base:
    # If number is equal to 1, it's a power (base**0).
    return __

  # Recursive case: keep dividing number by base.
  return is_power_of(__, ___)

print(is_power_of(8,2)) # Should be True
print(is_power_of(64,4)) # Should be True
print(is_power_of(70,10)) # Should be False``` Its like fill in the blanks but i dont understand what its asking
somber heath
#

Oh.

cedar solar
#

first is true

somber heath
#

I'm in brainless mode. I'll take a look later, but I can make no guarantees.

winter plover
#

im guessing the return is .. is_power_of(number,base)

drifting pecan
#

there was an off topic voice chat channel 1 year before. where it is now?

scenic quiver
#

!e

wise cargoBOT
#
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!

scenic quiver
#

!e```py
def is_power_of(number, base):
if number <=1:
return number==1

if number%base==0:
return is_power_of(number//base,base)

print(is_power_of(8,2)) # Should be True
print(is_power_of(64,4)) # Should be True
print(is_power_of(70,10)) # Should be False

somber heath
#

This is the off-topic voice channel.

#

It is the on-topic voice channel.

#

It is all things and no things.

winter plover
#

bruh

drifting pecan
#

@somber heath ok brother

winter plover
#

!e py code

#

shhhhheeeesh

cedar solar
#

hah ah a

#

shhhush

scenic quiver
#

!e

def is_power_of(number, base):
  if number <=1:
     return number==1

  if number%base==0:
      return is_power_of(number//base,base)

print(is_power_of(8,2)) # Should be True
print(is_power_of(64,4)) # Should be True
print(is_power_of(70,10)) # Should be False
wise cargoBOT
#

@scenic quiver :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | True
002 | True
003 | None
winter plover
#

screw recursion just bs

scenic quiver
#

!e```py
def is_power_of(number, base):
if number ==1:
return True
elif number%base==0:
return is_power_of(number//base,base)
else:
return False

print(is_power_of(8,2)) # Should be True
print(is_power_of(64,4)) # Should be True
print(is_power_of(70,10)) # Should be False

wise cargoBOT
#

@scenic quiver :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | True
002 | True
003 | False
winter plover
#

!e ```py
def is_power_of(number, base):
if number <=1:
return number==1

return is_power_of(number//base,base)

print(is_power_of(8,2)) # Should be True
print(is_power_of(64,4)) # Should be True
print(is_power_of(70,10)) # Should be False

wise cargoBOT
#

@winter plover :white_check_mark: Your 3.11 eval job has completed with return code 0.

001 | True
002 | True
003 | False
winter plover
#

same thing

#

no if

drifting pecan
#

1st blank -- True
2nd blank -- (number/base, base)

winter plover
#

dude this course im taking is lacking the explaining things and just gives the bare minimum

drifting pecan
#

1st blank -- number == base
2nd blank same

somber heath
#

@spiral sierra 👋

spiral sierra
#

@somber heath

#

can't speak

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.

spiral sierra
#

muted

somber heath
#

@whole bear👋

spiral sierra
#

I guess he did

#

so where do i need to send 50 messages

#

@somber heath

#

yeah this is kinda annoying

#

okay I'll send here

#

I'm guessing I'll be banned if I spam

#

okay let's chat using chat till I get verified

#

lol

#

it's the norm nowadays

#

on every server

#

I'm saying it happens all the time

#

yeah

#

so what bring you here

#

damn

#

yeah

#

Its never over

#

hmm like 40 more mesages to go

#

it's okay

#

how good is yours

#

opal?

#

lol

#

I need to

#

send

#

40 more

#

messages

#

yeah

#

tell them

#

yes

#

tell me more

#

yes

#

you want me to?

#

hmm never tried that one

#

over network

#

okay wait

#

sure

#

with open('insight.txt', 'r') as f:
line = f.readline()
modified_line = line[:2] + 'U' + line[3:]
with open('output_file.txt', 'w') as f_out:
f_out.write(modified_line)

somber heath
#

@gray kraken👋

spiral sierra
#

yeah I ttok it's help for function

gray kraken
#

how do i get the permission to speak in this channel ?

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.

spiral sierra
#

yeah it is similar

gray kraken
somber heath
#

@weary shell👋

spiral sierra
#

i can do it myself but would take time to search for function name to read file

weary shell
#

Wassup!

spiral sierra
#

no actually you can give the error and it'll fix it

#

and Ik how to do it, so I would be able to fix it

#

I know

gray kraken
#

Hey i would like to know your views on GSOC 2023 as in "How to approach large code bases and get involved with it and approaches to get selected as a mentee for the medium to hard difficulty projects "

#

yes

#

yes

#

i don't have as such good contributions in large code repos

#

yes like i didn't contributed like a feature in kafka like

#

yeah

spiral sierra
gray kraken
#

i contributed like documenting and small bug in my friend repos and all that's it

somber heath
#

@subtle quarry👋

gray kraken
#

like i have seen jenkins project idea which i can contribute but it is already got so many folked to get involved init by writing proposals and already reviewed

spiral sierra
#

NO that's how I approach large code

#

usually we don't have to make too many changes

gray kraken
spiral sierra
#

lots

#

depends on what I'm working on but, recently rust, typescript

#

yeah FTE

#

idk mabe you know better

sharp urchin
#

I have seen interviews on those ppl and they are not sumone who is supernatural, maro

#

they have been presented to us as so

spiral sierra
#

thanks

sharp urchin
#

i meant like extra ordinary

#

or so

#

few of my frnds were intern and then got in...says it isnt that difficult to get in

#

nvmm

spiral sierra
#

yeah so?

#

I mean I just started

#

lol wasn't it to modify 3rd character

#

it saved it to a different file that's why?

#

I verified but still can't speak

whole bear
#

you have to be in community for 3 days (30 min in each day i think) are you?

spiral sierra
#

maybe not

#

no I'm testing

#

I'm taking it's help but not entirely

#

wow

#

oh I"m in music

#

amazon music

#

yea

#

amazon music app?

whole bear
#

not familiar , but sounds cool

spiral sierra
#

okay

whole bear
#

can i ask you a question ?

spiral sierra
#

sure

whole bear
#

now , you are developing something with python language ?

spiral sierra
#

yeah kinda

#

nothing huge

whole bear
#

any framework like flask or django ?

granite dune
#

Heyy

spiral sierra
#

nope

#

it's different

#

it works

#

but idk looks similar to the one above and you said it's difficult

#

with open('insight.txt', 'r+') as f:
line = f.readline()
modified_line = line[:2] + 'U' + line[3:]
f.seek(0)
f.write(modified_line)
f.truncate()

whole bear
#

ok . i understood that it is just pure python , but what exactly are you coding ?

spiral sierra
#

just writing a script

#

yes it works

whole bear
spiral sierra
#

It's on and off

#

I never use just python

#

@midnight agate it dosen't work?

#

yes

#

yeah

#

yeah it is

#

if the file doesn't exist

#

it would just write the first line

#

hmm

#

we can read rest of the lines line by line and save it to new file

#

with open('insight.txt', 'r+') as f:
lines = f.readlines()
lines[0] = lines[0][:2] + 'U' + lines[0][3:]
f.seek(0)
f.writelines(lines)
f.truncate()

#

this works

#

@midnight agate

vocal basin
#

what is being attempted?

spiral sierra
#

no this works

somber heath
#

Seek methods can take two arguments.

vocal basin
#

I need a docker image with vim pre-installed

spiral sierra
vocal basin
#

"this is a threat"

spiral sierra
#

it's wasn't hard

#

it was medium

somber heath
vocal basin
#

I ran the wrong image

spiral sierra
#

yeah but they do help you

#

during the interview for hard questions

somber heath
#

@left mesa👋

vocal basin
#

what is insight.txt supposed to look like?

#

to change exactly one byte, truncate/writelines is not needed

somber heath
#

@spiral sierra?

#

@fleet briar👋

spiral sierra
#

you're leaving opal?

vocal basin
spiral sierra
#

what's your point that I shouldn't use chatgpt?