#code-help-voice-text

5 messages · Page 7 of 1

weak marten
#

does anyone have time to help me with my code?

main solar
#

hello

severe plank
#

How long does it take for people to get assistance usually? Im new

sage lynx
#

key in dictionary should work

wind goblet
#

!http.cat 450

#

.http.cat 450

lime sedge
#

There’s a good chance you accidentally replaced your dictionary variable’s value with a function object. Something like dictionary = function where you forgot to actually call the function with brackets ()?

radiant flower
#

Hi,

I hope everyone is okay.

I am doing a research project for my Bachelor of IT (honours) on Machine Learning for Cloud Security.
This research paper discusses the Fraudulent Resource Consumption (FRC) Attack and uses Support Vector Machines (SVM) to detect cloud-based FRC attacks. Fraudulent Resource Consumption (FRC) attacks are created by slowly using cloud services' metered resources. The attacker's goal is to abuse the utility pricing model by stealing cloud resources. This skilful resource overuse results in a significant cost burden for the client. These assaults employ low-intensity HTTP requests per hour, like legitimate users. Due to this, FRC attacks are difficult to detect. FRC is an Economic Denial of Service (EDoS) attack that targets cloud adopters' financial resources by increasing their costs. Unlike DDoS assaults, which can temporarily block legitimate users from accessing services, EDoS attacks can significantly increase cloud users' costs. Support-vector machines (SVMs, also known as support-vector networks) are supervised learning models that examine data for classification and regression analysis.

Now I want guidance for a script that Can capture this generated FRC traffic, run SVM on it for training and then run SVM on it for testing. Training can be one script, and testing can be another script.
Secondly, is it possible to use AWS or Microsoft Azure to perform these testings

I shall be highly grateful if you could kindly guide me in this.
Thanks & regards,
Osama Faheem

ember wadi
#

Hi everyone,

I was wondering if anyone would be available to guide with a problem i am experiencing through RSA and socket

#

I think it needs live debugging as i've looked everywhere and can't find the issue

night umbra
#

anyone got 5 min to help me with something small

low plinth
#

how to i import beautiful soup 4?

#

im having trouble

plain jackal
#

hello

summer radish
#

Hey

#

Does anyone know which function use to choose a random number of -10 to 10

sonic spire
#

!voiceverify

broken rune
#

howdy

dull tartan
#

@broken rune

broken rune
#

are you here to help

#

im working on a coding lab thing

#

basically

#

you are opening a .txt file and extracting data from it

#

can you call by any chance?

#

it's tedious to explain

#

it's all good, im working with someone in the help channel and id prefer not to type everything twice

#

if you can voice call that'd be awesome though sobshi

#

i just want to talk and show my code

#

man

wet cosmos
broken rune
#

OH LMAO

#

it was just a figure of speech

#

and it also just so happens to be your name

wet cosmos
broken rune
#

i wish i could speak

#

I HAVE TO WAIT 3 DAYS

#

OMG

dull tartan
#

yeah, I mean it's pretty reasonable tbh

sour ocean
#

lol

violet echo
#

I need help in a python question

#

can anyone help?

#

You are given an integer n . you want to construct an array a such that the following conditions hold:

  1. a[1]=n
  2. no two adjacent elements should be equal
  3. For all i ( 1<= i < |A|) , such that A[i] is divisible by A[i+1]

Find the maximum possible length of the array A for the given integer n

Input Format
The first line contains an integer n denoting the given integer n

Constraints
1 <= n <= 10^6

zealous surge
#

i cant talk

empty yarrow
#

Hello everyone
I need some help
so i have this code as I am trying to understand classes
...............
class Person:
def init(self, name, age):
self.name = name
self.age = age
def isOld(self) :
if self.age >= 60 :
return True
else :
return False

p1 = Person("John", 36)

print(p1.name)
print(p1.age)
print(p1.isOld)
. ..........................
yet for some reason p1.isOld is giving me a really weird output
which is "<bound method Person.isOld of <main.Person object at 0x000001107DB79630>>"

can some tell me what's going on and what to do to fix it please?
I am a beginner in python so I don' understand it and internet couldn't help

oak lava
empty yarrow
#

Thx

summer radish
#

Heyy

#

Could anyone help me here

#

I'm trying to plot N particles in random position and assign each particle a speed that is given by some formulas

#

So my problem is soem of the particles seem as if they don't have a velocity

#

I guess the line of yvel inside the function intial_vel is the problem

#

Sorry the first picture is wrong it should be this one

patent otter
#

Can anyone help me with openpyxl

#

need to know how to insert a column, have a base idea but not working

abstract flume
#

import openpyxl
wb = openpyxl.load_workbook(filename)
sheet = wb.worksheets[0]
sheet.insert_cols(2)
wb.save("filename.xlsx")

abstract flume
summer radish
#

Hey does anyone know a similar function to append but for array?

keen garden
#

Could anyone help me with wrapping my head around as to how I would implement Dijkstra in my current project?

patent otter
cunning ember
#

Any body can help with a task involving an algorithm and turning it into a python code

honest violet
#

Where can I make 50 messages easily without disturbing anyone so I can join voice chat?

grave token
#

@celest herald you need help?

sly merlin
#

its really your wish

warm siren
#

yeah

#

trying to artificially increase your message count will result in a voice mute

#

you will not be able to voice verify if you have an active voice mute infraction

celest herald
grave token
#

haha

faint hinge
#

!stream 709014698221371404

keen onyxBOT
#

✅ @full sail can now stream until <t:1647021292:f>.

faint hinge
#

!stream 709014698221371404 10M

keen onyxBOT
#

✅ @full sail can now stream until <t:1647021952:f>.

fringe flax
#

!eval print([].index(7))

keen onyxBOT
#

@fringe flax :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | ValueError: 7 is not in list
faint hinge
#
if 0 in nums and 7 in nums:
#
if nums.count(0) >= 2 and 7 in nums:
fringe flax
#

Every day

#

I open Google before I open my code

fringe flax
full sail
faint hinge
#

I missed what was said

full sail
untold lion
#

player_guesses[] =

#

int(input('Enter geiohgioheoahgoi:')

faint hinge
#

player_guesses[] =

#

player_guesses = []

crude condor
#

Hii

#

Please help

#

I am in vc

full sail
crude condor
#

@sly merlin i mean I will have to share screen how can I do?

spice echo
#
import random

correct_number = random.randint(1,100)
guess_count = 0
while True:
    player_guess = int(input("Guess the number: "))
    if player_guess < 1 or player_guess > 100:
        print("OUT OF BOUNDS")
        continue
    if guess_count == 0:
        if player_guess <= (correct_number + 10) and player_guess >= (correct_number - 10):
            print("WARM!")
        else:
            print("COLD!")
    if guess_count > 0:
        if (player_guess > last_guess and player_guess < correct_number) or (player_guess < last_guess and player_guess > correct_number):
            print("WARMER!")
        else:
            print("COLDER!")    
    guess_count += 1
    if player_guess == correct_number:
        if guess_count == 1:
            print("You have guessed correctly. It took you " + str(guess_count) + " guess")
        else:
            print("You have guessed correctly. It took you " + str(guess_count) + " guesses")
        break  
    last_guess = player_guess
full sail
#

are ya'll in college

slender swallow
#

I have a large project that I am developing, but I don't have enough experience to make a convenient architecture (location of files/modules). Tell me what to do

obtuse lantern
#

wow

#

When did the verification thing turned up

#

im pretty sure i was talking here a while ago

warm siren
#

August 2020

sinful cradle
#

I'm working on a school project and there's this one quiz program that doesn't give error but keeps giving me wrong results. I need help .. is there anyone available to help me check what's wrong?

fading thicket
#

!stream @cursive totem

keen onyxBOT
#

✅ @cursive totem can now stream until <t:1647099309:f>.

fading thicket
#

!pate

keen onyxBOT
#
Did you mean ...

» pathlib
» relative-path
» windows-path

fading thicket
#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

cursive totem
#
if __name__ == "__main__":
    ws = websocket.WebSocket()
    try:
        connect()
    except Exception as err:
        print(err)
        print("Connect failed")


@tenacity.retry(wait=tenacity.wait_fixed(3))
def connect():
    try:
        ws.connect('wss://gateway.discord.gg/?v=6&encoding=json')
        event = receive_json_request(ws)

        heartbeat_interval = event['d']['heartbeat_interval'] / 1000
        p1=mp.Process(target=heartbeat, args=(heartbeat_interval, ws))
        p1.start()

        send_json_request(ws, payload)
        mainLoop()

    except Exception as err:
        print(err)
        print("Connect failed")

def heartbeat(interval, ws):
    print('Attesa')
    while True:
        time.sleep(interval)
        heartbeatJSON={
            "op":1,
            "d": event
        }
        try:
            send_json_request(ws, heartbeatJSON)
            print("Sent json request")
        except Exception:
            print(traceback.format_exc())
            connect()
fading thicket
#
@tenacity.retry(wait=tenacity.wait_fixed(3))
def connect():
    try:
        ws.connect('wss://gateway.discord.gg/?v=6&encoding=json')
        event = receive_json_request(ws)

        heartbeat_interval = event['d']['heartbeat_interval'] / 1000
        hb_thread = threading.Thread(target=heartbeat, args=(heartbeat_interval, ws))
        hb_thread.start()

        send_json_request(ws, payload)
        mainLoop()

    except Exception as err:
        print(err)
        print("Connect failed")
        print("Joining Heartbeat thread")
        hb_thread.join(timeout=1)
#
def heartbeat(interval, ws):
    print('Attesa')
    while True:
        time.sleep(interval)
        heartbeatJSON = {
            "op": 1,
            "d": event
        }

        try:
            send_json_request(ws, heartbeatJSON)
            print("Sent json request")
        except Exception:
            print(traceback.format_exc())
fading thicket
#
import string
import time
from threading import Event, Thread


def start():
    finisher = Event()
    task = Thread(target=repeating_task, args=(finisher,))

    task.start()
    try:
        main()
    except EOFError:
        finisher.set()
        task.join(0.5)


def main():
    chars = string.ascii_letters
    for char in chars:
        print(char, end="")
        time.sleep(0.05)
    raise EOFError("Finished")


def repeating_task(finish_event: Event):
    i = 0
    while not finish_event.is_set():
        time.sleep(0.1)
        i += 1
        print(i, end="")


start()
frank hollow
#

@stable apex do you have a discord api tut that works at a lower level with websockets

stable apex
frank hollow
#

alright, cheers

solid willow
#

hi, how do i switch from anaconda to pip? i'm currently trying to use the pip command to install pd and df packages

chrome hawk
#

anyone know how to split an image into 100 vertical sections

still kernel
#

It

indigo yew
#

you can use python's Pillow, or straight up use numpy array

#

in which case splitting up a image across a dimension would be equivalent to splitting up a table

indigo yew
#

remember through, it is possible that a package may not be available at both pypi and conda-forge, ( some authors prefer conda-forge)

chrome hawk
#

does this have voice ?

#

https://stackoverflow.com/questions/5953373/how-to-split-image-into-multiple-pieces-in-python i found this link which has multiple ways of splitting image. not sure which would work for me - can you suggest one code to try. i want to split image into 100 vertical sections and save each section

zenith cipher
#

hello! If i wanted to just delete that in the picture, what would I have to change all the w to? I tried to change all the w to "Canvas(Radda_gubbe,width=1000,height=1000)" but then it just said error.. any help pls. Python tkinter

grave token
#

here screen share is restricted...

#

let's go to math

#

@pearl dove or rust server

pearl dove
#

1 second

#

@grave token

grave token
#

okay..

ivory arch
#
# import libraries
import random
from decimal import *

# constants
WIDTH = 5000
HEIGHT = 5000
RADIUS = 5000

# vars
square = 0
circle = 0

for _ in range(2000000):
    # choose point
    x = random.randint(0, WIDTH)
    y = random.randint(0, HEIGHT)

    # check if point is in circle
    x -= WIDTH
    y -= HEIGHT

    dist = x ** 2 + y ** 2
    if dist < RADIUS ** 2:
        circle += 1
    square += 1

# calculate pi
pi = 4 * Decimal(circle / square)
print(pi)
grave token
#

@ivory arch what's the problem?

ivory arch
#

i'd like it to have a few more decimals

grave token
#

@ivory arch why don't use canvas size 1.0

#

random real number...

#

get random floating point number

#

yeah..

#

It's seems like it should be independent of canvas size... That's what I'm saying...

#

okay... if you work with pixels you should use int

#

how many you want...

#

there are faster way to get pi... if you can use other methods...

#

geometry 🙃

#

no, I'm saying you are using geometric way...

#

@ivory arch

#

You are doing similar to this...

#

first half of that...

#

see what newton did

#

what?

#

Just watch whole thing.. it's fun

ivory arch
grave token
#

https://youtu.be/HEfHFsfGXjs
This would be a fun way to get pi 🙃

Solution: https://youtu.be/jsYwFizhncE
Even prettier solution: https://youtu.be/brU5yLm9DZM
Help fund future projects: https://www.patreon.com/3blue1brown
An equally valuable form of support is to simply share some of the videos.
Special thanks to these supporters: http://3b1b.co/clacks-thanks

New to this channel? It's all about teaching math ...

▶ Play video
pearl dove
#

hey @grave token

grave token
pearl dove
#

want to go into the math server so i can share my screen?

pearl dove
#

ok

#

im in the math server. Join me when you are ready

grave token
#

okay bye

#

You can just use physics formulas

#

to visualize you should use some physics engine...

#

okay bye

willow current
#

how can i do so i can choose like text 1 or 2 and choose from there in my python?

fickle snow
#

hey, can someone pls help with a django thing.
i am trying to add images to the django project but it is not displaying the images

hoary spear
harsh cliff
#

Hey, can someone instruct me how to install matplotlib pakage in python

#

it says Modulenotfound when I try to import it.

ivory arch
# ivory arch ```py # import libraries import random from decimal import * # constants WIDTH ...

calculating pi using this method

Pi: 3.1395680000, diff: 0.0020246536, time: 1.5
Pi: 3.1410800000, diff: 0.0005126536, time: 3.0
Pi: 3.1411937500, diff: 0.0003989036, time: 11.9
Pi: 3.1413311111, diff: 0.0002615425, time: 13.3
Pi: 3.1413788000, diff: 0.0002138536, time: 14.8
Pi: 3.1414490909, diff: 0.0001435627, time: 16.3
Pi: 3.1414929231, diff: 0.0000997305, time: 19.2
Pi: 3.1415191429, diff: 0.0000735107, time: 20.7
Pi: 3.1415196000, diff: 0.0000730536, time: 22.2
coral shard
#

!or

#

!if

keen onyxBOT
#

if __name__ == '__main__'

This is a statement that is only true if the module (your source code) it appears in is being run directly, as opposed to being imported into another module. When you run your module, the __name__ special variable is automatically set to the string '__main__'. Conversely, when you import that same module into a different one, and run that, __name__ is instead set to the filename of your module minus the .py extension.

Example

# foo.py

print('spam')

if __name__ == '__main__':
    print('eggs')

If you run the above module foo.py directly, both 'spam'and 'eggs' will be printed. Now consider this next example:

# bar.py

import foo

If you run this module named bar.py, it will execute the code in foo.py. First it will print 'spam', and then the if statement will fail, because __name__ will now be the string 'foo'.

Why would I do this?

• Your module is a library, but also has a special case where it can be run directly
• Your module is a library and you want to safeguard it against people running it directly (like what pip does)
• Your module is the main program, but has unit tests and the testing framework works by importing your module, and you want to avoid having your main code run during the test

chrome hawk
#

i have an image and i want python to work out the average pixel intensity below the blue line and average pixel intensity above blue line from image. I know code to work out average pixel intensity of full image. But dont know how to do pixel intensity below blue line and above. IF you have any ideas please help. Or another way is to get python to split image into 2 - one with everything below blue line and other with everything above line then i can do my code. But i dont know how to do that

chrome hawk
#

sorry cant do voice verification yet

keen onyxBOT
#

Hey @vernal violet!

It looks like you tried to attach file type(s) that we do not allow (.ipynb). 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.

vernal violet
#

^^we figured this out

idle junco
#

Hello all, I am trying to perform invoice data extraction from an image of invoice and export the data into an excel file. But I want to extract only a few fields from the invoice and not the entire invoice. Can anyone please advise how can I do that ?

from PIL import Image # pip install Pillow

set tesseract cmd to the be the path to your tesseract engine executable

(where you installed tesseract from above urls)

and start doing it

your saved images on desktop

list_with_many_images = [
"PartI_Data/Img1.PNG",
"PartI_Data/Img1.PNG",

"PartI_Data/Img1.PNG"
]

create a function that returns the text

def image_to_str(path):
""" return a string from image """
return pytesseract.image_to_string(Image.open(path))

now pure action + csv part

with open("images_content.csv", "w+", encoding="utf-8") as file:
file.write("ImagePath, ImageText")
for image_path in list_with_many_images:
text = image_to_str(image_path)
line = f"{image_path}, {text}\n"
file.write(line)

main solar
rustic quiver
sonic basin
#

@stable apex pls turn on your camera

#

bạn ơi bật cam lên ko cô kick ra khỏi lớp h @stable apex

scenic pivot
faint hinge
#

!stream 499000870713950238

keen onyxBOT
#

✅ @light mango can now stream until <t:1647551473:f>.

faint hinge
#

Actually, it may be simpler than that

#

Do you or did you have a second monitor on the machine you're remoted to?

#

Actually huh

#

It may also be that you're remoted into the machine trying to run the installer

light mango
#

I found something

#

It's like a log

#

called vsfaultinfo

faint hinge
#

That should give you some error codes to research and hopefully give you an explanation

light mango
#

UnauthorizedAccessException

#

is the description

#

vs/setup/bootstrapper/error

faint hinge
#

I wonder if that's because you're trying to run it from a remote connection program

light mango
#

could

#

be

faint hinge
#

Either way, having to head home now. Keep me posted

light mango
#

But the videos I'm watching that's what they use

light mango
faint hinge
#

I think your best bet is going to be going to the computer that you're remoted into and trying it from that one

spark cosmos
#

i cant speak yet in VC but I have a question

little badger
#

@weak zenith

#

!stream 751814647346102303

keen onyxBOT
#

✅ @weak zenith can now stream until <t:1647626900:f>.

little badger
#

tell me if you can hear me

weak zenith
#

i'm getting

little badger
#

ah

weak zenith
#

basically the thing is that I'm trying to run poetry commands in my terminal and it says the specified path is not found and I myself cannot find it in my file explorer so I beleive it's accidentally deleted maybe so I want to completely uninstall it to install again

#

But I'm not sure how to do it; I've tried some commands which haven't seemed to work

little badger
weak zenith
#

are you talking right now?

#

but don't I need to uninstall first?

little badger
#

are you connected or still RTCing?

weak zenith
#

connected

little badger
#

can you hear me?

weak zenith
#

nope

hoary wyvern
#

any kubernetes people here, need help with routing in ingress

short granite
#

!voiceverify

frank olive
#

,

delicate cave
#

#commands

#

!voiceverify

naive juniper
#

how to i get help with my python code ?

#

i am working on face recognition , using libraries sys, dlib , open cv , skimage

#

but in pycharm i can't open a window on the desktop showing the image

#

here is the code i am using :- win.set_image(image)

#

how can i set the wait time for the image

main solar
#

hello

jovial meteor
#

hello universe

quasi ember
#

Hi, i want to login to account with firebase_admin. How can i do

#

I don’t want to use pyrebase because I’m taking error

jovial meteor
quasi ember
#

I can do it with pyrebase too, but I get an error because I use firebase_admin on my other pages.

#

!voiceverify

delicate cave
#

hi

valid pagoda
#

hey

proven shadow
#

Can someone help me real quick

#

?

wide trench
#

In what?

little badger
delicate cave
main solar
#

Need code for this question

amber epoch
#

!code

keen onyxBOT
#

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.

full sail
#


from random import randrange

random_num = randrange(0,101)
print(random_num)

count_guess = 1

oldguess = int(input("Enter the number to guess (0 - 100) : "))

if oldguess not in range(0,101):
    print("Out of bounds")
    
if abs(random_num - oldguess) <= 10:
      print('Warm')
else:
      print("Cold")
while oldguess != random_num :
    guess = int(input("Enter the number to guess (0 - 100) : "))   
    if abs(guess-random_num) < abs(random_num - oldguess):
            print('Warmer')
            

    elif abs(guess-random_num) > abs(random_num - oldguess):
        print('Colder')
    oldguess  = guess
    else:
          print('Enter a new num')

    count_guess += 1 
if oldguess == random_num or guess == random_num:
  print(


  


    


  
        


#

If a player's guess is less than 1 or greater than 100, say "OUT OF BOUNDS"
On a player's first turn, if their guess is
within 10 of the number, return "WARM!"
further than 10 away from the number, return "COLD!"
On all subsequent turns, if a guess is
closer to the number than the previous guess return "WARMER!"
farther from the number than the previous guess, return "COLDER!

amber epoch
#

!e print(5 in range(10))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

True
uncut mirage
#

hey 🙂 I know this is not really a code problem more a i am to stupid for this problem but maybe some of you know the answer. I did install open CV (pip install opencv) but when i try to import cv2 its not finding anything

amber epoch
#

It is a common one, though, so you'll be able to collide with someone who knows.

livid scarab
#

help guys

#

my bot give me this error

#

run
sh: 1: run: not found
exit status 127

amber epoch
#

I'm afraid bots aren't something I'm familiar with.

livid scarab
#

can u atleast take a look

amber epoch
#

Are you able to copy and paste the whole error?

#

Or is that it?

livid scarab
#

thats it

amber epoch
#

What's the bot framework you're using?

livid scarab
#

what does framework mean

amber epoch
#

Module. Project.

livid scarab
#

tbh

amber epoch
#

Something on which you build your project.

livid scarab
#

can i inv to it

#

do u have a replit acc

amber epoch
#

I do not.

livid scarab
#

i got my code from this

amber epoch
livid scarab
#

i think so

amber epoch
#

I would grab one of the help channels. Someone who does bots is liable to know the common things that can go wrong. It's not a particularly helpful error message.

livid scarab
#

oh okey

zealous surge
#

hi yall im ben barson

opaque willow
#

whatsup

zealous surge
opaque willow
zealous surge
opaque willow
#

it will be easier

#

idk

zealous surge
opaque willow
zealous surge
#

for a while its my frien startup project

opaque willow
zealous surge
#

they wanna me have there website up for like a long time is that possible

opaque willow
#

just keep paying off the hoster

#

just host on azure or some aws or some

#

cheap

#

hosting

zealous surge
#

ok thanks i hope i can make it soon

opaque willow
#

site

#

s

opaque willow
slender swallow
#

how can I do this in vim snippets: def 2 -> def {1:myFunc}({2}, {3}):\ n{0} def {num} -> indicates the number of arguments

sharp island
#

hello

#

i can't hear anything from any voice chat room

quaint maple
#

were you looing to?

outer path
#

@deep echo Thank you it worked ```#THE FRUIT CLASS
class Fruit:
def init(self, type, price):
self.type = type
self.price = price

#def add_to_total (self, total):
#return total + self.price

Apple = Fruit("Apple", 1.75)
class2 = Fruit("Orange", 1.00)
class3 = Fruit("Banana", 0.50)
class4 = Fruit("Grape", 5.00)
class5 = Fruit("Cherry", 3.99)
class6 = Fruit("Peach" ,1.50)
class7 = Fruit("Pear" ,3.00)

fruits = [Apple, class2 ,class3, class4, class5, class6, class7]

for f in fruits:
print (f.price)

print("Welcome to the Marketplace!")
print("Here are the options:")

for curr1 in fruits:
print(curr1.type + "\t\t$", curr1.price)

purchase= []

choice = input("Write the name of the fruit: ")

while(choice != "full"):
purchase.append( str(choice) )
choice = input("Write the name of the fruit: ")
Total = []

fruit_dict = {
"Apple" : 0,
"Orange" : 0,
"Banana" : 0,
"Grape" : 0,
"Cherry" : 0,
"Peach" : 0,
"Pear" : 0,
}
fruit_doct = {
"Apple" : 1.75,
"Orange" : 1.00,
"Banana" : 0.50,
"Grape" : 5.00,
"Cherry" : 3.99,
"Peach" : 1.50,
"Pear" : 3.00,
}
fruit_total = {
1.75,
1.00,
0.50,
5.00,
3.99,
1.50,
3.00,

}
for i in purchase:
fruit_dict[i] += 1
fruit_doct[i]
for i in Total:
fruit_total[i] += i

print("\n", "Your receipt: ")
print("Fruit\t\tQuantity\t\t Price")

for i in fruit_dict:
amount = fruit_dict.get(i)
cocal = fruit_doct.get(i)
if amount > 0 :
print( i , "\t\t", amount, "\t\t\t\t", "$", cocal * amount)
Total.append(cocal*amount)
Exodus= sum(Total)
print("Total", "\t\t\t\t\t\t", "\033[1;31;40m" + "$", str(Exodus)+"\033[0m" )

print("Thank you for coming!")```

wooden lantern
#

anyone on mac ?

jagged orbit
jagged orbit
wooden lantern
valid pagoda
#

Is there a function that return every object that is colliding with and object in pygame?

main solar
#

Hi

#

I need some help

main solar
#

Can someone give me a harder ideea based on a chat application?

#

without pygame pls

jovial meteor
#

still sardii

abstract mesa
#

!verefy chat

#

!voice

keen onyxBOT
#

Voice verification

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

abstract mesa
#

Its not good

#

😳👍

idle basin
#

@grave token

grave token
#

HI

#

What is your plugin manager?

idle basin
#

@main solar Sure, did :checkhealth

grave token
#

vim-plug?

main solar
idle basin
grave token
#

What's soc?

idle basin
#

Uh?

grave token
#

I have never heard of soc? what's that...

idle basin
#

coc a LSP client

#

Conquer of Completion

grave token
#

Let me look into github issue

idle basin
#

go ahead, element

grave token
#

Let me try to install

#

I don't use this

idle basin
#

ok, installing might be a hazard.

#

Don't do it

grave token
#

Haha, I have vm

idle basin
#

You have node.js? do you?

grave token
#

yep

idle basin
#

Ok go ahead.

grave token
#

Going for dinner, ...I'll DM you, brb in 10 min

idle basin
#

Sure, cya!

grave token
#

I installed it, showing same for me... I guess you need to config it... @idle basin

idle basin
#

Uh?

#

weird?

burnt salmon
#

Is anyone able to help with some code? thanks in advance

#

Hi just give me a min

#

I don't meet the requirements to be voice verified rn

#

Sry I am new to this server

#

Yeah

#

So I am finding it difficult to type out an explanation

amber epoch
#

Take your time. 🙂

burnt salmon
#

I find it easier to show you the question I am working on above

#

I simplified my code to the above

#

And when I test it

#

This is what I get in comparison to what is expected from my code.

amber epoch
#

I'm finding I have to read through this several times.

#

The problem brief as written.

burnt salmon
#

Sorry

amber epoch
#

It's not your fault.

burnt salmon
#

I'd wish I'd be able to speak rn as it would make it so much easier

amber epoch
#

People write these things, know what they're talking about, so when they read back through it, they don't see a problem with it.

#

Even if there is.

#

So it's left to the reader to interpret.

#

As opposed to more directly derive.

#

Do you know what they're talking about when they stress the word "unique"?

#

Because it seems as though the word needn't exist within this text.

#

Is there discussion elsewhere that might lend context?

burnt salmon
#

The above is an
excerpt image for an example file provided

#

When they say unique they refer, focusing on the move title "Charlie and the Talking Buzzard", the actor is not the same person

amber epoch
#

I don't follow.

burnt salmon
#

There are two instances as shown in the image where Charlie and the Talking Buzzard" is shown with two different/unique actors, "Hanks, Mike" and "Hanks, Christopher"

#

However in the above, with the movie "The Polar Express", even though it is repeated the most, the actor playing it is the same person "Hanks, Tom"

#

Making it not unique even thought it has the most indivduals

amber epoch
#

Oh, so the text file has duplicates that we're throwing away?

#

Or...merging or whatever.

#

Deduplicating.

#

Okay.

#

Let us all hope, then, that there are no actors, plural, with the same name who have worked on the same movie.

#

Okay. So read the file. Print the number of people in the movie with the greatest number of people in it, then the name of that movie.
Then print the number of movies in which only one actor appears.

burnt salmon
#

yes

amber epoch
#

Use dict.

#

Okay.

#

Have you covered sets, yet?

burnt salmon
#

Yes

amber epoch
#

I would suggest your dictionary have the movie names as its keys and a set of actors as its values.

burnt salmon
#

How would I arrange that?

amber epoch
#
{"movie name": {"Alex Perfectface", "Peter McSassypants", "Donna Teslahair"},
 "other movie name": {"Lonesome Paul"}}```
burnt salmon
#

How would I change my code as my code produces the following:

#

I am adding a value to the movie based off how many times it appears in the txt

#

I think I got it

#

Actually nvm

amber epoch
#

!e py data = {"Bun Hair": {"Alex Perfectface", "Peter McSassypants", "Donna Teslahair"}, "Murder on the Orient Espresso": {"Lonesome Paul"}} print(len(data["Bun Hair"])) #Number of actors for this movie.

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

3
burnt salmon
#

The method I was doing was considering the authors as one value

#

I

#

understand

amber epoch
#

Okiedoke. 🙂

burnt salmon
#

I was doing it like this

#

to where I add the actor to the movie key

#

however

#

it was considering

#

each actor

#

together

#

I am just having difficult assigning the author's to each movie key since I can't do it manual

#

so

#

I am just trying to figure out through the method I shown above

#

Yeah

amber epoch
#

I don't see where authors enter into it.

burnt salmon
#

I believe I

#

am making this more difficult than it seems

amber epoch
#

!e print(dir(dict))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

['__class__', '__class_getitem__', '__contains__', '__delattr__', '__delitem__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__ior__', '__iter__', '__le__', '__len__', '__lt__', '__ne__', '__new__', '__or__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__ror__', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__subclasshook__', 'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values']
amber epoch
#

!e py my_dict = {"key_a": "value_a", "key_b": "value_b"} print([*my_dict.items()]) print([*my_dict.keys()]) print([*my_dict.values()])

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | [('key_a', 'value_a'), ('key_b', 'value_b')]
002 | ['key_a', 'key_b']
003 | ['value_a', 'value_b']
amber epoch
#

max

#

"comprehension"

#

max's key parameter

#

lambda function

#

(doesn't have to be a lambda function, could be a def function)

#

!e ```py
def func(v):
return 3-v

vs = 1, 2, 3

print(max(vs, key=func))```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

1
amber epoch
#
max(vs, key=lambda v: 3-v)```
main solar
#

a = 1
b = 2
c = 93

sum = num1 + num2 + num3


print('The sum of {0} and {1} is {2}'.format(a b c sum))```
#

!e

keen onyxBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

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

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

main solar
#

!e
a = 1
b = 2
c = 93

sum = num1 + num2 + num3

print('The sum of {0} and {1} is {2}'.format(a b c sum))

keen onyxBOT
#

@main solar :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 8
002 |     print('The sum of {0} and {1} is {2}'.format(a b c sum))
003 |                                                  ^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
main solar
#

a = 1
b = 2
c = 93

sum = a + b + c


print('The sum of {0} and {1} is {2}'.format(a, b, c, sum))```
#

!e

a = 1
b = 2
c = 93

sum = a + b + c

print('The sum of {0} and {1} is {2}'.format(a, b, c, sum))

keen onyxBOT
#

@main solar :white_check_mark: Your eval job has completed with return code 0.

The sum of 1 and 2 is 93
amber epoch
#

@main solarHello. I'm presently engaged in assisting another user at this time. If you require assistance at this time, I would suggest you use the help channel system. #❓|how-to-get-help . Otherwise, I'll endeavour to get back to you when I can. 🙂

#

!e py my_dict = {"apples": 1, "pears": 2, "grapes": 3} print(max(my_dict)) #The iterable are the *keys* for this purpose print(max(my_dict, key=my_dict.__getitem__))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | pears
002 | grapes
amber epoch
#

!e py my_dict = {"key": "value"} print(my_dict["key"]) print(my_dict.__getitem__("key"))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | value
002 | value
amber epoch
#
key=lambda a: my_dict[a]```
#
def func(a):
    return my_dict[a]```
#

a being the key

#

!e ```py
my_list = []
for i in range(5):
my_list.append(i)
print(my_list)

my_list = [i for i in range(5)] #new my_list
print(my_list)```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | [0, 1, 2, 3, 4]
002 | [0, 1, 2, 3, 4]
mortal bough
#

why i can´t talk?

#

oooh

amber epoch
#

!e ```py
my_list = []
for a in "abc":
for b in (1,2,3):
my_list.append((a,b))
print(my_list)

my_list = [(a,b) for a in "abc" for b in (1,2,3)]
print(my_list)```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | [('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('b', 3), ('c', 1), ('c', 2), ('c', 3)]
002 | [('a', 1), ('a', 2), ('a', 3), ('b', 1), ('b', 2), ('b', 3), ('c', 1), ('c', 2), ('c', 3)]
amber epoch
#

!e py a = 1, 2, 3 print(max(a)) print(max(v for v in a))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | 3
002 | 3
amber epoch
#

!e py vs = True, True, True, False, True print(sum(vs))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

4
amber epoch
#

!e py d = {"a": {"b", "c"}, "d": {"e"}} print(d.values()) print(max(len(v) for v in d.values()))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | dict_values([{'c', 'b'}, {'e'}])
002 | 2
amber epoch
#

@main solar I'm available now. Do you require assistance at this time?

#

Okay, we'll, I'll be around for a bit. Come find me if you need me. Ideally, go through the help channel system, though.

valid pagoda
#

hey is anyone here?

buoyant remnant
#

hi

valid pagoda
# buoyant remnant hi

I was working on an program that took in a tuple (x,y) and returned a tuple that'll get closer to another point in increments

#

but I'm getting index errors

#

let me put my code into a replit file so I can send in chat

#

ah It did

buoyant remnant
#

im srry i cant really help i recently started cofing and to be honest i barley understand anything and i wasnt really understanding yt so i came hertr to se if i can get some help, again rlly srry i cat help u with this 😦

buoyant remnant
valid pagoda
buoyant remnant
#

if u dont mind me asking what r u making?

valid pagoda
#

I mean my mistake

buoyant remnant
#

oh nice

#

is it a game

hollow flare
#

have any of yall used a hand tracking library such as mediapipe or tesorflow?

main solar
#

lol

native crescent
#

!e sayi1 = input('1. Sayı : ')
sayi2 = input('1. Sayı : ')
toplam=float(sayi1)+float(sayi2)
print("Toplam :{0} ".format(toplam))

keen onyxBOT
#

@native crescent :x: Your eval job has completed with return code 1.

001 | 1. Sayı : Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
native crescent
#

huh

main solar
#

hi

#

can someone tell me why i am getting an error here

latent vine
#

def init(self, tokens): @main solar

main solar
#

thanks

valid pagoda
#

I was making code to switch sprite surfaces if the user clicks their mouse. But I'm getting a type error.

#
        if mouseButton[0]:
            mouseButton = False
            timePoint = pygame.time.get_ticks()
            if timePoint < 2000:
                self.perrySurf = self.perryActive
        if mouseButton[0] == False or timePoint < 2000:
            self.perrySurf = self.perryDefault
            timePoint = 0
#

The error is

#

TypeError: 'bool' object is not subscriptable

grave token
#

line 1... you are using it as list

main solar
#

yes...

grave token
#

you are assigning bool

#

you meant maybe
mouseButton[0] = False ?

valid pagoda
#
mouseButton = pygame.mouse.get_pressed()
#

i forgot about this

#

this is how I delcared it

#

it's a list of bool

grave token
#

yeah...

#

what are you doing in line 2?

valid pagoda
#

oh wait I'm dumb

#

I forgot to take that out

#

haha

grave token
#

TOSS A COIN TO THIS WITCHER 🙃

valid pagoda
grave token
#

np

worn ruin
tight solar
#

@worn ruin is there a reason you're posting these?

worn ruin
#

just had to get to the channel

#

sorry about that

peak cedar
#

anyone able to help me real quick I think my problem is pretty basic

main solar
#

im going to explode

knotty holly
#

Hello @ancient pagoda

#

We're chatting in #help-bread if you're wondering what's going on.

ancient pagoda
#

Hi

knotty holly
#

Hey @tulip fossil

#

See above this

#

Erm, I'm currently helping someone sorry.

raven mango
#

Hello i am trying to align the password entry (tkinter module) with the email and website entries i used .grid(column=1) for all of them but i didn't work. if anyone can help me with that

amber epoch
#

!e py from collections import defaultdict a = defaultdict() b = dict(a) print(type(a)) print(type(b))

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | <class 'collections.defaultdict'>
002 | <class 'dict'>
amber epoch
#

@worldly sky

#

In order to know why you aren't seeing what you want to be seeing, an examination of your code is in order.

#

Posting here because I don't have !e privs in the general room.

inland prairie
#

i keep on getting an indentation error

#

and when i get rid of it

#

it says main isnt defined

wind linden
#

!voiceverify

burnt salmon
#

If anyone can help me with my code I would really appreciate it thank you

lime spruce
burnt salmon
#

If you can't see it I can copy and paste it here

lime spruce
burnt salmon
#

I changed it to the above as well, but it still doesn't work

burnt salmon
#

?

#

@lime spruce you have any thoughts or solutions for the question?

sharp vault
#

hello, i am trying to use some code I found on github

#

i am not sure how it works

#

do I just put the file path here?

#

please ping if you know what to do

sharp salmon
#

Hey guys Can anyone help me identify the number of operands in a source code by hand?
public class Deneme {
public int x;
public int y;

public Deneme(int x, int y) {
    this.x = x;
    this.y = y;
}

public int x2y2() {
    return x * x + y * y;
}

public double Squareroot() {
    return Math.sqrt((double) x2y2());
}

public double log2() {
    ++y;
    return Math.log(((double) x) / y);
}

@Override
public boolean equals(Object obj) {
    if (obj != null && obj instanceof Deneme) {
        return ((Deneme) obj).x == this.x && ((Deneme) obj).y == this.y;
    }
    return false;
}

}

winter nexus
#

could anyone with django and htmx experience please help
voice chat!!

lime spruce
winter nexus
#

@lime spruce

#

are you able to talk in voicechat0

sudden mist
#

friend?

#

add you as friend

#

?

#

I don't add people as friends if they invite me to any group dm

#

or rather, I unfriend them in that case

thin bison
#

..

#

...

sudden mist
#

we can be friends without being friends on discord?

#

🤦

#

no

sudden mist
#

we can still chat and call and all that but we don't need to be discor friends

#

there's a thing you can toggle

#

idk where

#

probably in voice & video settings

#

busy rn

#

busy playing minecraft

#

duh

#

I put it on do not disturb cuz my other friends spam me

#

also why are talking in the python discord

sudden mist
#

shd be on already

keen onyxBOT
#

failmail :ok_hand: applied mute to @main solar until <t:1648995922:f> (9 minutes and 59 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).

naive ore
#
import random

print('Hello,i am talkbot')
print('my commands are:')
print('1.hello 2 whats your name 3.do you hate me 4.you are boring5.hi 6.i am getting dull 7.flip a coin')
while(2>1):
    msg1=input("Enter the message ")
    if(msg1=='hello' or msg1=='Hello'):
        print('hi')
    elif(msg1=='whats your name' or msg1=='Whats your name'):
        print('I am talkbot')
    elif(msg1=='do you hate me' or msg1=='Do you hate me'):
        print('Of course no')
    elif(msg1=='you are boring' or msg1=='You are boring'):
        print('I am sad to know that')
    elif(msg1=='hi' or msg1=='Hi'):
        print('Hello, nice to meet you')
    elif(msg1=='i am getting dull' or msg1=='I am getting dull'):
        print('BOOM!!! Are you dull now ?')
    elif(msg1=='flip a coin' or msg1=='Flip a coin'):
        coin=(random.randint(0,1))
        if (coin==0):
            print('Heads')
        elif (coin==1):
            print('Tails')
        else :print ('FAIL')
        
    else:
        print("i don't know that")
#

the coin flipping part is not working

#

the session just crashes

#

without any error messages

main solar
#

im currently trying to do a music function with my bot, but im having trouble with this error, and have had the error and have been trying to tackle it for what feels like forever now lmao

Command it's failing on: ```py
@bot.command()
async def play(ctx, url : str):
song_there = os.path.isfile("song.mp3")
try:
if song_there:
os.remove("song.mp3")
except PermissionError:
await ctx.send("Wait for the current playing music to end or use the stop command, you sexy mf.")
return

voiceChannel = discord.utils.get(ctx.guild.voice_channels, name='General')
await voiceChannel.connect()
voice = discord.utils.get(bot.voice_clients, guild=ctx.guild)

ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download([url])
for file in os.listdir("./"):
    if file.endswith(".mp3"):
        os.rename(file, "song.mp3")
voice.play(discord.FFmpegPCMAudio("song.mp3"))

Getting the error on the line:py
ydl.download([url])


Error: `unable to obtain file audio codec with ffprobe`
distant meteor
#

hey guys, i am kind of new to python, i know basic python knowledge, i have beed making a python gmae on pygame and the code just wont run for no apparent reason

#

if anyone is willing to help pls dm me

#

i cant really paste code into the section so pls dm me

small abyss
#

.

tall pendant
#

hi guys I am trying to collect the total by using fruitful function can you help me, please

#
food =["Burger","Drink","Fries","Apple Pie"]
prices = [5,1,3,2]
myorderFood=[]
myorderCost=[]
counter=0

print ("Welcome to SATO Restaurant")

order = input("Can I take your order?")
def total():
    a=prices [0]+prices [1]+prices [2]+prices [3]
    return a
def mune():
    print("Choose from the menu")
    print("Burger,Drink,Fries,Apple Pie")
mune()

nextorder = True

while nextorder==True:
    foodorder=input("Please enter item")
    if foodorder=="Burger":
        myorderFood.append ( food [0])
        myorderCost.append (prices [0])
        counter=counter+1
        
    elif foodorder=="Drink":
        myorderFood.append (food [1])
        myorderCost.append (prices [1])
        counter=counter+1
        
    elif foodorder=="Fries":
        myorderFood.append ( food [2])
        myorderCost.append (prices [2])
        counter=counter+1
        
    elif foodorder=="Apple Pie":
        myorderFood.append (food [3])
        myorderCost.append (prices [3])
        counter=counter+1
        
    else:
        print ("Not on menu")
    finished=input("Have you finished ordering Y/N")
    if finished=="N": 
        nextorder=True
    else:
        nextorder=False
y=0
print ("Here is your order")
print (" ")
print ("********************************************************")
while y<counter:
    print ("Item: "+ (myorderFood [y]))
    print ("Cost: ",(myorderCost [y]))

    y=y+1
print ("The final cost is : ",(total()))
print("=========================================================")
jagged orbit
#

Hi guys do you know if people can access online to my program on replit because it is public ?

wind goblet
jagged orbit
# sage lynx I think they can

yeah ok thanks for your reply, I have just put my token for my bot in an environment variable I heard it is safe when we do it

jagged orbit
#

you coded it on replit as well ?

main solar
#

.

keen onyxBOT
#

:incoming_envelope: :ok_hand: applied mute to @unkempt grail until <t:1649280786:f> (9 minutes and 59 seconds) (reason: mentions rule: sent 7 mentions in 10s).

oak sail
#

what roles should I have ? to share the screen

small bronze
#

but it's given my mods/admins

#

so no

livid basalt
#

guys help pls

#

im new python

#

helpers

fringe token
livid basalt
fringe token
#

python doesen't need '{' or '}' or '(' or ')' like you used them

#
a : int = 0

print("buna kac puan verdiniz?")

a : int = int(input())

if a < 5:
  print("Smaller than 5")
  ## I don't understand what your intention is with the 'input()'

else:
  print("Not smaller than 5")

#

and you should check if the input is actually an int before calling 'int(input())'

#

@livid basalt

faint pelican
#
#include <stdio.h>
#include <stdlib.h>
//#include "Sorter.h"

/**
 * Sorting Algorithms in C
 * (algorithms are found in Sorter.h)
 */

 void swapVal(void *a, void *b, size_t siz)
{
    char temp[siz];

    memcpy(temp, b, siz);
    memcpy(b, a, siz);
    memcpy(a, temp, siz);
}

// Bubble sort
void bubbleSort(void *base, size_t nitems, size_t siz, int (*cmp)(const void*, const void*))
{
    for (size_t i = 1; i < nitems; i++)
    {
        for (size_t j = 0; j < nitems - i; j++)
        {
            if ((*cmp)((void*)(base+j), (void*)(base+j + 1))) // Something is wrong here
            {
                swapVal((void*)(base+j), (void*)(base+j + 1),siz);
            }
        }
    }
}

int cmpfunc (const void * a, const void * b) {
   return ( *(int*)a - *(int*)b );
}

int main(void)
{
    int toSort[] = {1,2,3,4,9,8,7,6,5};
    puts("Before sorting:");
    for (int i = 0; i < 9; i++)
    {
        printf("%d ", toSort[i]);
    }
    bubbleSort(toSort, 9, sizeof(int), cmpfunc);
    puts("After sorting:");
    for (int i = 0; i < 9; i++)
    {
        printf("%d ", toSort[i]);
    }

    return 0;
}

austere knoll
amber epoch
#

!e ```py
class MyClass:
def init(self):
self._data = 0

@property
def data(self):
    print("Get!")
    return self._data

@data.setter
def data(self, v):
    print("Set!")
    self._data = v

mc = MyClass()
print(mc.data)
mc.data = 1
print(mc.data)```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | Get!
002 | 0
003 | Set!
004 | Get!
005 | 1
amber epoch
#

!e ```py
class MyClass:
def init(self):
self._data = 0

def data_get(self):
    print("Get!")
    return self._data

def data_set(self, v):
    print("Set!")
    self._data = v

mc = MyClass()
print(mc.data_get())
mc.data_set(1)
print(mc.data_get())```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | Get!
002 | 0
003 | Set!
004 | Get!
005 | 1
amber epoch
#
class MyClass:
    v = 0```
#

!e ```py
class MyClass:
v = 0
def get(self):
return self.v

mca = MyClass()
mcb = MyClass()

print(mca.get())
mcb.v = 5
print(mca.get())```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 0
amber epoch
#

!e ```py
class MyClass:
def init(self, v):
self.v = v

mc = MyClass(6) #Right of the = is the constructor of a class. The "call" of a class. init is also referred to as the constructor of a class.```

keen onyxBOT
#

@amber epoch :warning: Your eval job has completed with return code 0.

[No output]
amber epoch
#

!code

keen onyxBOT
#

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.

small kettle
#

def init(self, car):

#

'''py

amber epoch
#

` vs '

vague rune
#

```py
my_code_here
```

small kettle
#
def __init__(self, car):
  self.car = car
  self.cat = cat
vague rune
#

!e

class A:
  def __init__(self, a):
    self.a = a
  def print(self):
    print(self.b)

o = A(5)
o.b = 7
o.print()
keen onyxBOT
#

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

7
amber epoch
#

!e ```py
class MyClass:
def method_or_function(self):
print(self)

mc = MyClass()

print(f"Before instantiation: {type(MyClass.method_or_function)}")
print(f"After instantiation: {type(mc.method_or_function)}")

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | Before instantiation: <class 'function'>
002 | After instantiation: <class 'method'>
amber epoch
#

!e ```py
class MyClass:
def method_or_function(self):
print(self)

MyClass.method_or_function("Apple")
mc = MyClass()
mc.method_or_function()```

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

001 | Apple
002 | <__main__.MyClass object at 0x7ff6410d5b40>
vague rune
#

!e

class A:
  def __init__(self, a):
    self.a = a
  def print(self):
    print(self.a)

lst = [A(1), A(2), A(3), A(4)]
list(map(A.print, lst))
keen onyxBOT
#

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

001 | 1
002 | 2
003 | 3
004 | 4
amber epoch
#

IDEs

vague rune
#

spyDE

weak jewel
#

help?

#

with js?

#
    setPersons(persons.slice(0,-2))
  }
#

Why does this code slice off the last two list elements the first time I click, and then the last 1 element for subsequent clicks. React JS

main solar
#

I am new to Python and I need some Help!

#

def checkPal(s) -> bool:
if len(s) == 1:
print("Returned")
return True
if s[0] == s[-1]:
print('Checking')
checkPal(s[1:-1])
else: return False
print(checkPal('madam'))

#

What's wrong with this code?

radiant oyster
#

hello, any one free to help me ?

small saddle
radiant oyster
#

python

#

i have python code that has a problem

steep star
#

Hey i dont know if this is something to do with python but im trying to get data from an api and save it as a json file.

I can save it but its this really long string thats in one line.
Is there any way to seperate it like ive done right here manually.

{"suggestions": [

    
    {"id": "90707431", 
    "prod_id": "85465",
    "title": "Finvalsede havregryn", 
    "description": "Finvalsede havregryn", 
    "img": "https://image.prod.iposeninfra.com/bilkaimg.php?pid=85465&imgType=jpeg", 
    "link": "https://www.bilkatogo.dk/p/85465", 
    "price": 9.95}, 
    
    {"id": "32861601", 
    "prod_id": "39411", 
    "title": "Finvalsede havregryn \u00f8ko", 
    "description": "Finvalsede havregryn \u00f8ko", 
    "img": "https://image.prod.iposeninfra.com/bilkaimg.php?pid=39411&imgType=jpeg", 
    "link": "https://www.bilkatogo.dk/p/39411", "price": 8.96}, 
    
    {"id": "90707441", 
    "prod_id": "85466", 
    "title": "Grovvalsede havregryn", 
    "description": "Grovvalsede havregryn", 
    "img": "https://image.prod.iposeninfra.com/bilkaimg.php?pid=85466&imgType=jpeg", 
    "link": "https://www.bilkatogo.dk/p/85466", 
    "price": 11.5}, 
    
    ]}

Can i do it when i get it from the api or do i make another script?

weak jewel
weak jewel
#

No, it's called json.dump(). Here, use this :

#
    with open(fn, "w") as write_file:
        json.dump(j, write_file, indent=2)```
#

I believe the optional indent parameter is what causes the function to prettify.

vague rune
#

@earnest harness

earnest harness
twilit moat
#

Hey guys, I need a simple algorithm, that given a deck of cards (for example, user input would be - 4,2,king,9,queen) will sort it ascending values, can anyone do that for me real quick?

vague rune
#

@earnest harness did your issue get fixed?

fossil tinsel
#

What's happening in the voice channel

lone trout
#

there is no switch statement for python is there>

neat remnant
#

!voice

keen onyxBOT
#

Voice verification

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

tender hill
#

@scenic meteor
!voice

#

!voice

keen onyxBOT
#

Voice verification

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

scenic meteor
#

yes

#

my issue is im making a hash script file checker

#

import hashlib
import datetime
import json

print("Welcome to the super dick script")

userContinue = True

while userContinue:
file_path = input('Enter the full path of the file to check (example: C:/test.txt) or [e] to exit: ')
if file_path.lower() == "e":
print("Bye!")
break
try:
file_to_check = open(file_path,"rb")

    sha256_hash = hashlib.sha256(file_to_check.read()).hexdigest()
    time_stamp = str(datetime.datetime.now())
    print("time_stamp:",time_stamp,"file:",file_path,"hash:",sha256_hash)

except Exception as error:
    print("error", error)
#

this works

#

i have to do this as added extras -

#

oad the log file containing previous hash checks in read mode - #file.open and load data like json
ead the contents of that file using JSON and store it into a list called logs[] #wstore into list
Close the file #
Add the new time_stamp, file and hash to the list as a dictionary #
Loop through the list and print any hash and time stamp for that same file #like searching in lab 5 but by file name
Append the new hash, time stamp and file name to the existing list #
Open the log file in write mode #
Dump the list of the old hash and the new hash to the log file using JSON
Close the file

#

Begin main loop

while userContinue:

# Ask the user for the file path
file_path = input('Enter the full path of the file to check (example: C:/test.txt) or [e] to exit: ')

# Check for exit press
if file_path.lower() == "e":
    print("Bye!")
    break

with open(file_path):
    json.load(data.log)
    print(data.log)
tender hill
#

!code

keen onyxBOT
#

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.

scenic meteor
#

ah

#

thanks i didnt know

#
while userContinue:

    # Ask the user for the file path
    file_path = input('Enter the full path of the file to check (example: C:/test.txt) or [e] to exit: ')

    # Check for exit press
    if file_path.lower() == "e":
        print("Bye!")
        break

    with open(file_path):
        json.load(data.log)
        print(data.log) ```
#

the - with open(file_path):

tender hill
#

with open(file_path) as f:

scenic meteor
#

yes just checking it

#

json.load(data.log)
NameError: name 'data' is not defined

scenic meteor
#

ah okay

#

im getting other errors

#

raw decode errors

#

Im new to all this and have had this assignment placed on me :/

#

C:\users\Nibbler\Documents\friends.json

tender hill
#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

scenic meteor
#

my ide is frozen

#

atom

#

data.append({key:value, key,value})
log = []
log.append(time_stamp + file_path + sha256_hash)
log.append(data)

#

i have this as well

#

which i was provided by the professor

#

which should work

#

but I cant find much on key values

#

any rec resources?

tender hill
#

it seems more like a pseudo code

scenic meteor
#

nah the file wont open i think i might leave it and try tomorrow

#

maybe i can VC tomorrow

scenic meteor
#

thank you for your help

#

ah yesterday i think

#

or the day before

#

oh

#

😦

#

ill wait

#

i have to wait

tender hill
#

ah okay then

#

bye have a good day!

scenic meteor
#

thank you for your help

dire flame
#

how u guys so good at coding

#

i try but i always fail

#

lol

quiet leaf
#

guys

#

can anyone help with my code?

lime spindle
lethal onyx
lethal cosmos
#

can someone help me im a beginner in coding

vague rune
woven python
#

codinf

#

log in page

runic verge
#

Guys... I have a dataframe which it contains lots of Lat and Lon values. What I want to do is simply finding the nearest of point(s) for like 5 points maybe depending on my variables.
newlat = 40.1
newlon = 22.1
c = ds.sel(lat=newlat, lon=newlon, method="nearest")
this is working with xarray but that gives me only one value
how can i find more nearest points?
is there a place where i can find some answers?

near rose
#

hey can someone help me I got a problem I launched my website everything works fine but the background image on ios looks so zoomed in but it is just on ios nothing else
it works just fine on windows mac and chrome but not in ios

bronze lance
#

just find myself couldn't use the voice channel

#

Is that okay for me

#

to just send

#

50 messages to this channel?

#

Or I will have to split it for like several days?

weak marten
#

is there anyone who can help me with my code in VC?

silent socket
#

Can someone please help me, im trying to make the leap into Python I hear its the most reliable lang. to learn.. can any season vet translate this simple automation into Python.py so I can get an idea how to kick start this journey I'll really appreciate it thanks.

^s::
sleep 2
loop ,
{
sleep 15
CoordMode, Mouse, Screen
MouseMove, 35, 693, ; Copy # from list from terminal.

send { left down 20 }
send {left up}

MouseClick, left
MouseClick, left
sleep 2000
send ^c
MouseClick, right
sleep 1000
MouseMove, 784, 206, ; Move to location to paste.
MouseClickDrag, right, 784, 206, 785, 209
send ^v
sleep 2000
send ^x
}

send % A_LoopField

main solar
#

@silent socket u could use a module called pyautogui for that

main solar
#

Someone in help lemon could help me please?

main solar
#

yeah

#

106

#

wait

#

i can explain you my issues

#

if you use variable = [4,5,6,-10,-12,5,4,6]

#

the results must be between 0 and 10

#

how could you do that?

#

no man it doesn work wait

#

you need to check that for every element i mean

#

4+5 is ok

#

but 9 + 6 it exceed 10

#

how to clip that

#

@echo urchin

#

no man you didnt understand my question ahah

#

the first sum is ok but the second it is not ok because it exceed 10

#

i dont want to sum only the number between 0 and 10

fading thicket
#

what do you want to do then?

#

clamp the value?

main solar
#

by writing is quite difficult but I try

#

I need to sum every element and the sum mustnt exceed a value. the sum of every element

echo urchin
main solar
#

is there a way to speak? I can explain what doesnt work ahah. Im ok with the basics of programming

uneven gust
#

@fading thicket can't you give him the permissions?

main solar
#

yeah

#

to keep the max value

#

i can make an example

uneven gust
main solar
#

by having this variable = [4,5,6,-10,-12,5,4,6]

#

I want to keep it between 0 and 10

#

the result must be

#

[9,10,0,0,5,9,10]

#

Im sorry but by writing it is difficult to explain in a good way

#

im sorry

uneven gust
#

Whatever the elements are, the result must always be between between 0 and 10....

#

Correct?

main solar
#

yes

uneven gust
#

So, If there are 10 elements inside a list, the sum must be between 0 and 10?

uneven gust
main solar
#

yeah that's correct

uneven gust
main solar
#

the value inside the array

#

i want to keep them between 0 and 10

#

nono

#

the sum must be everytime between 0 and 10

#

is it clear?

#

I can make another example

uneven gust
#

The model that @echo urchin

fading thicket
uneven gust
#

has made is correct.

main solar
#

Starting with [3,3,3,3,3,3,-4,-4,-4,-4,-4,3,3,3,3,3] in the end the final array must be [3,6,9,10,10,10,6,2,0,0,0,3,6,9,10,10]

#

is it more clear now?

#

so i need to create a new list with a for loop and adding every value in here with an if statement right?

fading thicket
#
old_list = [3,3,3,3,3,3,-4,-4,-4,-4,-4,3,3,3,3,3]
new_list = []
current_total = 0

# iterate through old_list
  # Add the current element to the current_total
  # Check if the current_total is outside of our bounds
  # Add the current_total to the new_list

print(new_list)
main solar
#

now I try and i let you know if it works

#

thank you so much

#

yeah

#

im coding

#

wait a second

#

cap = 20
total = 0

for i in diff:
total = diff[i]
if(total <= cap):
en_battery[i] = total

print(en_battery)
plt.plot(en_battery)

fading thicket
#

```py
code
```

main solar
#

capacitance of a battery

#

maximum value of energy that can be stored in a battery

fading thicket
#
diff = [3,3,3,3,3,3,-4,-4,-4,-4,-4,3,3,3,3,3]
en_battery = []
cap = 20
total = 0

for i in diff:
    total = diff[i]
    if(total <= cap):
        en_battery[i] = total

print(en_battery)
plt.plot(en_battery) 
main solar
#

nono

#

I started with C

uneven gust
#

Dammit, I started with C# for Unity.

main solar
#

ah yeah you are right!

fading thicket
#

!e

diff = [3,3,3,3,3,3,-4,-4,-4,-4,-4,3,3,3,3,3]
en_battery = []
cap = 20
total = 0

for i in diff:
    total = i
    if(total <= cap):
        en_battery.append(i)

print(en_battery)
keen onyxBOT
#

@fading thicket :white_check_mark: Your eval job has completed with return code 0.

[3, 3, 3, 3, 3, 3, -4, -4, -4, -4, -4, 3, 3, 3, 3, 3]
main solar
#

if the list diff is with float value?

#

the variable total should be float right?

#

also the final array

#

thank you so much bro

#

really appreciated

fading thicket
#
# iterate through old_list
  # Add the current element to the current_total
  # Check if the current_total is outside of our bounds
  # Add the current_total to the new_list
main solar
#

I was expecting that using array.sum() could have worked with some if statements but it didnt work

#

by using your code it works

#

starting from C code Im finding some issues

#

in python you have a lot of functions that can make easier you code

#

no I have only this .py

#

could i ask you a final question?

fading thicket
#

ye

main solar
#

Griff are you a moderator? is it possible to speak for a moment to explain you a thing?

#

if not I ll write it here

uneven gust
#

@fading thicket , what software are you using to code?

main solar
#

@fading thicket is it possible to speak for a moment to explain you a thing?

uneven gust
main solar
#

ah okok no problem, I explain you here

uneven gust
#

Isn't it DataLore?

main solar
#

diff in my code is probably a dataframe, im not sure

uneven gust
#

@fading thicket

#

Bye guys, I've to go.

fading thicket
#

cya

uneven gust
#

Have a great day everybody!

main solar
#

I downloaded from a csv file some data, I have a float value and also a time period, so probably the code that I show you before doesnt work

uneven gust
#

cya!

main solar
#

it is because when I plot "diff" I have the time on x axis, by plotting your code on the x axis I have the position in the array

#

Instead of using an array, how could I use an dataframe?

#

@fading thicket Thank you so much for your time!!

fading thicket
#

np

#

@void badge

#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

still kernel
#

streammmm

grave token
#

@fading thicket @void badge what's the problem?

void badge
#

posets and hasse diagrams

grave token
#

cosets?

#

ah partially ordered set!

#

what's the problem?

#

@void badge

#

They seem like a directed acyclic graph!

#

make sense it's a dag!

#

@fading thicket what's the problem?

fading thicket
#
def new_word(my_word, word_bank, used):
    """"
    Returns a tuple containing the old word and the new word that can be
    formed from the old word and the remaining tiles in the pile. This tuple
    must not be in used. Function updates the used list appropriately. If there
    is no unused tuple to return, return None.


    Arguments:
        - my_word [str]: the word to be added to
        - word_bank [list]: a list of valid words that can be considered
        - used [list]: a list of tuples that have already been made
    """
    available_words = filter(lambda e: e not in [u[1] for u in used], word_bank)
    possible_next_words = filter(lambda e: len(e) == len(my_word) + 1, available_words)
    # Filter to words that are 1 char away
    for word in possible_next_words:
        output = (my_word, word)
        used.append(output)
        return output


def generate_games(my_word, word_bank, used, poset):
    """" Recursively generates a poset of the possible games.

    Arguments:
        - my_word [str]: the word to be added to
        - word_bank [list]: a list of valid words that can be considered
        - used [list]: a list of tuples that have already been made
        - poset [list]: a list of tuples representing the poset so far
    """
    while True:
        next_word = new_word(my_word, word_bank, used)
        if next_word is None:
            break
        poset.append(next_word)
        generate_games(next_word[1], word_bank, used.copy(), poset)
#

@void badge

#
Test #1: PASSED!
Correct Answer: [('a', 'at'), ('at', 'cat'), ('cat', 'cats'), ('cats', 'scats'), ('cat', 'scat'), ('scat', 'scats')]
Your Answer:    [('a', 'at'), ('at', 'cat'), ('cat', 'cats'), ('cats', 'scats'), ('cat', 'scat'), ('scat', 'scats')]
Test #2: PASSED!
Correct Answer: [('a', 'ta'), ('ta', 'tav'), ('tav', 'tave'), ('tave', 'taver'), ('taver', 'tavern'), ('tavern', 'taverns')]
Your Answer:    [('a', 'ta'), ('ta', 'tav'), ('tav', 'tave'), ('tave', 'taver'), ('taver', 'tavern'), ('tavern', 'taverns')]
Test #3: FAILED!
Correct Answer: [('a', 'ha'), ('ha', 'hah'), ('hah', 'haha'), ('haha', 'hahah'), ('hah', 'ahah'), ('ahah', 'hahah'), ('ha', 'aha'), ('aha', 'haha'), ('aha', 'ahah'), ('a', 'ah'), ('ah', 'hah'), ('ah', 'aha')]
Your Answer:    [('a', 'ha'), ('ha', 'hah'), ('hah', 'haha'), ('haha', 'hahah'), ('hah', 'ahah'), ('ahah', 'hahah'), ('ha', 'aha'), ('aha', 'haha'), ('haha', 'hahah'), ('aha', 'ahah'), ('ahah', 'hahah'), ('a', 'ah'), ('ah', 'hah'), ('hah', 'haha'), ('haha', 'hahah'), ('hah', 'ahah'), ('ahah', 'hahah'), ('ah', 'aha'), ('aha', 'haha'), ('haha', 'hahah'), ('aha', 'ahah'), ('ahah', 'hahah')]
void badge
main solar
#

na rotisw poio python prepei na katevaso gia na kanw custob bot

smoky dune
#

`import pywhatkit

Send a WhatsApp Message to a Contact at 1:30 PM

pywhatkit.sendwhatmsg("+10121210102102", "Hi", 13, 30)`

how can i use a variable instead of writing the time manually i tried using:

time = "13,30" pywhatkit.sendwhatmsg("+10121210102102", "Hi", time)

and that one did not work

#

i tried using an array too and it was negative

toxic walrus
#
time = (13, 30)
pywhatkit.sendwhatmsg("+10121210102102", "Hi", *time)
#
pywhatkit.sendwhatmsg("+10121210102102", "Hi", time)
#
pywhatkit.sendwhatmsg("+10121210102102", "Hi", (13, 30))
pywhatkit.sendwhatmsg("+10121210102102", "Hi", 13, 30)  # This is what you want
#

!e ```py
print("hello", "world", "lol")

keen onyxBOT
#

@toxic walrus :white_check_mark: Your eval job has completed with return code 0.

hello world lol
toxic walrus
#

!e ```py
msg = "hello"
print(*msg)

keen onyxBOT
#

@toxic walrus :white_check_mark: Your eval job has completed with return code 0.

h e l l o
toxic walrus
#

!e ```py
msg = "hello"
print("h", "e", "l", "l", "o")

keen onyxBOT
#

@toxic walrus :white_check_mark: Your eval job has completed with return code 0.

h e l l o
silent rune
#

print("hello world")

wary adder
#

!e
print("jjdjd")

#

!e
print(gdgd)

keen onyxBOT
#

@wary adder :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'gdgd' is not defined
main solar
#

hello

#

can someone unmute me?

#

@cunning atlas

#

@wanton phoenix

#

I need help with a python assignment'

vague rune
#

@ruby spruce

#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

vague rune
#
def a(): pass

def b():
  a()

def c():
  b()

c()
#
# a.py
def fn_a(): pass

# b.py
from a import fn_a

def fn_b():
  fn_a()

# c.py
## Another way to import
import b
def fn_c():
  b.fn_b()

# main.py
import c
c.fn_c()
rain dune
#

can someone help me with an issue i have with python?

pallid fog
#

Epoch 1/50

ValueError Traceback (most recent call last)
d:\Yazılım\Deep Learning\Giriş 1\DeepLearning1.ipynb Cell 8' in <cell line: 1>()
----> 1 madel_run = model.fit(train_images, train_labels, epochs = 50, validation_data=(test_images, test_labels))

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\utils\traceback_utils.py:67, in filter_traceback.<locals>.error_handler(*args, **kwargs)
65 except Exception as e: # pylint: disable=broad-except
66 filtered_tb = _process_traceback_frames(e.traceback)
---> 67 raise e.with_traceback(filtered_tb) from None
68 finally:
69 del filtered_tb

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\tensorflow\python\framework\func_graph.py:1147, in func_graph_from_py_func.<locals>.autograph_handler(*args, **kwargs)
1145 except Exception as e: # pylint:disable=broad-except
1146 if hasattr(e, "ag_error_metadata"):
-> 1147 raise e.ag_error_metadata.to_exception(e)
1148 else:
1149 raise

ValueError: in user code:

File "C:\Users\Big Chief\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\engine\training.py", line 1021, in train_function  *
    return step_function(self, iterator)
File "C:\Users\Big Chief\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\engine\training.py", line 1010, in step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
File "C:\Users\Big Chief\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\engine\training.py", line 1000, in run_step  **
    outputs = model.train_step(data)
File "C:\Users\Big Chief\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\engine\training.py", line 859, in train_step
    y_pred = self(x, training=True)
File "C:\Users\Big Chief\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\utils\traceback_utils.py", line 67, in error_handler
    raise e.with_traceback(filtered_tb) from None
File "C:\Users\Big Chief\AppData\Local\Programs\Python\Python310\lib\site-packages\keras\engine\input_spec.py", line 264, in assert_input_compatibility
    raise ValueError(f'Input {input_index} of layer "{layer_name}" is '

ValueError: Input 0 of layer "sequential" is incompatible with the layer: expected shape=(None, 28, 28), found shape=(32, 784)
#

help me

keen onyxBOT
#

Hey @pallid fog!

It looks like you tried to attach file type(s) that we do not allow (.ipynb). 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.

vague rune
#

diff.set_axis(['a', 'b'], axis='columns')

#

diff.loc[:,1] = a

#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

vague rune
#

df.iloc[:] = a

copper citrus
#

can anyone help me with code

valid pond
#

@cold plume

vague rune
#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

vague rune
#

@split nimbus

split nimbus
vague rune
#
def calcAverage(list_of_scores):
  pass
#

[1, 2, 3, 4, 5]

#

[90, 80, 70, 55, 76]

#

[90, 91, 87, 73, 85]

eternal vortex
#

reeeeeee

raven bough
cold plume
nocturne verge
#
Bar_Generator(Hours_Left,Hour_Box,(255,255,0),(765 + 16*i),95,12,25)```
#

def Bar_Generator(Bars,Bar_Meter,color,x,y,width,height):
    Bar_Meter = []
    for i in range (1,Bars+1):
        Bar_Meter.append(i-1)
    print(Bar_Meter)
    for i in Bar_Meter:
        pygame.draw.rect(screen,color,[x,y,width,height])
amber epoch
#

!e py result = [*range(10)] #list(range(10)) print(result)

keen onyxBOT
#

@amber epoch :white_check_mark: Your eval job has completed with return code 0.

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
amber epoch
#

Which...

#

You wouldn't even need.

#

There.

thorny reef
#
def Bar_Generator(bars, bar_meter, color, spacing, x, y, width, height):
    bar_meter.append(*range(bars))
    print(bar_meter)
    for i in bar_meter:
        pygame.draw.rect(screen, color, [x + spacing * i, y, width, height])
``` ```py
Bar_Generator(Hours_Left,Hour_Box,(255,255,0),16,765,95,12,25)
nocturne verge
#

but doesn't solve the issue, i think

amber epoch
#

You'd just do for i in range(bars): for your second loop and that's all you'd need. You wouldn't need the first stuff.

#

Though the second loop stuff would still require amendment.

#

Possibly along the lines of Toxic's.

thorny reef
#

!e ```py
def Bar_Generator(bars):
x = 5
spacing = 16
bar_meter = [*range(bars)]
print(bar_meter)
print([x + spacing * i for i in bar_meter])

Bar_Generator(10)

keen onyxBOT
#

@thorny reef :white_check_mark: Your eval job has completed with return code 0.

001 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
002 | [5, 21, 37, 53, 69, 85, 101, 117, 133, 149]
thorny reef
#
source_dictionaries = ['all', 'ahd-5', 'century', 'wiktionary', 'webster', 'wordnet']
wraith sigil
#

if anyone has time this weekend I was wondering if i could go through leetcode questions and meta prep questions
i plan on applying to jobs soon
and was hoping someone could help me along some questions in voice

crisp sapphire
#

is this server actually helpful for learning how to code?

keen pasture
#

i hate it

#

i'm muted

#

this verification system is shit

rotund sequoia
#

@rich quarry could you call and help me with sum?

#

what?

raven bough
#

Why do we get "ValueError: source code string cannot contain null bytes"?

keen onyxBOT
#

:incoming_envelope: :ok_hand: applied mute to @main solar until <t:1650910504:f> (9 minutes and 59 seconds) (reason: newlines rule: sent 101 newlines in 10s).

faint hinge
#

!unmute 312184956942155776

keen onyxBOT
#

:incoming_envelope: :ok_hand: pardoned infraction mute for @main solar.

faint hinge
#

!paste

keen onyxBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

main solar
vital sinew
#
for i, (key, value) in enumerate(colors):
    c =Radiobutton(stephen,text=key,value=value,variable=choose)
    c.place(x = 12,y=i*8)
main solar
solemn breach
#

hello

#

can i be unmuted pls

faint hinge
main solar
#

Hi

median glade
#

couild i join vc for help?

frosty nymph
#

vc help

wraith sigil
#

if anyone wants to go through leetcode problems with me

#

in cod/help

#

that would be great

#

how do i get streaming permissions?

vague rune
round edge
#

how do i replace "and {any capital letter}" with ". {Same capital letter}" using regex

umbral jacinth
#

How can i make my product monitor check if the product status has changed since it was last checked? ie if it goes instock, it will check if it was instock on the previous check, and if not send a discord webhook, but if it was instock it wont?

faint hinge
#

!stream 231588869609488384

keen onyxBOT
#

✅ @pallid ice can now stream until <t:1651244951:f>.

pallid ice
#

!e

def bark():    print("Woof Woof!")    print("Im a Dog")for x in range(1):    bark()def hello():    print("Hello Nick")    print("Hello Wilson")    print("Hows your Day going?")    print("Wonderful so far today")    print("You going to workout this afternoon?")    print("No, Got to pick up my daughter from the baby sitters this afternoon and do some Mowing")for x in range(1):    hello()print(hello)
keen onyxBOT
#

@pallid ice :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     def bark():    print("Woof Woof!")    print("Im a Dog")for x in range(1):    bark()def hello():    print("Hello Nick")    print("Hello Wilson")    print("Hows your Day going?")    print("Wonderful so far today")    print("You going to workout this afternoon?")    print("No, Got to pick up my daughter from the baby sitters this afternoon and do some Mowing")for x in range(1):    hello()print(hello)
003 |                                           ^^^^^
004 | SyntaxError: invalid syntax
pallid ice
#

!e

def bark():
    print("Woof Woof!")
    print("Im a Dog")


for x in range(1):
    bark()


def hello():
    print("Hello Nick")
    print("Hello Wilson")
    print("Hows your Day going?")
    print("Wonderful so far today")
    print("You going to workout this afternoon?")
    print("No, Got to pick up my daughter from the baby sitters this afternoon and do some Mowing")


for x in range(1):
    hello()

print(hello)
keen onyxBOT
#

@pallid ice :white_check_mark: Your eval job has completed with return code 0.

001 | Woof Woof!
002 | Im a Dog
003 | Hello Nick
004 | Hello Wilson
005 | Hows your Day going?
006 | Wonderful so far today
007 | You going to workout this afternoon?
008 | No, Got to pick up my daughter from the baby sitters this afternoon and do some Mowing
009 | <function hello at 0x7f747a6a8ca0>
pallid ice
#
def bark():
    print("Woof Woof!")
    print("Im a Dog")


for x in range(1):
    bark()


def hello():
    print("Hello Nick")
    print("Hello Wilson")
    print("Hows your Day going?")
    print("Wonderful so far today")
    print("You going to workout this afternoon?")
    print("No, Got to pick up my daughter from the baby sitters this afternoon and do some Mowing")


for x in range(1):
    hello()

print(hello)
idle dome
#

def encode_str(strng, shift):
# your code

def decode(arr):
#your code

#

help pls(

pallid ice
#

So this may be alot more complicated than im thinking it would be but how can i make my code uhm Something and not just printed out in my terminal?? Im very new to this like 3 days and the course i just finished had me build a guessing game.... So i would just like to be able to put it on something hell anything lol

#

I know there are probably a billion of these out there i just want to show a small grp of my friends its some cool things IMO

#

@idle dome What does this wrap it in if you dont mind me asking??

idle dome
#

miss

#

i`m verry sorry

#

but this:D

#

help pls

scenic wing
#

!e

keen onyxBOT
#
Missing required argument

code

scenic wing
#

!invite

bronze pier
lunar goblet
#

Hey is hecky here???

bronze pier
#

for x in array:
^

SyntaxError: Unexpected identifier

#
    y = 0
    for x in array:
      y += x
  
    if array == []:
    return 0;
}```
timber current
#

Any can help?

covert raptor
main solar
#

yo can someone explain to me this coding thing :