#off-topic-lounge-text

1 messages Β· Page 33 of 1

primal bison
#

yup

#

it's like this
if u have " strings => u MUST escape ", but you can use ' without escape
if u have ' strings => u MUST espace ', but u can use without " escape

fallen gulch
sage comet
#

I just came here for the vibes tbh πŸ˜‚

#

London here

#

Can't speak I'm suppressed

fallen gulch
primal bison
#

I have a cat :DDD

#

Me 2

fallen gulch
fresh sail
#

!voice

timid fjordBOT
#

Voice verification

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

icy raven
#

You gotta read the rules 😱

sage comet
#

What sza remix is that

icy raven
#

To begin properly, you gotta setup...

primal bison
#

goodbye

#

πŸ˜„

icy raven
#

Bye

candid quest
#

!e while 1:
print("sus")

timid fjordBOT
#

@candid quest :x: Your eval job has completed with return code 143 (SIGTERM).

001 | sus
002 | sus
003 | sus
004 | sus
005 | sus
006 | sus
007 | sus
008 | sus
009 | sus
010 | sus
011 | sus
... (truncated - too many lines)

Full output: too long to upload

sonic violet
#

!e Print "oof"

#

!e print("oof")

#

Anyone know where should I start?

#

I'm new to python

timid fjordBOT
#

@late agate :white_check_mark: Your eval job has completed with return code 0.

hello world
sonic violet
#

U new too?

timid fjordBOT
#

@late agate :white_check_mark: Your eval job has completed with return code 0.

oof
sonic violet
#

!e
X= int(input("2"))

timid fjordBOT
#

@sonic violet :x: Your eval job has completed with return code 1.

001 | 2Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
sonic violet
#

Lmao

#

I joined this server to learn coding

#

Cause discord has pretty good community

#

Who?

#

Whose that?

#

!e
E=1.2
F=1.8
Sum=("E+f")

timid fjordBOT
#

@sonic violet :warning: Your eval job has completed with return code 0.

[No output]
sonic violet
#

Oof

#

!e
Sum=e+f

timid fjordBOT
#

@sonic violet :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 'e' is not defined
sonic violet
#

Is there any tutorials on this server?

teal kettle
#

!e while 1:

#

!e while 1:
print("Sussybakka")

timid fjordBOT
#

@teal kettle :x: Your eval job has completed with return code 143 (SIGTERM).

001 | Sussybakka
002 | Sussybakka
003 | Sussybakka
004 | Sussybakka
005 | Sussybakka
006 | Sussybakka
007 | Sussybakka
008 | Sussybakka
009 | Sussybakka
010 | Sussybakka
011 | Sussybakka
... (truncated - too many lines)

Full output: too long to upload

primal bison
#

!e while True:
pass

timid fjordBOT
#

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

001 |   File "<string>", line 2
002 |     pass
003 |     ^
004 | IndentationError: expected an indented block after 'while' statement on line 1
primal bison
#

!e
while True:
pass

timid fjordBOT
#

@primal bison :warning: Your eval job timed out or ran out of memory.

[No output]
misty storm
#

!e
for i in range(72):
print(i)
i += 1

timid fjordBOT
honest ocean
#

susi baka

#

!e

timid fjordBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

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

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

honest ocean
#

!e print ("Sevo"9

#

e! print ("Sevo")

#

!e print ("Sevo")

timid fjordBOT
#

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

Sevo
honest ocean
#

!e 1st Number = input('1st Number : ')
2nd Number = input('2nd Number : ')
Total=float(1st Number)+float(2nd Number)
print("Total :{0} ".format(Total))

timid fjordBOT
#

@honest ocean :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     1st Number = input('1st Number : ')
003 |     ^
004 | SyntaxError: invalid decimal literal
honest ocean
#

huh

silver solar
#

whoops, that was two hours ago but ok

#

and input wont work here i think

wary lance
#

Hi!

silver solar
#

cf pages supermacy

#

codewars restrict me from using itertools and regex somehow, maybe i should use another platform :/

timber heart
#


def custom_input(requirement_type):  
    input_result = input(f"Input with the requirement of {requirement_type}: ")  
    if requirement_type == "letter": 
        valid = input_result.isalpha() 
    elif requirement_type == "number": 
        valid = input_result.isnumeric() 
    elif requirement_type == "letter_or_number_or_underscore": 
        formatted_input = input_result.replace('_', '')  
        valid = formatted_input.isalnum()  
    elif requirement_type == "email": 
        at_in = "@" in input_result  
        com_in = ".com" in input_result  
        valid = at_in and com_in  
    if not valid: 
        print(f"Requirement for input is not met: {requirement_type}")  #
        custom_input(requirement_type)
    else:
        print(input_result) # => what i just typed
        return input_result  # what it printed just before


result = custom_input("email")
print("Result: ", result) # => None  
wary lance
#

Yea, I hear you.

agile portal
#

i will look atfer trying yself

wary lance
#

This feels pretty optimal to me. Only thing might be to store the difference instead.

#

There might be another way. Parallel sort with indices. And then search for complement would be lienar.

#

Likely overengineering though.

icy raven
#

@atomic phoenix what you doin

wary lance
#

Not for multiple pairs. Just thinking a way to improve the algorithm.

primal bison
#

@timber heart

proud rune
#
import discord
import os
from discord.ext import commands
intents = discord.Intents.all()



client = commands.Bot(command_prefix = ';-;', intents=intents)




@client.command()
async def load(ctx, extension):
    client.load_extension(f'cogs.{extension}')
    
@client.command()
async def unload(ctx, extension):
    client.unload_extension(f'cogs.{extension}')
    
for filename in os.listdir("./cogs"):
    if filename.endswith('.py'):
        client.load_extension(f'cogs.{filename[:-3]}')
        
@client.event
async def on_ready():
    await client.change_presence(status=discord.Status.dnd, activity=discord.Game('Getting developed'))
    print("Yooo Bot is ready")
    
    
    
    
    @commands.command()
    @commands.has_permissions(manage_roles=True)
    async def mute(self, ctx, member: discord.Member, *,reason=None):
      guild= ctx.guild 
      mutedRole = discord.utils.get(guild.roles, name="Muted")
    
      if not mutedRole:
        mutedRole = await guild.create_role(name="Muted")
        
        for channel in guild.channels:
            await channel.set_permissions(mutedRole, speak=False, send_messages=False, read_message_history=True, read_messages=False)
            
            await member.add_roles(mutedRole, reason=reason)
            await ctx.send(f'Muted(member.mention) for reason(reason)')
            await member.send(f'You were muted in the server {guild.name} for (reason)') 

the bot doesnt mute tho when i do
;-;mute @member and it shows no errors also

primal bison
#
    if not valid:
        print(f"Requirement for input is not met: {requirement_type}")  #
        input_result = custom_input(requirement_type)
    else:
        print(input_result) # => what i just typed
    return input_result  # what it printed just before

@timber heart

#

Instead of just calling custom_input, save its return

icy raven
#

@honest pasture I would like to

timber heart
primal bison
#

No need to do checking when having a valid input

timber heart
#

i want to remove the print

primal bison
#

you can

timber heart
#

so

primal bison
#

print does not affect (return) things

timber heart
#
if not valid:
        print(f"Requirement for input is not met: {requirement_type}")  #
        input_result = custom_input(requirement_type)
return input_result  # what it printed just before**
#

yes i know

#

i just dont want to print

#

that was just to test

primal bison
#

Oh

#

yeah, u are right, u can remove the (else)

wary lance
#

Is dictionary lookup O(n)?

timber heart
#

ty

icy raven
#

No

#

O(1)

wary lance
#

Ah, okay.

icy raven
#

Any where it is amortized O(1)

#

in any language

#

even with collisions @agile portal

honest pasture
agile portal
#

so ye its O(1) but it does get slower

honest pasture
icy raven
#

expected in mathematical sense

#

In probability theory, the expected value (also called expectation, expectancy, mathematical expectation, mean, average, or first moment) is a generalization of the weighted average. Informally, the expected value is the arithmetic mean of a large number of independently selected outcomes of a random variable.
The expected value of a random var...

#

O(1) is some constant number of steops

#

not 1 step

#

When we have too many collisions, we just double the size of the table and rehash it

#

It is

full bone
#

πŸ–οΈ

honest pasture
#

πŸ–οΈ

icy raven
#

I'll in 2 min

#

It is like list... you double the size

#

It is called amortized analysis

#

O(1)

#

No... it goes into build cost

#

Then even python list, append is not constant

#

If you play the game long enough, the cost will covered...

#

Some factor

#

In run time... it rebuilds

#

yeah

#

that's why i'm saying it amortized O(1)

#

I don't know... how python implemented it

#

That's why people use B-Trees and stuff in MySQL, instead of hash tables

#

Although, on average, hashtables are O(1)... BST give, log(n), everytime...

#

it is bad for real time systems

honest pasture
icy raven
#

@agile portal a beginner wouldn't use math lib πŸ™ƒ

#

float("inf") ?

#

float inf is just standard spec of float

#

I already did this question, before...

class Solution:
    def findPeakElement(self, nums: List[int]) -> int:
        def recurse(l, r):
            if (l == r):
                return l
            mid = (l + r) >> 1
            if nums[mid + 1] < nums[mid]:
                return recurse(l, mid)
            return recurse(mid + 1, r)
        return recurse(0, len(nums) - 1)
#

binary search...

#

I don't like doing recursive things with loops

#

It feels odd

#

I messed things up with while Truee loops

#

for loop is easu

#

while is not

#

and it is easy to prove things about recursive things and for loops... hard with while stuff

#

yeah...

#

now most langs... are like that

#

no

#

god!!

#

I use for loops, usually... but for loops are not that powerful... when I need more power, I use recursion...

agile portal
icy raven
#

i-1 < 0 is better...

primal bison
#

Yeh

agile portal
#

i just tried doing it as simply as possible

fresh sail
#

@primal bison you have background noise πŸ˜›

primal bison
#

Again😩

vernal snow
#

silicon @agile portal

icy raven
#

I think, it's iframe? @gloomy lily

#

@agile portal you are a web dev, is it iframe?

gloomy lily
honest pasture
agile portal
#

do you mean the carbon thing?

honest pasture
agile portal
gloomy lily
primal bison
#

hey

vernal snow
#

~/.config/picom/picom.conf

honest pasture
#

!e

print(type(2.0//1.0))
timid fjordBOT
#

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

<class 'float'>
icy raven
#

@atomic phoenix 😒 , Just realized, a number palindrome in base 10 is not in base 2... it depends on the base...

icy raven
#
import math
def test(n):
    if n < 0: return False
    return f"{n:b}" == f"{n:b}"[::-1]

def digits(n):
    if n == 0: return 1
    return int(math.log2(n)) + 1

def solve(n):
    if n < 0:
        return False
    bits = digits(n)
    i = bits
    while i > 0:
        r = (n & (1 << i - 1)) >> i - 1
        l = n & 1
        if r != l:
            return False
        n = n >> 1
        i -= 2 
    return True 

for i in range(1000000):
    if test(i) != solve(i):
        print("not working!")

Palindrome in base 2.... Not the question... spent alot of time... thought worth sharing!! @atomic phoenix

icy raven
#

May I critique your solution...

#

You are doing pow(10, ....) everytime in the loop

#

you could start with 1 and multiply 10

#

in someway...

#

there are bigger performance problems (python) ... since you are optimizing for minimum work... I thought that's unnecessary work... exponent is more expensive than multiplication by 10....

#

Both are constant time... but, by definition ... 10^5 = 10 * 10 * 10 * 10 * 10

wary lance
#

There is may be shifting x in each iteration to get rid of the unit digit. Saves having to find low_order

keen mason
#

Yooo

icy raven
#
import time
def exp(x):
    for i in range(x):
        n = pow(10, i)

def my(x):
    n = 1
    for i in range(x):
        n = n * 10

print("Maroloccio's Method")
start = time.time()
exp(10000)
end = time.time()
print(end - start)

print("Charan's Method")
start = time.time()
my(10000)
end = time.time()
print(end- start)
#

@atomic phoenix

#

QED

#

TBH, I don't know how to do it properly.. measuring runtime of of a function...

#

You know better way?

#

okay

honest pasture
icy raven
#

I was about to... I'm searching for this thing, a friend shared... that might be helpful to you @atomic phoenix

dire ember
#

hmm

wary lance
#

I wonder if the accumulator function can be stateless.

icy raven
#

what do you mean by stateless...

#

aren't they stateless...

wary lance
#

Like, parse using only the next letter and value accumulated from the previous letters.

icy raven
#

I don't get you... But I think I understand your point...

#

They are stateless in langs like haskell... since everything is immutable...

#

but in python... if you accumulate things in list... you can't pass around same list... you have to clone it... and that might be the most efficient...

honest pasture
#
In  [2]: "abcdef abcdef".replace("cd", 'yes')
Out [2]: 'abyesef abyesef'                                                                                                          
icy raven
#

I didn't

wary lance
#

Thought of something. Changing algorithm.

timber heart
#

finished the roman to int < 3

honest pasture
#

what is the value of IM according to this? should it be 999?

#

I am confused about the rules - mine would fail if the above is true

#

but it passed the tests

#

is this leetcode oversimplifying the problem, or is it me not knowing how roman numerals would work?

icy raven
#

I forgot how to read roman numbers tbh...

wary lance
#

It probably isn't standard or something.

#

To write IM.

#

I think I have done it. Didn't make an account to test though!

#

Yea.

timber heart
#

IM

#

CMXCIX

wary lance
#

Nice!

icy raven
#

GOD!!!! How did those people come up with such a system!!!

#

They were high when they did that!

twilit echo
#

@final grail you're the most inspiring man i know

wary lance
#

Be back in a bit.

icy raven
#

Floder is a fancy for loop, @timber heart

timber heart
#

???

#

floder

#

?

icy raven
#

Functional way of doing things...

twilit echo
#

@atomic phoenix sushi is my cousin

timber heart
#

and my solution

def roman_to_int(roman_number: str):
    table = {'I': 1,
             'V': 5,
             'X': 10,
             'L': 50,
             'C': 100,
             'D': 500,
             'M': 1000}

    roman_number = roman_number.replace("IV", "IIII")
    roman_number = roman_number.replace("IX", "VIIII")
    roman_number = roman_number.replace("XL", "XXXX")
    roman_number = roman_number.replace("XC", "LXXXX")
    roman_number = roman_number.replace("CD", "CCCC")
    roman_number = roman_number.replace("CM", "DCCCC")
    print(roman_number)
    result_number = 0
    for char in roman_number:
        result_number += table[char]
    return result_number
agile portal
#

the first thing i can easily think of is probably to use a list comp rather than reduce as its more readable atleast to me in this case

wary lance
#

Nice. That is similar to my first algorithm.

#

And then, I noticed that...

#

If you do XI which is 11, followed by V, which gives 14. You can do 11 + V - (XI % V)*2 = 14. With this, you do not need a pair.

honest pasture
#

I absolutely love it - from the tiny knowledge I have of FP - I think you have implemented a semigroup

#

or roughly

dreamy sable
#

If u want to encrypt, you can use AES or RSA

#

IDK which one is better

twilit echo
#

why not SHA-256

honest pasture
#

my solution was just repeatedly popping from a deque

#

but yours is much more elegant

#

I'd post the code but I lost the tab and am currently wasting my life playing a video game

wary lance
#

Probably missed some edge cases.

#

Yea. Much more obvious what is going on in this one. More readable.

honest pasture
#

I really feel like the reducer is just as pleasant to read

#

I'd much rather encounter that in production

twilit echo
#

Yes

wary lance
#

Don't agree with being more pleasant to read. I would prefer reducer in production though. Easier to... test.

honest pasture
#

iteration is very consistently a cause of problems

wary lance
#

Getting infinite loops is scary!

twilit echo
#

no i didnt dude

#

i have stuff to do

#

Keep working dad

icy raven
#

I'll do it!..

twilit echo
#

you are. i know you are ❀️

dreamy sable
#

checksum != encryption

#

a checksum creates A FIXED LENGTH OUTPUT THAT IS THE SAME AS LONG AS THE INPUT IS THE SAME

wary lance
#

Going to make dinner. Have fun!

dreamy sable
#

also if u use SHA

#

use SHA-512

#

its longer thus harder to brute-force create a valid input

#

for passwords

#

if your database gets compromised

twilit echo
#

Cool πŸ™

dreamy sable
#

although for data integrity use SHA-256 or MD5

#

or SHA1

twilit echo
#

@atomic phoenix whats the problem?

#

yes

icy raven
#
from functools import reduce
class Solution:
    def longestCommonPrefix(self, strs: List[str]) -> str:
        def common(a, b):
            if a == "" or b == "" or a[0] != b[0]: 
                return ""
            return a[0] + common(a[1:], b[1:])
        return reduce(common, strs, strs[0])
#

Ik, it's bad... strings are immutable... but we are doing it in functional way!!!!!!!

#

@atomic phoenix you were saying something... I didn't get you...

#

yeah

#

yeah πŸ˜‚

#

@atomic phoenix check dms...

#

same kinda things...

#

okay let's go to next question

#

what do you say

#

functional way?

#

yeah

#

No

#

yep

#

yeah

#

let's go back to leetcode

#

okay

wary lance
#

Does this check letter by letter for every word at the same time?

#

My intuition is that this would be slower that checking word by word.

icy raven
#

yeah

#

functional way is bit tricky.. I didn't normally...

wary lance
#

Because cache. Like checking if books have identical words.

icy raven
wary lance
#

Jumping between books to check the n-th letter is no fun.

#

But comparing just two books is easier.

#

Indeed it would be. One way to mitigate this is to split up the problem.

#

One thousand letters at a time. So a hybrid solution if you will.

#

Matching the solution to the likely input is part of software engineering!

icy raven
#

Both would definitely be same, time complexity wise...

wary lance
#

Yea. Going for a one-size-fit-all solution is sometimes impossible!

icy raven
#
class Solution:
    def isValid(self, s: str) -> bool:
        stack = []
        D = {
            ")" : "(",
            "]" : "[",
            "}" : "{"
        }
        for i in s:
            if i not in D:
                stack.append(i)
            elif stack == [] or stack[-1] != D[i]:
                return False
            else:
                stack.pop()
        if stack == []:
            return True

@atomic phoenix I can't see a elegant way to do it functionally... only way, I can see is to convert that explicit stack into implicit stack with recursion... but code will be messy...I don't see nice 4,5 line recursion here...

#

Do you see any?

#

yeah

#

I tried it... I didn't like it

#

@warm mango

#

@atomic phoenix where can I get those helper points, you always talk about! πŸ™ƒ

#

@dreamy sable then stop doing it...

#

I've recently learned python creator, left python because of that := operator!!!!!!

timber heart
#

yes ?

icy raven
#

It returns the assigned value too...

#

when you do normal assignment...
x = 10 doesn't return anything

#

x := 10 does

timber heart
#

10

icy raven
#

yeah

timber heart
#

10

icy raven
#

sometimes you also want to assign it...

#

I don't use it...

#

x = 10
if x:

works fine for me...

#

@atomic phoenix is there a good reason to use :=?

timber heart
#

to flex

icy raven
#

It can be anything...

#

because there are constant number of things

#

a list, a set, a tuple... it doesn't matter...

#

@timber heart it change... if you want to do it billion times...

#

@atomic phoenix why try statements...

#

in your solution

#

It's not about cheap... I don't like those try except!

#

yeah

quartz breach
#

@atomic phoenix what are you trying to create

icy raven
#

old habbit!

#

type charlie it's working for me...

#

it showed up when you did charlie

#

reaper is hard...

timber heart
#

@atomic phoenix

icy raven
#

@atomic phoenix

timber heart
icy raven
#

all ListNodes are same..

#

@atomic phoenix

#

as far as I see...

#

create a class there...

#

class ListNode:

def init(self, val=0, next=None):

self.val = val

self.next = next

@atomic phoenix

#

since they are not providing any methods.... they are just providing constructor... it will work..

#

I got you... you can't test it...

#

you gotta write some function to make list into linkedlist...

brittle iron
#

whats going on

icy raven
#

I did

keen sail
#

Hello babe

#

wanna see my self live

dreamy sable
keen sail
#

???

dreamy sable
keen sail
#

means wanna see my self live in the screen

#

where is the problem

#

bcz there is no problem

icy raven
#
def convert(A):
    head = ListNode()
    tail = head
    for i in A:
        tail.next = ListNode(i)
        tail = tail.next
    return head.next
#

It takes a list and gives a linkedlist

#

use this to convert... @atomic phoenix in those tests...

#

you are doing some kinda assert equals right...

#

but leetcode input format is list right...

#

covert it...

#

leetcode input format...

#

input is linked list.... but for you it looks like list right...

#

It is cooler in haskell!!!!!!!! @atomic phoenix

#

return type is also ListNode ... you are appending here...

#

okay

young wraith
#

is this is a leet-code/interview question ?

icy raven
#

πŸ™ƒ , you are welcome!!!

#

@graceful gale can you get this message to him

young wraith
icy raven
#

yeah

#

it takes a list and gives a liniked list

icy raven
#

I didn't implemented it as a method

#

you gotta make some changes...

#

I thought... when you pass in input you gonna change it...

#

in assert

#

just put self

#

okay...

#

all linked list are same....

#

and can you show me that again...

#

constructor...

#

yeah... when it is none... it's empty

#

Just use leetcode... maybe

mild goblet
#

anyone knows how to mod a exe file ?

icy raven
#

@atomic phoenix There is better way to structure it... look at my code...

mild goblet
icy raven
#

Structure

#

You already did solve it....

#

Ah... okay...

#

Better way to structure is ....
instead of head = None

head = ListNode()
and return head.next

#

I think that's what you are looking for...

#

now you don't have to do alot of checking...

#

I used to do that... with alot of None checking... A friend showed me this trick...

#

No a dummy first node...

#

and return head.next

#

yeah...

#

so you don't have to check for head == None

#

default value is 0

#

look at construcutor

#

It passed all

#

When you do
head = ListNode()

you have next property

#

none don't have it

#

so you can add merged list to it and return head.next

#

head = ListNode()
tail = head

return head.next

#

yep...

#

I remember, you have ipad right... you can airplay it...

#

yeah

#

yeah

#

yep

#

yep..

#

No we clone it...

#

we just create a new node with that val

#

No...

#

With that tail.next = ListNode(l1.val)

#

yep

#

you can do this also.... Ig

#

we can carefully do some transactions..

delicate hearth
#

that's trippy

icy raven
#

yeah...

#

tail.next.next == None

#

argree

#

yeah.. you want to do it inplace

#

we can also like as you said...

#

it's not that different..

#

yeah...

#

yeah got it...

#

potrait is better

#

because, I'm on laptop

#

half is video and half is chat

#

yeah

#

yeah

#

you can still make a dummy to avoid... none checking... and do it inplace

#

return head.next

#

you only create 1 listnode...

#

since it is always sorted...

#

if one is none... just add other to ans

#

yep

#

yep

#

what app is it?

#

you gotta change the cover image, ig... logo is invisible

#

@atomic phoenix

#

yep

#

You don't have worry about both None

#

because you add only None to ans

#

yeah

#

I changed it to in place, it's alot faster

#
class Solution:
    def mergeTwoLists(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
        head = ListNode()
        tail = head
        while True:
            if not l1:
                tail.next = l2
                break
            if not l2:
                tail.next = l1
                break
            if l1.val < l2.val:
                tail.next = l1
                l1 = l1.next
            else:
                tail.next = l2
                l2 = l2.next
            tail = tail.next
        return head.next
#

agreed

#

you don't have to do it...

#

look at mine... it is already sorted list..

#

so you can add that pointer to end of ans

#

once l1 is empty... you know rest of l2 is sorted... you can just add it

#

to the end...

#

yep

#

what do you have list1, list2... when you have l1, l2

#

you don't need them...

#

ah,, match syntax

#

@atomic phoenix l1 = l1.next

#

not list1 = l1.next

#

tail.next = l1
l1 = l1.next
and in this order

#

coming things are l1, l2

#

open leetcode

#

you have to make choice... either l1, list1

#

in leetcode it is l1

#

oops, I might have changed it...

#

it is l1... too big... I changed it...

#

sorry my bad...

#

okay.. make everyting list1 now...

#

Yep...

#

I have...

#

But not in pyton

#

I used it in haskell

#

yep...

#

yep...

graceful gale
#

What line of code can I put in my IDE to simulate the leetcode "run code" button?

#

CTRL + '/' to comment out code in Leetcode.

icy raven
#

done

#

yeah...

#

try without enumberate

#
class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        index = 1
        n = len(nums)
        for i in range(1, n):
            if nums[i] != nums[i - 1]:
                nums[index] = nums[i]
                index += 1
        return index
#

yep

#

yeah...

#

I agree

#

@atomic phoenix don't use remove method πŸ˜‚ ...

#

I was kidding

#

No

#
class Solution:
    def removeElement(self, nums: List[int], val: int) -> int:
        idx = 0
        for i in range(len(nums)):
            if nums[i] != val:
                nums[idx] = nums[i]
                idx += 1
        return idx
#

instead of v, use num

#

for i, num in enumerate(nums)

#

When I write code for real... not for leetcode.... I alway try to use plurals for list.. and singular for element

#

I already did this... code is shit... though...

#

But I'm proud of that solution...

#

yeah

#

okay...

graceful gale
#

Can somebody explain to me what "Optional" is?

#

omg fuck dat leet code.

keen mason
#

who knows how to install lolcat on kali

keen mason
vital tide
#

heyo

sage axle
#

@spark hatch

primal bison
#

Hello, can someone help me with making snake game in Pyhon and with pgame?

young wraith
primal bison
#

I have opened a window, but I dont know how I need to make the snake etc.

young wraith
primal bison
#

I have already watched all of them

#

But they are each different. I'm not allowed to take over

#

Thats why I am looking for someone who knows about coding games in Python and with pygame

young wraith
primal bison
#

I did but no one is helping

young wraith
primal bison
#

Thats okay I think

#

Its not really necessary to use pygame, just an extra

#

Can you help me?

primal bison
young wraith
primal bison
#

I know about Python like if statements, booleans, while loop for loop etc

#

But making a game, its something really different

primal bison
young wraith
alpine compass
#

@agile portal
sorry i am late but is this solution solves the previous problem
i don't have permisiion to speak in vc.

valid_input=False
while not valid_input:
    foo=input("enter a valid number")
    if(foo.isdigit()):
        foo=int(foo)
        valid_input=True
   else:
       print("pls enter a vlaid input")
#

@pine otter use nested loop

placid elm
#

!e
print ("what are you doing right now??
")

timid fjordBOT
#

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

001 |   File "<string>", line 1
002 |     print ("what are you doing right now??
003 |            ^
004 | SyntaxError: unterminated string literal (detected at line 1)
timid fjordBOT
#

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

001 |   File "<string>", line 1
002 |     the_world = ("what are you doing right now?
003 |                  ^
004 | SyntaxError: unterminated string literal (detected at line 1)
#

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

001 |   File "<string>", line 1
002 |     the_world = (what are you doing right now?
003 |                  ^^^^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
golden adder
#

print ("wassup")

high wedge
#

!e
import pysimplegui

#

!e

from os import system as sys
sys("clear")
#

!e

from dataclasses import dataclass

@dataclass
class Quadrilateral:
    
    a : int
    b : int

    def add(self):
        return self.a + self.b

quadrilateral = Quadrilateral(1, 2)
print(quadrilateral.add())
toxic aurora
#

what is everybody up to

lyric phoenix
#

i dunno maybe create replit project that everybody could code given 1 problem or smh

short ingot
#

anyone help

#

i want to remove

#

remove_ from numbers

#

dont know where to start

high wedge
rocky gorge
rocky gorge
#

@primal monolithone, why i can't turn on my mic on vc?

keen mason
rocky gorge
#

visual studio i guess

timid fjordBOT
#

Hey @cunning portal!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

rocky gorge
#

ohh, thx

lucid yoke
#

sooooo usfull channel

#

where I can Learn The Python As Well ?

tepid mauve
#

y0utube

agile portal
timid fjordBOT
#
Resources

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

mild badger
# short ingot

have you tried a for cycle on the list "numbers" to see if anyone of them is inside "remove_" list?

wicked nebula
#

@agile portal which language of programme it is

agile portal
#

the one i'm using rn is lua

wicked nebula
#

ok

mossy gull
#

!e

timid fjordBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

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

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

mossy gull
#

!e print(β€œHi”)

timid fjordBOT
#

@mossy gull :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(β€œHi”)
003 |           ^
004 | SyntaxError: invalid character 'β€œ' (U+201C)
primal bison
#

guys anyone knows django authentication ?

mossy gull
#

!e print(hi)

#

!e print("Hello World")

#

!e 98*4

#

!e print(98*4)

mossy gull
#

!e print(9193884748283482848838292920384382910493829492982944938934949283949* 9193884748283482848838292920384382910493829492982944938934949283949)

timid fjordBOT
#

@mossy gull :white_check_mark: Your eval job has completed with return code 0.

84527516764719640784588304123742187110122475512042158083609737822326687820677932544226001359776080628034428024578918563880747829034601
mossy gull
#

!e while True: print(β€œHello World!”)

timid fjordBOT
#

@mossy gull :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     while True: print(β€œHello World!”)
003 |                       ^
004 | SyntaxError: invalid character 'β€œ' (U+201C)
mossy gull
#

!e while True: print(9284829472859384729*91938294828)

shut widget
#

FUCK YEAH

timid fjordBOT
#

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

shadow ivy
#

!unmute 949246720099889163

timid fjordBOT
#

:x: There's no active mute infraction for user @shut widget.

sour goblet
#

import discord
import os
import time
import discord.ext
from discord.utils import get
from discord.ext import commands, tasks
from discord.ext.commands import has_permissions, CheckFailure, check

client =

client = commands.Bot(command_prefix = '!'), discord.Client()

@client.event
async def on_ready():
print("bot online")
async def join_vc(ctx):
channel = client.get_channel(959704295903748137)
await channel.connect()

@client.command()
async def ping(ctx):
await ctx.send("pong!")

async def kick(ctx, member : discord.Member):
try:
await member.kick(reason=None)
await ctx.send("kicked "+member.mention)
except:
await ctx.send("bot does not have the kick members permission!")

client.run(os.getenv("token"))

#

!d import discord
import os
import time
import discord.ext
from discord.utils import get
from discord.ext import commands, tasks
from discord.ext.commands import has_permissions, CheckFailure, check

client =

client = commands.Bot(command_prefix = '!'), discord.Client()

@client.event
async def on_ready():
print("bot online")
async def join_vc(ctx):
channel = client.get_channel(959704295903748137)
await channel.connect()

@client.command()
async def ping(ctx):
await ctx.send("pong!")

async def kick(ctx, member : discord.Member):
try:
await member.kick(reason=None)
await ctx.send("kicked "+member.mention)
except:
await ctx.send("bot does not have the kick members permission!")

client.run(os.getenv("token"))

timid fjordBOT
#

7.11. The import statement


import_stmt     ::=  "import" module ["as" identifier] ("," module ["as" identifier])*
                     | "from" relative_module "import" identifier ["as" identifier]
                     ("," identifier ["as" identifier])*
                     | "from" relative_module "import" "(" identifier ["as" identifier]
                     ("," identifier ["as" identifier])* [","] ")"
                     | "from" relative_module "import" "*"
module          ::=  (identifier ".")* identifier
relative_module ::=  "."* module | "."+
```...
sour goblet
#

!r import discord
import os
import time
import discord.ext
from discord.utils import get
from discord.ext import commands, tasks
from discord.ext.commands import has_permissions, CheckFailure, check

client =

client = commands.Bot(command_prefix = '!'), discord.Client()

@client.event
async def on_ready():
print("bot online")
async def join_vc(ctx):
channel = client.get_channel(959704295903748137)
await channel.connect()

@client.command()
async def ping(ctx):
await ctx.send("pong!")

async def kick(ctx, member : discord.Member):
try:
await member.kick(reason=None)
await ctx.send("kicked "+member.mention)
except:
await ctx.send("bot does not have the kick members permission!")

client.run(os.getenv("token"))

glacial quest
#

!e print(β€œHello World!”)

timid fjordBOT
#

@glacial quest :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(β€œHello World!”)
003 |           ^
004 | SyntaxError: invalid character 'β€œ' (U+201C)
glacial quest
#

eh

#

can this bot run python code

#

okie

keen mason
rocky gorge
#

dunno

mortal furnace
#

guys anyone help

calm bay
#

dgg to delete everything above cursor to start of file

worthy token
#

is grey lines/green lines in python? // in C++ its backslash?

#

change #include to import? πŸ˜„

#

from Cpp to python?

#

Nice watch good night πŸ˜„

sage axle
#

fatal: The current branch 2079 has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin 2079
sage axle
#

!resources data science
Hey check these out @unborn sorrel

timid fjordBOT
#
Resources

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

whole pilot
#

no

#

i use flask

plucky wind
#

flask?

green minnow
#

@plucky wind its a jd framework

unborn sorrel
#

2

primal bison
#

I'm going to start a new project on a trading Binance bot, anyone wanna work together?

rancid vessel
#

!e from tkinter import Tk, Button, Label, CENTER

will = 0
will_add = 1
will_price = 100

root = Tk()

root.title("Wills Code Window")
root.geometry("500x500")
root.resizable(False, False)

label2 = Label(text="Increase Unavailable", font=("Roboto", 20))
label2.place(x=245, y=190, anchor=CENTER)

def increase_avaible():
if will >= will_price:
label2.config(text="Increase Available")

def on_button():
global will
print("You Have Clicked "+str (will))
will += will_add
label1.config(text=f"Willies: {will}")
increase_avaible()

bclicker1 = Button(root, text="Click", width=15, height=5, command=on_button)
bclicker1.place(x=200, y=250, anchor=CENTER)

label1 = Label(text="Welcome To Wills Cookie Clicker", font=("Roboto", 20))
label1.place(x=245, y=150, anchor=CENTER)

def button_reset():
global will
global will_add
global will_price
print("You Have Reset Your Count: "+str (will))
will = 0
will_add = 0
will_price = 0
label1.config(text=f"Willies: {will}")

bclicker2 = Button(root, text="RESET", width=15, height=5, command=button_reset)
bclicker2.place(x=301, y=250, anchor=CENTER)

def button_mult():
global will_add
global will_price
global will

if will >= will_price:
    will_add += 1
    will -= will_price
    will_price *= 2
    label1.config(text=f"Willies: {will}")
    label2.config(text="Increase Unavailable")
else:
    print("Not enough Willies")

bclicker3 = Button(root, text="Increase Click By 2", width=15, height=5, command=button_mult)
bclicker3.place(x=247, y=335, anchor=CENTER)

root.mainloop()

primal bison
#

!e from tkinter import Tk, Button, Label, CENTER

will = 0
will_add = 1
will_price = 100

root = Tk()

root.title("Wills Code Window")
root.geometry("500x500")
root.resizable(False, False)

label2 = Label(text="Increase Unavailable", font=("Roboto", 20))
label2.place(x=245, y=190, anchor=CENTER)

def increase_avaible():
if will >= will_price:
label2.config(text="Increase Available")

def on_button():
global will
print("You Have Clicked "+str (will))
will += will_add
label1.config(text=f"Willies: {will}")
increase_avaible()

bclicker1 = Button(root, text="Click", width=15, height=5, command=on_button)
bclicker1.place(x=200, y=250, anchor=CENTER)

label1 = Label(text="Welcome To Wills Cookie Clicker", font=("Roboto", 20))
label1.place(x=245, y=150, anchor=CENTER)

def button_reset():
global will
global will_add
global will_price
print("You Have Reset Your Count: "+str (will))
will = 0
will_add = 0
will_price = 0
label1.config(text=f"Willies: {will}")

bclicker2 = Button(root, text="RESET", width=15, height=5, command=button_reset)
bclicker2.place(x=301, y=250, anchor=CENTER)

def button_mult():
global will_add
global will_price
global will

if will >= will_price:
    will_add += 1
    will -= will_price
    will_price *= 2
    label1.config(text=f"Willies: {will}")
    label2.config(text="Increase Unavailable")
else:
    print("Not enough Willies")

bclicker3 = Button(root, text="Increase Click By 2", width=15, height=5, command=button_mult)
bclicker3.place(x=247, y=335, anchor=CENTER)

root.mainloop()

timid fjordBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "/usr/local/lib/python3.10/tkinter/__init__.py", line 37, in <module>
004 |     import _tkinter # If this fails your Python may not be configured for Tk
005 | ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
primal bison
#

!e print("123")

timid fjordBOT
#

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

123
primal bison
#

!e input("What: ")

timid fjordBOT
#

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

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

!e from tkinter import *
window = Tk()
window.mainloop()

timid fjordBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "/usr/local/lib/python3.10/tkinter/__init__.py", line 37, in <module>
004 |     import _tkinter # If this fails your Python may not be configured for Tk
005 | ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
primal bison
#

!e print(eval("1+1"))

timid fjordBOT
#

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

2
primal bison
#

!e from math import *
print(pi)

timid fjordBOT
#

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

3.141592653589793
primal bison
#

!e "5+5"

timid fjordBOT
#

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

[No output]
primal bison
#

!e 5+5

timid fjordBOT
#

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

[No output]
primal bison
#

!e print(e)

dapper garnet
#

!e print('test')

heavy crane
#

!e print("bestty")

#

!e print("my discord bot is wet")

timid fjordBOT
#

@heavy crane :white_check_mark: Your eval job has completed with return code 0.

my discord bot is wet
cinder mist
#

!e print("Hello World")

frozen haven
#

I cant hear you properly

#

your mic is no noisy

silk arrow
#

ehhhh

frozen haven
#

I hear bzzz sound onnly

#

from your mic

#

no

#

its so noisy

#

haha

#

its so noisy

#

i hear your voice so discrupt

#

ed

#

I can't hear you

#

seriously

#

oh I see I can hear your laptop fan

#

can you use headphone

#

so its noisy

#

come top

#

ask them

silk arrow
#

damn

dense flame
#

can

#

tell me someone

#

how i can use voice

#

in channel

#

@craggy carbon

craggy carbon
#

@dense flame yes

craggy carbon
long rapids
long rapids
# silk arrow ehhhh

Sorry about that. If you can, enable "Noise Suppression powered by Krisp".

buoyant kestrel
sour hollow
#

hi guys

jagged granite
buoyant kestrel
#

I don't think the ones they're dealing with are that large.... I hope

#

It's been our business services folks who are running into it

jagged granite
#

I actually need more than this
There are different versions of the API that provide different amounts of information about the objects, but Excel can't handle that much data.
I wrote a wrapper that downloads all records to SQLite, I need to bite the bullet and sit down and write the parser to pull the information I need

#

Want a new project to help with?

#

Or just yell at me to be productive
That'd probably work too

sour hollow
#

me not talking

#

@frozen haven

#

sorry @frozen haven

frozen haven
#

its okay πŸ™‚

sour hollow
#

thanks

#

l am from istanbul is turkey

frozen haven
#

wow nice

heavy topaz
#

!e print("daddy")

timid fjordBOT
#

@heavy topaz :white_check_mark: Your eval job has completed with return code 0.

daddy
heavy topaz
#

!e print("python bot dumb")

timid fjordBOT
#

@heavy topaz :white_check_mark: Your eval job has completed with return code 0.

python bot dumb
heavy topaz
#

!e print("big chungus is awesome and cool")

timid fjordBOT
#

@heavy topaz :white_check_mark: Your eval job has completed with return code 0.

big chungus is awesome and cool
lucid python
#

!e print("Python World")

timid fjordBOT
#

@lucid python :white_check_mark: Your eval job has completed with return code 0.

Python World
primal bison
#

import lightbulb
import hikari
import random
bot = lightbulb.BotApp(token='', prefix = "!")

@bot.listen(hikari.StartedEvent)
async def on_started(event):
print("start")
bot

r1 = random.randint(1, 100)

print("Random number between 5 and 15 is % s" % (r1))

@bot.command
@lightbulb.command('kill', 'does what it says')
@lightbulb.implements(lightbulb.PrefixCommand)
async def kill(ctx: lightbulb.Context) -> None:
await ctx.respond("kills you")
bot

@bot.command
@lightbulb.command('gay', 'you gay?')
@lightbulb.implements(lightbulb.PrefixCommand)
async def gay(ctx: lightbulb.Context) -> None:

await ctx.respond("Your gay Percentage is % s" % (r1))

bot.run()

bright skiff
#

!code

timid fjordBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

unreal wadi
#

so sad my audio is suppressed ha!

#

Anyways, greetings everyone.

primal bison
#

!e import random
def what_happens():
what_happen = random.randint(1, 9999999999)
return what_happen
while True:
print(str(what_happens()))

timid fjordBOT
#

@primal bison :x: Your eval job has completed with return code 143 (SIGTERM).

001 | 9766713384
002 | 9613342695
003 | 7814648693
004 | 4943741273
005 | 5953353648
006 | 6405603180
007 | 6955136268
008 | 67430724
009 | 5542029079
010 | 4984812088
011 | 6749166230
... (truncated - too many lines)

Full output: too long to upload

primal bison
#

!e import time
time.sleep(99)
print("hello")

timid fjordBOT
#

@primal bison :warning: Your eval job timed out or ran out of memory.

[No output]
primal bison
#

:(

#

!e answer = input()

timid fjordBOT
#

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

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

?

somber musk
#

!e test = input("test") print(test)

timid fjordBOT
#

@somber musk :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     test = input("test") print(test)
003 |                          ^^^^^
004 | SyntaxError: invalid syntax
somber musk
#

!e test = input("test")
print(test)

timid fjordBOT
#

@somber musk :x: Your eval job has completed with return code 1.

001 | testTraceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | EOFError: EOF when reading a line
wet moth
#

!e question1 = int(input("What is 2 + 2?"))
print(question1)

#

!e print("hello world")

#

πŸ™‚

#

!e a = int(input("enter number"))
b = int(input("enter second number"))
print(a + b)

#

!e a = 1
b = 1
print(a + b)

timid fjordBOT
#

@wet moth :white_check_mark: Your eval job has completed with return code 0.

2
wet moth
#

yoo

#

!e import math
a = 67
print(f'{a} factorial is {math.factorial(a)}')

timid fjordBOT
#

@wet moth :white_check_mark: Your eval job has completed with return code 0.

67 factorial is 36471110918188685288249859096605464427167635314049524593701628500267962436943872000000000000000
wet moth
#

!e import math
a = 676
print(f'{a} factorial is {math.factorial(a)}')

timid fjordBOT
#

@wet moth :white_check_mark: Your eval job has completed with return code 0.

676 factorial is 18837076841338098831631946502133679752775271363224741858716345371407282033097292730599416302262171748290957921103528196591392861507500824518988967688966916359624032206860634966843747432148697259354246645925344268167298729165308169292992442577858071994436282885840244262495093411188499180250476616063782119317350321221953996342974132759357732916063868147989178924590001010919802612030853406469552341407597023997935813719227154968650674205424600650441415221431155463636095327647889367710873643701162210934115855409138653903155976150466598193389511941024933011950512858916153180139104828249829267481847294571715377527508363338986460670601841954327102737584352972996463528053047436577158048125906693505259934633302120198215660046590792966117499697913607746327891270580423426879310749381564190608843884467754576776063403169281282042637287141665723851293820932576516339136451526141061766024209927597359638049451157569613731215506279692713997850312017855345578024590455099507305768001826968
... (truncated - too long)

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

cobalt otter
#

!e print("u r cool")

timid fjordBOT
#

@cobalt otter :white_check_mark: Your eval job has completed with return code 0.

u r cool
cobalt otter
#

!e print('i'm dumb')

timid fjordBOT
#

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

001 |   File "<string>", line 1
002 |     print('i'm dumb')
003 |           ^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
gleaming dirge
#

print("Hello")

#

!e print("u r cool")

north pilot
terse jay
#

help 😰

#

i wanted to wget a something in git bash and now my computer only does ding ding ding ding

past crow
#

!e

l = "good"
n = ["This is a good game!"]
print(l in n)
#

FALSE

light garden
#

!e

l = "good"
n = ["This is a good game!"]
n=" ".join(map(str,n))
n=n.split()
print(l in n)```
True
lofty tulip
#

@subtle palm

primal bison
#

!invis

#

!invisible

#

!embed

#

!color

crude moat
#

Hi, how do I gain voice privileges for voice chats?

primal bison
#

you have to have 50 messages in non bot chats

honest trench
#

hello everyone I am a student and I desire to learn python but I am having a hard time finding resources to learn the well-known programming language so can you guys tell me how to learn python

spare dust
#

@honest trench youtube has some full courses, i took pierrians course on udemy, cost me 15 bucks and it got me all the basics

steady cairn
#

a=6
b=4
print(a+b)

#

!e print("trying first time")

timid fjordBOT
#

@steady cairn :white_check_mark: Your eval job has completed with return code 0.

trying first time
topaz falcon
#

how to get a hastin here for my code

worn vector
#

!e print(β€œNVDA calls”)

timid fjordBOT
#

@worn vector :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(β€œNVDA calls”)
003 |           ^
004 | SyntaxError: invalid character 'β€œ' (U+201C)
worn vector
#

A=6

#

B=4

#

!e

timid fjordBOT
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

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

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

tardy shard
#

!e
class Bot:
def boost(self, health, power):
health+=5
power+=5
print("Boost gained!\n")

if 1==1:
Bot.boost()

timid fjordBOT
#

@tardy shard :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 8, in <module>
003 | TypeError: Bot.boost() missing 3 required positional arguments: 'self', 'health', and 'power'
primal bison
#

!e import math
a = 69
print(f'{a} factorial is {math.factorial(a)}')

timid fjordBOT
#

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

69 factorial is 171122452428141311372468338881272839092270544893520369393648040923257279754140647424000000000000000
primal bison
#

!e import math
a = 420
print(f'{a} factorial is {math.factorial(a)}')

timid fjordBOT
#

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

420 factorial is 1179832395293178259148587778443982767423908163629667689799210969550884231351169347804766799500510294050388349696532084729374087533384204019322892961178819464698121263533012685335273004294789382652477324465427001701326230145911466316029644714371748823861128004214806081770714277374544632880180009063325310867611466814559562175609414340177417478580290981292661586700768075544788360242053436899439186009859147147653878644064667799709427693731208035920284052203131022083688425805265631534978481761954009800546844281261649619610291306374918025956972209823833523561696079181976208783662818235613615149296343931089295234402130043253489826928097199211074340929916161625854705227595565090740962113793308742649598603963747960941063835474664306971892700806057422478626083960243385932102946293048920279760860198799159782580284293120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
primal bison
#

woah

#

!e import math
a = 51
print(f'{a} factorial is {math.factorial(a)}')

timid fjordBOT
#

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

51 factorial is 1551118753287382280224243016469303211063259720016986112000000000000
primal bison
#

!e import math
a = 627
print(f'{a} factorial is {math.factorial(a)}')

timid fjordBOT
#

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

627 factorial is 24092916381260180160497479539564348437845164030340370372757332871567051428575206652135303470288745326647105347735146512246489569644642583268394081935817852803872382699236808257195450053625854531614829292697834551216020071177044557613689682964303281564211084635940459614394854478977393073666976717360884720362039636353228931481642112416050337033849896820619466840256744804128201863695578234098333299881039593684354655943944526395407286731660928658434379813372447154804064541425910505908226484422688711389170885442592242737684103015371862381531176065702583946741024167129127734451191554175945713104848656724598174533938207224575149060013000012503929539093591648586076790646837982546485798443629815564910180792972316453927158577033777440544587736400543053422725341089708835893716001723030087010307181194281651509859555146285145255352321999682157130608939103356893525914061520140530341882431649547073393176255324135564497495730231181478463515094768728944441103163944883413938946664295496
... (truncated - too long)

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

primal bison
#

!e print([i for i in range(10e15])

timid fjordBOT
#

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

001 |   File "<string>", line 1
002 |     print([i for i in range(10e15])
003 |                                  ^
004 | SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
primal bison
#

!e print([i for i in range(10e15)])

timid fjordBOT
#

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

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: 'float' object cannot be interpreted as an integer
primal bison
#

!e print([i for i in range(10_000_000_000_000_000_000_000_000)])

timid fjordBOT
#

@primal bison :warning: Your eval job timed out or ran out of memory.

[No output]
primal bison
#

!e print([x for x in {'apple', 'orange' , banana'}])

timid fjordBOT
#

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

001 |   File "<string>", line 1
002 |     print([x for x in {'apple', 'orange' , banana'}])
003 |                                                  ^
004 | SyntaxError: unterminated string literal (detected at line 1)
primal bison
#

!e print([x for x in {'apple', 'orange', 'banana'}])

timid fjordBOT
#

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

['banana', 'orange', 'apple']
neat hound
#

!e print("Hello world!")

timid fjordBOT
#

@neat hound :white_check_mark: Your eval job has completed with return code 0.

Hello world!
pearl ibex
#

!e n =5
print(n)

#

!e print("Hello there")

timid fjordBOT
#

@pearl ibex :white_check_mark: Your eval job has completed with return code 0.

Hello there
radiant depot
#

!e

import asyncio
import httpx

urls = ['https://en.wikipedia.org/wiki/Discord',
        'fjkdsfs'
        'https://en.wikipedia.org/wiki/Python']


async def get_page(url):
    async with httpx.AsyncClient() as client:
        
          resp = await client.get(url)
          resp.raise_for_status()
          return resp


async def main():
    responses = await asyncio.gather(
        *[get_page(url) for url in urls]
    )
    return responses

print(asyncio.run(main()))
primal bison
#

!e print("gib")

timid fjordBOT
#

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

gib
primal bison
#

pro

primal bison
#

!e from pynput.keyboard import Key, Controller
import pyautogui as pg
import time

varables

keyboard = Controller()

LoopTime = 5
#Mouse movent step 1
time.sleep(1)
pg.moveTo(x=525, y=880)
pg.rightClick(x=525, y=880)
time.sleep(1)
pg.moveTo(x=525, y=780)
pg.click(x=525, y=780)
time.sleep(1)

Press and release enter and type youtube.com

time.sleep(1)
keyboard.type('youtube.com')
time.sleep(1)
keyboard.press(Key.enter)
keyboard.release(Key.enter)

time to to the next phase of mouse movent

time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)
time.sleep(3)
pg.click(x=436, y=302)
time.sleep(4)
pg.click(x=1080, y=741)

timid fjordBOT
#

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

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

guys can you join my server if you use repl.it?

#

or if youre a pro at pro-gramming ;)

boreal seal
#

!e print("Cool")

timid fjordBOT
#

@boreal seal :white_check_mark: Your eval job has completed with return code 0.

Cool
#
Missing required argument

code

#
Command Help

!eval <code>
Can also use: e

*Run Python code and get the results.

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

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

primal bison
#

!e print("hx7")

#

!e print("hx7")

timid fjordBOT
#

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

hx7
#

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

Cool
primal bison
#

!e print("Cool")!e print("Cool")

timid fjordBOT
#

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

001 |   File "<string>", line 1
002 |     print("Cool")!e print("Cool")
003 |                  ^
004 | SyntaxError: invalid syntax
#

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

Cool
#

@primal bison You've already got a job running - please wait for it to finish!

#

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

#

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

Cool
proven basalt
#

what r u coding? just curious cause im new to coding

proven basalt
#

idk how u guys can code for so long, ive been trying to code for 2hrs and my brain is fried

proven basalt
#

wicked

#

ill try it out, want to play tomb raider with pointy boobs

#

pycharm

#

@hasty jungle

#

i cant code shit though

#

@night oyster wait my fortnite skins wont get chicks

#

i think i actually figured out my code problem, my first one

#

@hasty jungle love jack

#

Emotive yet chill, this radio plays a hand-picked selection of relaxing instrumental tracks that help to improve focus and increase concentration. No prominent lyrics, minimal arrangement, catchy rhythms, and chunky basslines of future garage and chillstep make this mix an ideal background for work and study sessions. The futuristic atmosphere c...

β–Ά Play video
#

@gloomy lily @hasty jungle

primal bison
#

hi guys

proven basalt
#

hi

twilit echo
#

@hasty jungle smart man

#

figure out my problem

proven basalt
#

lol

#

i was about to say that as well im stuck in an endless loop :/

twilit echo
#

i am trying to use a visualisation tool

#

and i need large datasets/logs

#

and my pc is only 2 months old

#

So i need any kind of log file, auth log, wifi log etc

#

but i dont know where i can find these?

#

it needs to be large because i will be filtering things down, and i need that still to be large enough to plot

#

Can anyone give me ideas?

#

where can i find large log files to analyse?

#

@hasty jungle Lapinga

primal bison
#

guns

#

'

#

N

twilit echo
#

help guys

primal bison
#

roses <33

#

@hasty jungle how are you? :D

#

@final grail hello

#

everything

#

so

#

let's sing a How You Remind Me

hasty jungle
#

oh wait

#

i didnt know this existed

primal bison
#

hmm
maybe Welcome To The Jungle

#

:o

#

how

#

xd

#

πŸ˜…

#

I have to go

#

so

#

goodbye

gloomy lily
#

@calm bay let's do emulator

calm bay
spark gull
#

what are you guys doing?

indigo willow
#

how to make a log in page

proper cobalt
#

what is this superscript

calm bay
#

@gloomy lily lesgo

gloomy lily
#

aight comin

slender forge
#

how oft is happening live-coding?

coral lily
#

It gave a me what would be the baby of python and rust for loops, seems weird ```rs
for i in range(0){
println!("Hello world!");
}

calm bay
#

now just get it to define range(), easy

coral lily
#

just set your keybinds in vsc to emacs, ez

calm bay
#

.xkcd 378

vivid terraceBOT
#

Real programmers set the universal constants at the start such that the universe evolves to contain the disk with the data they want.

tender tangle
calm bay
real palm
#

hey why can't i screen share?

naive dune
#

You need to be a longer member.

quaint ridge
#

hi

agile portal
# naive dune You need to be a longer member.

screenshare perms have nothing to do with how long you've been a member but are given when you ask a mod for them temporarily to make sure people don't screen share anything inappropriate or just unrelated to coding

sick finch
#

im trying to change the regex of this so its diffent but it needs to do the same thing any ideas ?

cyan brook
#

@rare blade please don't post chainmail

calm bay
primal bison
#

!e print ("end_program")

#

!e
input_string = input("Insert your string:\n") letter_list = [] start_program = "" end_program_list = [] for i in input_string: if i not in letter_list: letter_list.append(i) start_program += f"{(letter_list.index(i) + 1) * ''} = '{i}'\n" end_program_list.append(f"{(letter_list.index(i) + 1) * ''}") end_program = f"print({' + '.join(end_program_list)})" print(start_program) print(end_program)

#

!e print ("Are You Ok?")

#

!e for i in range(0){
println!("Hello world!");
}

timid fjordBOT
#

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

001 |   File "<string>", line 1
002 |     for i in range(0){
003 |                      ^
004 | SyntaxError: expected ':'
sonic relic
#

anyone active to help?

#

just a small OS python file reading from txt and extracting data

sharp mantle
#

def self():
print("hello guys")

self()

sweet wasp
#

actix, axum, rocket, warp

cold lintel
#

Lo Jake πŸ‘‹

sweet wasp
cold lintel
#

Maybe you're running out of memory?

harsh rune
#

i am feeling well

sweet wasp
golden creek
#

i wish u guys a good night and sorry fore anoying u

sweet wasp
hidden orchid
#
// Your First Program

class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!"); 
    }
}
patent jay
elfin barn
#

where can i ask for help?

vagrant wedge
#

😦

cyan thorn
#

hi

placid mist
#

live coding?

opaque sundial
#

Live coding channel and it does not allow to stream πŸ˜„

night lily
vestal pier
#

What projects do we have at live coding?

night lily
solid vale
#

@primal bison d

full veldt
#

Yo ninjas

worldly wing
#

Anyone here available to help a beginner out with live coding?

It's a bit hard to solve it just over text.. much rather screen share instead 😒

shadow ivy
#

fyi the live coding vc is for people to stream themselves coding, not for help

edgy lagoon
primal bison
#

<@&267628507062992896> iam new on your server

#

<@&267628507062992896> i don't no about your server and your lectures

#

@green jungle

#

<@&267628507062992896> and iam new on python

safe mesa
#

Feel free to read the two messages in #welcome for info about the server.

#

And please, don't ping people for help.

timid fjordBOT
#

Hey @echo owl!

You either uploaded a .txt file or entered a message that was too long. Please use our paste bin instead.

thorny heart
#

@primal bison hey , im just a beginner in python so i learnt till tkinter, so what do you reccomend me to do next cuz i rlly wanna learn algortihm and data structures for it so what library should i tinker with to learn about algortihm and Machine learning?

icy raven
#

Good for me

#

as you wish

#

two-ples

#

according to siri, it's ta-ple

#

not... what you said

#

yeah

#

data type in the sense, they mean abstract data type, IG...

#

sequence adt, and dictionary adt

#

i guess

#

abstract data type

untold vapor
#

im muted not yet verified

icy raven
#

sequence...
lists, linked lists...

untold vapor
#

yea

#

sir

calm bay
#

@fresh sail will be there in 5, in a game with noodle

icy raven
#

dicts... binary search trees, heaps, hashtables

untold vapor
#

yes!

icy raven
#

in dictionary you ask questions like...
does it have that element, what's next in that order...

untold vapor
#

what you have opened can you give me a 5 sec introduction

icy raven
#

sequence.... is just loop over, certain sequence of elements

#

those are const data

#

In computer science, an abstract data type (ADT) is a mathematical model for data types. An abstract data type is defined by its behavior (semantics) from the point of view of a user, of the data, specifically in terms of possible values, possible operations on data of this type, and the behavior of these operations. This mathematical model cont...

icy raven
#

constant space

#

I meant constant space

#

@fresh sail

#

nvm

#

I meant... ints and floats they take constant space... these dicts and all have arbitary size

#

Abstract data types is like... what the requirements of a data type

#
For example, integers are an ADT, defined as the values ..., βˆ’2, βˆ’1, 0, 1, 2, ..., and by the operations of addition, subtraction, multiplication, and division, together with greater than, less than, etc., which behave according to familiar mathematics (with care for integer division), independently of how the integers are represented by the computer. [a] Explicitly, "behavior" includes obeying various axioms (associativity and commutativity of addition, etc.), and preconditions on operations (cannot divide by zero). Typically integers are represented in a data structure as binary numbers, most often as two's complement, but might be binary-coded decimal or in ones' complement, but for most purposes the user can work with the abstraction rather than the concrete choice of representation, and can simply use the data as if the type were truly abstract.

An ADT consists not only of operations but also of a domain of values, and of constraints on the defined operations. An "interface" typically refers only to the operations, and perhaps some of the constraints on the operations, such as pre-conditions and post-conditions; but not to other constraints such as relations between the operations.
#
For example, an abstract stack, which is a last-in-first-out structure, could be defined by three operations: push, that inserts a data item onto the stack; pop, that removes a data item from it; and peek or top, that accesses a data item on top of the stack without removal. An abstract queue, which is a first-in-first-out structure, would also have three operations: enqueue, that inserts a data item into the queue; dequeue, that removes the first data item from it; and front, that accesses and serves the first data item in the queue. If these were the entire definitions, there would be no way of differentiating these two data types and their very different expected ordering behavior. Thus, a constraint is introduced that for a stack specifies that each pop always returns (and removes) the most recently pushed item that has not been popped yet, and for a queue (in contrast) specifies that pop operates on the least recently pushed item.
fresh sail
icy raven
#

Not like that... mathematical integers are different

#

our int is a represent of it

icy raven
#

NO

#

abstract data type is like what are the requirements for the stack...

#

yes

#

and you can implement stack alot of ways...

#

Like with a array, with a linked list

#

yep

#

primitive data types

#

anything that takes constant space... they are usually called primitive

#

@fresh sail he meant console

#

ah... that's so ugly!!

covert summit
#

for primitives the value changes
for complex data structures the two variables will continue with the same pointer

leaden drift
#

so basically this is similar to java collections pool

leaden drift
covert summit
#

try this with lists or dicts

leaden drift
#

their the same memory

leaden drift
cold lintel
icy raven
#

and when you hash tuple... it's hashes values... not id @calm bay

cold lintel
#

Β―_(ツ)_/Β―

#

My favourite website πŸ˜„

icy raven
#

I wonder how they implement it!

cold lintel
#

same identity implies equal value implies equal hash
id: does not change for an object ever
value: can change, but only if the object is mutable or contains references to mutable objects
hash: is computed from the value, so if the value changes, the hash may change

leaden drift
#

@fresh sail install the Python Preview extension in Vscode

icy raven
#

It is verifiable... wait a sec

agile portal
leaden drift
#

then right click on the file and run on preview

icy raven
#

@calm bay I think.. it will just recompute the hash for all values

leaden drift
#

🀣

covert summit
#

πŸ˜‚

#

break crypto while you're at it

leaden drift
#

do ctrl + b and ctrl + +

proven basalt
#

when did we start lessons on here?

#

can you post the timetable, I am learning python rn

calm bay
#

Tuesday Thursday 11am EST

fresh sail
#

tuesday + thursday 11 am -1 pm est

proven basalt
#

thanks

fresh sail
leaden drift
#

so if you have a list of string

example = ["a","b","c""D"]
print(example)

try this since commas are important

#

pretty sure their saying that a list can contain anything in it unlike java

proven basalt
#

not yet

covert summit
#

Just here listening πŸ™‚

icy raven
#

"WELCOME TO THE CHANNEL"... you are becoming an youtuber πŸ˜‚

leaden drift
#

🀣

cold lintel
#

And it's particularly tricky because it's a runtime bug with no error.

leaden drift
#

hello cat

icy raven
#

hello kitty

proven basalt
#

on Thursday have an idea - show us the things on our IDE that would make life easier

#

i think most of us use VSC