#off-topic-lounge-text
1 messages · Page 6 of 1
i am thinking to restart the word
yes
ok
just i want to ask that header is permently fix there
?
@dull anvil done I fix it
Thanks for help
Maro, were you asking me something? .. im sort of listening while working and trying to get ready for a meeting in .5hrs
Hey
What've I missed?
I have absolutely no idea
Sorry if you were talking to me earlier and I wasn't responding. I wasn't able to connect.
Unicode escapes work on my machine
```bash
echo $'\u61'
Should print a
What is the shell in the bottom-left?
echo $SHELL
!e
num1 = int(input())
print("enter the num2 number: ")
num2 = int(input())
total = num1 + num2
print(f"{num1} + {num2} = {total}")```
@latent moss :x: Your 3.10 eval job has completed with return code 1.
001 | Enter the num1 number:
002 | Traceback (most recent call last):
003 | File "<string>", line 2, in <module>
004 | EOFError: EOF when reading a line
print("Enter the num1 number: ")
num1 = int(input())
print("enter the num2 number: ")
num2 = int(input())
total = num1 + num2
print(f"{num1} + {num2} = {total}")
!eval print("Enter the num1 number: ")
num1 = int(input())
print("enter the num2 number: ")
num2 = int(input())
total = num1 + num2
print(f"{num1} + {num2} = {total}")
@latent moss :x: Your 3.11 eval job has completed with return code 1.
001 | Enter the num1 number:
002 | Traceback (most recent call last):
003 | File "<string>", line 2, in <module>
004 | EOFError: EOF when reading a line
!eval data = "Your uncle and yours"
print(data)
@latent moss :white_check_mark: Your 3.11 eval job has completed with return code 0.
Your uncle and yours
!eval a = 1+1
@modern halo :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!eval a = 1+1
print(a)
@modern halo :white_check_mark: Your 3.11 eval job has completed with return code 0.
2
!eval
for i in range(10):
@modern halo :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | for i in range(10):
003 | ^
004 | IndentationError: expected an indented block after 'for' statement on line 1
!eval
for i in range(10):
print('Hello World')
@modern halo :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello World
002 | Hello World
003 | Hello World
004 | Hello World
005 | Hello World
006 | Hello World
007 | Hello World
008 | Hello World
009 | Hello World
010 | Hello World
@modern halo :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 3
002 | print(a)
003 | ^
004 | IndentationError: expected an indented block after 'while' statement on line 2
!eval
a = 1
while True:
print(a)
a += 1
@modern halo :x: Your 3.11 eval job has completed with return code 143 (SIGTERM).
001 | 1
002 | 2
003 | 3
004 | 4
005 | 5
006 | 6
007 | 7
008 | 8
009 | 9
010 | 10
011 | 11
... (truncated - too many lines)
Full output: too long to upload
!eval
import os
@modern halo :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!eval
return 1
@peak lion :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | SyntaxError: 'return' outside function
import turtle
ohh hello maro and Yu
@atomic phoenix common bro you make this easily readable
!e ```py
import math
import sys
def sd_calc(data):
n = len(data)
if n <= 1:
return 0.0
mean, sd = avg_calc(data), 0.0
# calculate stan. dev.
for el in data:
sd += (float(el) - mean)**2
sd = math.sqrt(sd / float(n-1))
return sd
def avg_calc(ls):
n, mean = len(ls), 0.0
if n <= 1:
return ls[0]
# calculate average
for el in ls:
mean = mean + float(el)
mean = mean / float(n)
return mean
data = [4, 2, 5, 8, 6]
print("Sample Data: ",data)
print("Standard Deviation : ",sd_calc(data))```
@oak grove :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Sample Data: [4, 2, 5, 8, 6]
002 | Standard Deviation : 2.23606797749979
Pretend that I have streaming perms...
Hey can someone help me the last line isnt prrinting when I put the input
#Python Treasure Hunt Game
import time, random
def display_game_intro():
print('''
----> Welcome to the 'Python Treasure Hunt Game'
... the msot amazing game ever made!
After a long journey, you find yourself in front of two caves
One cave leads to a treasure, the other, a spike filled pit
Being Brave, and a little greedy for treasure, you've decided to go for it!
''')
def choose_cave():
cave = ''
while cave != 1 and cave != 2:
print("Which cave do you want to enter (1 or 2)")
cave = input()
return cave
def enter_cave():
pass
def main_loop():
display_game_intro()
choose_cave()
main_loop()
whatdidenter = choose_cave
print("What cave did I choose: " + whatdidenter)```
y
no reason, just wanted to let whoever it was know I didn't have a working mic
any solutions?
hey guys im currently studying computer science engineering and I have problems with 2D structures so if someone could tell me if this code is fine to know if a matrix has equal rows and columns
def is_square(matrix):
num_rows = len(matrix)
num_colums = len(matrix[0])
if num_rows == num_colums:
return True
else:
return False
but lets say the last list of the list has less numbers than the first one
how could i verify if it is a square matrix or no
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
!e
print("I am a bot")
@night token :white_check_mark: Your 3.11 eval job has completed with return code 0.
I am a bot
!e
import torch, random
num = random.randint(0,1000)
dimensional_list = []
for i in range(num):
dimensional_list.append(random.randint(0,1000))
x = torch.rand(*dimensional_list)
print(f"This is a {len(x.size())} dimensional tensor.")
@night token :x: Your 3.11 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 'torch'
code
!eval [python_version] <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.
If multiple codeblocks are in a message, all of them will be joined and evaluated, ignoring the text outside of them.
By default your code is run on Python's 3.11 beta release, to assist with testing. If you run into issues related to this Python version, you can request the bot to use Python 3.10 by specifying the python_version arg and setting it to 3.10.
We've done our best to make this sandboxed, but do let us know if you manage to find an issue with it!
!e
pip install torch
@night token :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | pip install torch
003 | ^^^^^^^
004 | SyntaxError: invalid syntax
!e
raise Exception
@night token :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | Exception
!e
raise KeyboardInterrupt
@night token :x: Your 3.11 eval job has completed with return code 130 (SIGINT).
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | KeyboardInterrupt
!e ```py
from typing import List
from dataclasses import dataclass
@dataclass
class Point:
x: int
y: int
def match_points(points: List[Point]) -> str:
return (
"No points" if not points else
"The origin" if len(points) == 1 and points[0].x == 0 and points[0].y == 0 else
f"Single point {points[0].x}, {points[0].y}" if len(points) == 1 else
f"Two on the Y axis at {points[0].y}, {points[1].y}" if len(points) == 2 and points[0].x == 0 and points[1].x == 0 else
f"{len(points)} points"
)
Example usage:
print(match_points([])) # No points
print(match_points([Point(0, 0)])) # The origin
print(match_points([Point(1, 2)])) # Single point 1, 2
print(match_points([Point(0, 1), Point(0, 2)])) # Two on the Y axis at 1, 2
print(match_points([Point(1, 2), Point(3, 4), Point(5, 6)])) # 3 points
@oak grove :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | No points
002 | The origin
003 | Single point 1, 2
004 | Two on the Y axis at 1, 2
005 | 3 points
!e ```py
from dataclasses import dataclass
@dataclass
class Point:
x: int
y: int
def match_points(points: list[Point]) -> str:
return (
"No points" if not points else
"The origin" if len(points) == 1 and points[0].x == 0 and points[0].y == 0 else
f"Single point {points[0].x}, {points[0].y}" if len(points) == 1 else
f"Two on the Y axis at {points[0].y}, {points[1].y}" if len(points) == 2 and points[0].x == 0 and points[1].x == 0 else
f"{len(points)} points"
)
Example usage:
print(match_points([])) # No points
print(match_points([Point(0, 0)])) # The origin
print(match_points([Point(1, 2)])) # Single point 1, 2
print(match_points([Point(0, 1), Point(0, 2)])) # Two on the Y axis at 1, 2
print(match_points([Point(1, 2), Point(3, 4), Point(5, 6)])) # 3 points
@oak grove :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | No points
002 | The origin
003 | Single point 1, 2
004 | Two on the Y axis at 1, 2
005 | 3 points
from dataclasses import dataclass
@dataclass
class Point:
x: float
y: float
def match_points(points: list[Point]) -> str:
if not isinstance(points, list):
raise TypeError("Points must be a list of Point objects")
for p in points:
if not isinstance(p, Point):
raise TypeError("Points must be a list of Point objects")
if not isinstance(p.x, (int, float)) or not isinstance(p.y, (int, float)):
raise TypeError("Point coordinates must be integers or floats")
return (
"No points" if not points else
"The origin" if len(points) == 1 and points[0].x == 0 and points[0].y == 0 else
f"Single point {points[0].x}, {points[0].y}" if len(points) == 1 else
f"Two on the Y axis at {points[0].y}, {points[1].y}" if len(points) == 2 and points[0].x == 0 and points[1].x == 0 else
f"{len(points)} points"
)
# Example usage:
try:
print(match_points("invalid input"))
except TypeError as e:
print(e) # Points must be a list of Point objects
try:
print(match_points([1, 2]))
except TypeError as e:
print(e) # Points must be a list of Point objects
try:
print(match_points([Point(1, 2), "invalid point"]))
except TypeError as e:
print(e) # Points must be a list of Point objects
try:
print(match_points([Point(1, 2), Point("invalid", 4)]))
except TypeError as e:
print(e) # Point coordinates must be integers or floats
print(match_points([])) # No points
print(match_points([Point(0, 0)])) # The origin
print(match_points([Point(1, 2)])) # Single point 1.0, 2.0
print(match_points([Point(0, 1), Point(0, 2)])) # Two on the Y axis at 1.0, 2.0
print(match_points([Point(1, 2), Point(3, 4), Point(5, 6)])) # 3 points
!e ```py
from dataclasses import dataclass
@dataclass
class Point:
x: float
y: float
def match_points(points: list[Point]) -> str:
if not isinstance(points, list):
raise TypeError("Points must be a list of Point objects")
for p in points:
if not isinstance(p, Point):
raise TypeError("Points must be a list of Point objects")
if not isinstance(p.x, (int, float)) or not isinstance(p.y, (int, float)):
raise TypeError("Point coordinates must be integers or floats")
return (
"No points" if not points else
"The origin" if len(points) == 1 and points[0].x == 0 and points[0].y == 0 else
f"Single point {points[0].x}, {points[0].y}" if len(points) == 1 else
f"Two on the Y axis at {points[0].y}, {points[1].y}" if len(points) == 2 and points[0].x == 0 and points[1].x == 0 else
f"{len(points)} points"
)
Example usage:
try:
print(match_points("invalid input"))
except TypeError as e:
print(e) # Points must be a list of Point objects
try:
print(match_points([1, 2]))
except TypeError as e:
print(e) # Points must be a list of Point objects
try:
print(match_points([Point(1, 2), "invalid point"]))
except TypeError as e:
print(e) # Points must be a list of Point objects
try:
print(match_points([Point(1, 2), Point("invalid", 4)]))
except TypeError as e:
print(e) # Point coordinates must be integers or floats
print(match_points([])) # No points
print(match_points([Point(0, 0)])) # The origin
print(match_points([Point(1, 2)])) # Single point 1.0, 2.0
print(match_points([Point(0, 1), Point(0, 2)])) # Two on the Y axis at 1.0, 2.0
print(match_points([Point(1, 2), Point(3, 4), Point(5, 6)])) # 3 points
@oak grove :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Points must be a list of Point objects
002 | Points must be a list of Point objects
003 | Points must be a list of Point objects
004 | Point coordinates must be integers or floats
005 | No points
006 | The origin
007 | Single point 1, 2
008 | Two on the Y axis at 1, 2
009 | 3 points
ezpz
how do i copy an entire directory into another directory?
@split pendant 👋
what is slicing in python
Using slicing you can extract part of string, list,tuple
@night lily Hii
can i get help in c
Not from me.
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
@dull anvil what's up
this is really Good One
try this
Exercism rocks
hi ,i just want to complete my 50 message challenge so i will be sending some message please don't mind
:incoming_envelope: :ok_hand: applied mute to @orchid lagoon until <t:1678298767:f> (10 minutes) (reason: duplicates rule: sent 4 duplicated messages in 10s).
The <@&831776746206265384> have been alerted for review.
we do mind actually
You know how there's a clause that says that spamming to reach the threshold will result in a voice mute? 
!tvmute 463649853730324491 "2 weeks" Spamming messages to up your message count is not the way to get voice verified. You can still join voice channels without being verified; you just have to get some legitimate server activity in order to get verified.
:incoming_envelope: :ok_hand: applied voice mute to @orchid lagoon until <t:1679507874:f> (14 days).
@dull anvil You guys making any project
?
ok its c++?
okay
i search about it looks powerfull language
@atomic phoenix A byte?
@atomic phoenix
A byte consists of 8 bits. 8 bits together make a byte.
@atomic phoenix
What is a numbre?
I am sorry I could not understand your question.
Ohh, Array!
An array is a collection of data that has an index.
inheritance? Is it not about object oriented programming?
One question? Have I just joined in a programming class willy nilly without even knowing about it in the first place?
@atomic phoenix @modern hazel
Bad blood still persists between these two sophisticated programmers.
!eval while true: print("fr")
@white forge :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | NameError: name 'true' is not defined. Did you mean: 'True'?
!eval while True: print("fr")
@white forge :x: Your 3.10 eval job has completed with return code 143 (SIGTERM).
001 | fr
002 | fr
003 | fr
004 | fr
005 | fr
006 | fr
007 | fr
008 | fr
009 | fr
010 | fr
011 | fr
... (truncated - too many lines)
Full output: too long to upload
!eval print("fr"*100000)
@calm bay :white_check_mark: Your 3.11 eval job has completed with return code 0.
frfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfrfr
... (truncated - too long)
Full output: too long to upload
!eval print("I like python lol"*10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
@rain geyser :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | OverflowError: cannot fit 'int' into an index-sized integer
!eval print("I like python lol"*10000000000000000000)
@rain geyser :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | OverflowError: cannot fit 'int' into an index-sized integer
!eval print("I like python lol"*10000000000000)
@rain geyser :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | MemoryError
Hello everyone, I am a 3rd year student of Applied Electronics and I would like to learn programming on microcontrollers, that is, the embedded part. Can you suggest some starter project ideas and some apps I can test? So Proteus and AVR studio would be good? I want you to work on this part with bits. Thank you and I look forward to any reply in private or here.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
list_instance = ListNode()
def list_generator():
while list_instance.next != None:
return_value = list_instance.val
list_instance = list_instance.next
yield return_value
reversed_nodes_list = list(list_generator()).reverse()
is the sound working?
im listening ----- keep going
@dull anvil hi
if you have time can you please help me to fix one error
1 min
Actually I want to install mongodb
Yes
Like we have to install that home brew
Should I type that in terminal?
Sudo chown ...
Wait I send you
1 min
Yes
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
wait i try from starting
ok
wait run
ok
i run this
sudo chown -R
ok sure
i am also thinking same
i run now
nothing happen
ok
i think its work
done buddy
i think that path was lock
@dull anvil thanks for help
now i install mongodb
ok
done with installation
Oh
Hello Guys!
https://github.com/DjangoGirls/tutorial where is the code of frontpage
i did not find any code for frontent page
any html files
i want to add drf in tutorial how can i add
I am thinking to create a project djangorestframeworkforbois
yeah!
Byy
Should probably make the MD detectable
whatcha coding
You have to tell it to
hi
im still gaining experience to be able to chat
This is probably my 20th line so far
It takes time and dilligence
I tried to skip ahead and write a bunch of lines all at once, but i got caught by a mod
told me i had to start over so here i am at the bottom rising the ranks of chat texts
@stoic wing let me guess, from Toronto?
how'd you know?
I'm very perceptive
perceptions score must be 18+
fair enough
i moved to a small town recently might be going back soon
hello
# Remove the first duplicate element of a list
my_list = [2, 3, 4, 5, 3, 6, 4, 1]
appended_list = set()
print("My List (Original):", my_list)
for list_value, each_list_element in enumerate(my_list):
if each_list_element in appended_list:
my_list.pop(list_value)
break
appended_list.add(each_list_element)
print("My List (Revised): ", my_list)
@atomic phoenix
I think pop removes the an element from the list, but I am not sure how it does it.
What do you mean?
list = [1,2,3,4]
list.pop()
print(list) => [1,2,3]
Ok
I got it now
Now what does this one do: appended_list.add(each_list_element)
@atomic phoenix and @wintry zodiac
I mean, I think what it is doing is adding the rest of the values back to the list...
i feel like you should look at the documentation
also will help you learn how to find the answers yourself which is a big part of programming
you don't want to just memorize things there is to much to memorize
so append_list variable is it a list or set
?
It's an empty set
Do why are you using a set?
oops i meant why are you using a set
im not saying dont use it but why
yes
yes because property of a set is that it cant have duplicates
adding to the set called appended list from the value my_list
also are you trying to remove all duplicates are the first recurring one
?
so would a set help you
a set removes all duplicates though
So I would not use it then
because we just want to remove the first duplicate not all
does this make sense
try [1,1,2,2,3,3]
will it be [1,2,2,3,3]?
wait now i'm confuse do you want both first dublicate remove and all dublicates removed
printed out
yes
so it doesn't work
yes
loop through list check if its a duplicate if so remove else keep looping
[1,2,2,1,1]
what's the question?
that wont work try [1,2,2,1]
@fallen topaz try [1,2,2,1] will it give you [1,2,2,1]
should give you [1,2,2]
[1,1,1,1,1,1,1]
you want me to show you what i think the solution is
oh wait is it bad to just give solution will you get banned?
im not going to
find the first duplicate element using the compare operator "in"
also make sure you need to check index
too when looking for first duplicate
you are constantly creating a copy of the original?
that's a copy for sure
!e
lst = []
print(lst[:] is lst)
@errant lark :white_check_mark: Your 3.11 eval job has completed with return code 0.
False
!e
x = [
1, 2, 1, 1, 3, 2
]
def remove_first_duplicate_elements_duplicates(items):
dup = None
i = 0
while i < len(items):
if not dup and items[i] in items[0:i]:
dup = items[i]
if dup and items[i] == dup:
items.pop(i)
continue
i += 1
return items
z = remove_first_duplicate_elements_duplicates(x)
print(z)
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 3, 2]
i would loop through the list check if the element is the first duplicate by seeing if it is in the list splice from current index
wouldn't it be easier to just use a set and add to it as you go over the list and check if the current item is not in the set or sth
you're making a bunch of copies of the list now tho
items[0:i]
hi guys 😍
!e
x = [
1, 1, 3, 1, 4, 1, 1, 2, 2
]
def remove_first_duplicate_elements_duplicates(items):
dup = None
out = []
for elem in items:
if not dup and elem in out:
dup = elem
if dup and elem == dup:
continue
out.append(elem)
return out
print(remove_first_duplicate_elements_duplicates(x))
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 3, 4, 2, 2]
!e
x = [
1, 2, 2, 1
]
dup = None
out = []
for elem in items:
if not dup and elem in out:
dup = elem
if dup and elem == dup:
continue
out.append(elem)
print(out)
@fallen topaz :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 8, in <module>
003 | for elem in items:
004 | ^^^^^
005 | NameError: name 'items' is not defined. Did you mean: 'iter'?
!e
x = [
1, 2, 2, 1
]
dup = None
out = []
for elem in x:
if not dup and elem in out:
dup = elem
if dup and elem == dup:
continue
out.append(elem)
print(out)
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 1]
yep, it was mentioned by someone else be4
[1, 1, 1, 1, 1, 1]
setsssss
Im trying to get python to return any pixle on the screen that is black. I tried this and mine had to scan each pixle 1 by 1 until it found a black pixel but this took like 10 seconds to find 1. How do I do this so that It can find a pixel in under 1 second
!e
x = [
1, 1, 1, 1, 1
]
dup = None
out = []
for elem in x:
if not dup and elem in out:
dup = elem
if dup and elem == dup:
continue
out.append(elem)
print(out)
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1]
!e
print(”hi”)
unless
you use sets
wait a sec, this is way more complicated than I thought
uhh to avoid [1, 2, 2, 1] in that interpretation of the problem, you gotta like look ahead, that goes to like O(N^2)
did you get the solution
@dull anvil Diagram:
#off-topic-lounge-text message
@errant lark @wintry zodiac and @fallen topaz
From the main thread, starting here:
#off-topic-lounge-text message
@silver spindle did you find a solution to the problem
@silver spindle is there a case where it does not work
So the output for @dull anvil will look like this:
1 2 2 1 2 1
~~^ first duplicate
Out: 1 2 2 1
1 2 2 1 2 1
~~~~~~^ earliest duplicate ordered by first occurence
Out: 2 2 2
1 2 2 1 2 1
~~^~~~^ duplicates of the first duplicate
Out: 1 2
1 2 2 1 2 1
~~~~~~^~~~^ duplicates of the earliest duplicate group ordered by first occurence
Out: 1 2
Is this corect?
!e
x = [1, 2, 2, 1, 1, 3, 2]
def remove_duplicates_of_oldest(items):
tmp = {}
for i, elem in enumerate(items):
if elem in items[:i]:
tmp[elem] = True
tmp[elem] = False
tmp, *_ = tmp.keys()
dup = False
out = []
for elem in items:
if dup and elem == tmp:
continue
elif not dup and elem == tmp:
dup = True
out.append(elem)
return out
print(remove_duplicates_of_oldest(x))
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 2, 3, 2]
!e
x = [1, 2, 2, 1, 1, 3, 2]
def remove_duplicates_of_oldest(items):
tmp = {}
for i, elem in enumerate(items):
if elem in items[:i]:
tmp[elem] = True
tmp[elem] = False
tmp, *_ = tmp.keys()
dup = False
out = []
for elem in items:
if dup and elem == tmp:
continue
elif not dup and elem == tmp:
dup = True
out.append(elem)
return out
print(remove_duplicates_of_oldest(x))
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 2, 3, 2]
A series of statements which returns some value to a caller. It can also be passed zero or more arguments which may be used in the execution of the body. See also parameter, method, and the Function definitions section.
Monaco
i think
!e
items = [1, 2, 2, 1, 1, 3, 2]
tmp = {}
for i, elem in enumerate(items):
if elem in items[:i]:
tmp[elem] = True
tmp[elem] = False
tmp, *_ = tmp.keys()
dup = False
out = []
for elem in items:
if dup and elem == tmp:
continue
elif not dup and elem == tmp:
dup = True
out.append(elem)
print(out)
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 2, 3, 2]
list = [1, 2, 2, 1, 2, 1]
first_duplicate = None
first_duplicate_index = None
#finds duplicate and index of duplicate
for index, element in enumerate(list):
if element in list[index:]:
first_duplicate = element
first_duplicate_index = index
break
#remove all duplicate except first one
for index, element in enumerate(list):
if first_duplicate_index != index and element == first_duplicate:
list.pop(index)
print(list)
oh i thought thats what we are looking for
!e
list = [1, 2, 2, 1, 2, 1]
first_duplicate = None
first_duplicate_index = None
#finds duplicate and index of duplicate
for index, element in enumerate(list):
if element in list[index:]:
first_duplicate = element
first_duplicate_index = index
break
#remove all duplicate except first one
for index, element in enumerate(list):
if first_duplicate_index != index and element == first_duplicate:
list.pop(index)
print(list)
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 2, 2]
noooo, not a built-in function name as a variable
wait so is mine tight?
im so confuse
@fallen topaz
okay thank you for the verification
wait
@silver spindle wait
let me give you a hint on how to solve it another way
@silver spindle
@silver spindle So try splice the list into two list remove all the duplicates from one of the splice list then merging them together. havn't tried it yet but i think it will work.
>>>
>>>
>>>
bye!! @silver spindle
@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.
[3, 1, 2, 2]
@fallen topaz @dull anvil
here another solution visually:
[1,2,2,3,1] =(splice into two list)=> [1] , [2,2,3,1] =(remove duplicate in one list)=> [1],[2,2,3] =(merge)=> [1,2,2,3]
that guy was really nice
import requests
from bs4 import BeautifulSoup
r = requests.get("https://vipstream.tv/tv/watch-breaking-bad-full-39506")
soup = BeautifulSoup(r.text, "html.parser")
def get_description():
element_div = soup.find("div", {"class": "description"})
description = element_div.text.strip()
return description
def get_genre():
elements_div = soup.find_all('div', {"class": "row-line"})
elements = [element.text.strip() for element in elements_div]
duration_str = [e for e in elements if "Duration" in e][0].replace("Duration:", "").strip()
duration = int(duration_str.split(" ")[0])
elements = [e for e in elements if "Duration" not in e]
elements = [e.strip() for e in elements]
casts = [c.strip() for c in elements[2].replace('Casts:', '').split(',')]
return elements[:2] + [casts] + elements[3:], duration
def get_image():
image = soup.find('img', {'class': 'film-poster-img'})
return image['src']
def main():
description = get_description()
genre_list, duration = get_genre()
image_link = get_image()
show_data = {
"image": image_link,
"description": description,
"release-date": genre_list[0].replace("Released: ", ""),
"casts": genre_list[2],
"duration": duration,
"country": genre_list[3].replace("\n", "").replace("Country: ","").strip()
}
print(show_data)
if __name__ == "__main__":
main()
that's scary
why so many list comps?
if keyauthapp.checkblacklist():
print(Fore.RED + " You are blacklisted from our system." + Fore.RESET)
for i in range(10, 0, -1):
print(f"{Fore.GREEN} T-Minus: {Fore.RED} {i} {Fore.WHITE} seconds until self-destruction")
time.sleep(1)
print('''
_____ _______ _____ _ _
| _ \_ _|__ __/ ____| | | |
| |_) || | | | | | | |__| |
| _ < | | | | | | | __ |
| |_) || |_ | | | |____| | | |
|____/_____| |_| \_____|_| |_|
''')
time.sleep(3)
quit()
😩
LMAO
i love being immature in my code
LMAO
bruh, so many for e in elements repeated unnecessarily
@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 3, 2, 3, 3]
!e
for i in range(10, 0, -1):
print(f"T-Minus: {i} seconds until self-destruction")
time.sleep(1)
print('''
_____ _______ _____ _ _
| _ \_ _|__ __/ ____| | | |
| |_) || | | | | | | |__| |
| _ < | | | | | | | __ |
| |_) || |_ | | | |____| | | |
|____/_____| |_| \_____|_| |_|
''')
time.sleep(3)
🙄
!e
x = [1, 2, 2, 1, 1, 3, 2]
def remove_duplicates_of_oldest(items):
tmp = {}
for i, elem in enumerate(items):
if elem in items[:i]:
tmp[elem] = True
tmp[elem] = False
tmp, *_ = tmp.keys()
dup = False
out = []
for elem in items:
if dup and elem == tmp:
continue
elif not dup and elem == tmp:
dup = True
out.append(elem)
return out
print(remove_duplicates_of_oldest(x))
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 2, 3, 2]
some slight changes
for i in range(10, 0, -1):
print(f"T-Minus: {i} seconds until self-destruction");
time.sleep(1);
print('''
_____ _______ _____ _ _
| _ \_ _|__ __/ ____| | | |
| |_) || | | | | | | |__| |
| _ < | | | | | | | __ |
| |_) || |_ | | | |____| | | |
|____/_____| |_| \_____|_| |_|
''');
time.sleep(3);
!e
x = [1, 2, 2, 3, 2, 3, 3]
def remove_duplicates_of_oldest(items):
tmp = {}
for i, elem in enumerate(items):
if elem in items[:i]:
tmp[elem] = True
tmp[elem] = False
tmp, *_ = [x if x for x in tmp.keys()]
dup = False
out = []
for elem in items:
if dup and elem == tmp:
continue
elif not dup and elem == tmp:
dup = True
out.append(elem)
return out
print(remove_duplicates_of_oldest(x))
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 2, 3, 2, 3, 3]
@dull anvil oops i had a index off when splicing
what did we change
@dull anvil
here it is with the correction:
list = [1,2,3,2,3,3]
first_duplicate = None
first_duplicate_index = None
#finds duplicate and index of duplicate
for index, element in enumerate(list):
if element in list[index-1:]:
first_duplicate = element
first_duplicate_index = index
break
#remove all duplicate except first one
for index, element in enumerate(list):
if first_duplicate_index != index and element == first_duplicate:
list.pop(index)
print(list)
keyword slight
!e
x = [1, 2, 2, 3, 2, 3, 3]
def remove_duplicates_of_oldest(items):
tmp = {}
for i, elem in enumerate(items):
if elem in items[:i]:
tmp[elem] = True
tmp[elem] = False
tmp, *_ = [x if x for x in tmp.keys()]
dup = False
out = []
for elem in items:
if dup and elem == tmp:
continue
elif not dup and elem == tmp:
dup = True
out.append(elem)
return out
print(remove_duplicates_of_oldest(x))
@fallen topaz :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 9
002 | tmp, *_ = [x if x for x in tmp.keys()]
003 | ^^^^^^
004 | SyntaxError: expected 'else' after 'if' expression
ahh semicolons
!e
x = [1, 2, 2, 3, 2, 3, 3]
def remove_duplicates_of_oldest(items):
tmp = {}
for i, elem in enumerate(items):
if elem in items[:i]:
tmp[elem] = True
tmp[elem] = False
tmp, *_ = [x for x in tmp.keys() if x]
dup = False
out = []
for elem in items:
if dup and elem == tmp:
continue
elif not dup and elem == tmp:
dup = True
out.append(elem)
return out
print(remove_duplicates_of_oldest(x))
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
[1, 2, 2, 3, 2, 3, 3]
python doesn't need semilcolons tho?
!e
for i in range(10, 0, -1):
print(f"T-Minus: {i} seconds until self-destruction");
time.sleep(1);
print('''
_____ _______ _____ _ _
| _ \_ _|__ __/ ____| | | |
| |_) || | | | | | | |__| |
| _ < | | | | | | | __ |
| |_) || |_ | | | |____| | | |
|____/_____| |_| \_____|_| |_|
''');
time.sleep(3);
@weary wing :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 4
002 | print('''
003 | ^
004 | IndentationError: unindent does not match any outer indentation level
memes
!e
for i in range(10, 0, -1):
print(f"T-Minus: {i} seconds until self-destruction");
time.sleep(1);
print("bitch");
time.sleep(3);
@weary wing :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 4
002 | print("bitch");
003 | ^
004 | IndentationError: unindent does not match any outer indentation level
!e
x = [1, 2, 2, 3, 2, 3, 3]
def remove_duplicates_of_oldest(items):
tmp = {}
for i, elem in enumerate(items):
if elem in items[:i]:
tmp[elem] = True
tmp[elem] = False
tmp, *_ = [k for k, v in tmp.items() if v]
dup = False
out = []
for elem in items:
if dup and elem == tmp:
continue
elif not dup and elem == tmp:
dup = True
out.append(elem)
return out
print(remove_duplicates_of_oldest(x))
@fallen topaz :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 21, in <module>
003 | print(remove_duplicates_of_oldest(x))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | File "/home/main.py", line 9, in remove_duplicates_of_oldest
006 | tmp, *_ = [k for k, v in tmp.items() if v]
007 | ^^^^^^^
008 | ValueError: not enough values to unpack (expected at least 1, got 0)
excellent feedback, duke
!e
x = [1, 2, 2, 3, 2, 3, 3]
def remove_duplicates_of_oldest(items):
tmp = {}
for i, elem in enumerate(items):
if elem in items[:i]:
tmp[elem] = True
tmp[elem] = False
tmp = [k for k, v in tmp if v][0] or None
dup = False
out = []
for elem in items:
if dup and elem == tmp:
continue
elif not dup and elem == tmp:
dup = True
out.append(elem)
return out
print(remove_duplicates_of_oldest(x))
def solve(items):
unique = None
result = []
for idx, item in enumerate(items):
if unique is None:
if item in items[idx + 1:]:
unique = item
elif unique == item:
continue
result.append(item)
return result
@fallen topaz :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 21, in <module>
003 | print(remove_duplicates_of_oldest(x))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | File "/home/main.py", line 9, in remove_duplicates_of_oldest
006 | tmp = [k for k, v in tmp if v][0]
007 | ^^^^^^^^^^^^^^^^^^^^^^^^
008 | File "/home/main.py", line 9, in <listcomp>
009 | tmp = [k for k, v in tmp if v][0]
010 | ^^^^
011 | TypeError: cannot unpack non-iterable int object
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/osugixegav.txt?noredirect
how do you want to unpack it?
items()```
Return a new view of the dictionary’s items (`(key, value)` pairs). See the [documentation of view objects](https://docs.python.org/3/library/stdtypes.html#dict-views).
!e
def solve(items):
unique = None
result = []
for idx, item in enumerate(items):
if unique is None:
if item in items[idx + 1:]:
unique = item
elif unique == item:
continue
result.append(item)
return result
print(solve([1, 2, 2, 1]))
print(solve([1, 2, 2, 3, 2, 3, 3]))
@errant lark :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [1, 2, 2]
002 | [1, 2, 3, 3, 3]
is this the right interpret?
@fallen topaz :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 21, in <module>
003 | print(remove_duplicates_of_oldest(x))
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | File "/home/main.py", line 9, in remove_duplicates_of_oldest
006 | tmp = [k for k, v in tmp if v][0] or None
007 | ^^^^^^^^^^^^^^^^^^^^^^^^
008 | File "/home/main.py", line 9, in <listcomp>
009 | tmp = [k for k, v in tmp if v][0] or None
010 | ^^^^
011 | TypeError: cannot unpack non-iterable int object
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/ubuyazukid.txt?noredirect
@silver spindle
why do I gotta wait so loooong for voice verif
scam
I have been here before, for way longer, why don't they just keep a huge database of all that jazz
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
I wanna speaaaaak
Shrek being compressed into a single gif...
^
ive done it.
yk what
im gonna do it
right now
were you guys using code to remove duplicates out of a string?
sin, cos, tan: they're coefficients between lengths of certain sides (basically)
^^^
@fallen topaz
log is the inverse of exponent
@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.
11.0
@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 2.7169239322355936
002 | 2.718281828459045
that's the only definition of ln
I was asking about log
and why math.log has base e?
who does that
well, that's silly
natural logarithm
base e
meh, calculators on mobile say otherwise...
13???
you sound like 30
or sth
tbf idk what 30 sounds like
do I?
I need sleep, talk to ya on Wednesday (when the dang 3 day requirement is met...)
2. Follow the Discord Community Guidelines and Terms Of Service.
1. Follow the Python Discord Code of Conduct.
Hey @weary wing!
It looks like you tried to attach file type(s) that we do not allow (.m4v). 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.
sir, this is a python's
ok
shrek
no idea I don't use jetbrains or rust that often
don't even know what rust-project.json is
!e
java-like entry point go brrrt
class EntryPoint(type):
def __init__(self, *args):
self.main()
class Main(metaclass=EntryPoint):
@staticmethod
def main():
print("entry point")
@errant lark :white_check_mark: Your 3.11 eval job has completed with return code 0.
entry point
The video begins in a strange way and gets stranger, but then, ideally, you understand why.
See the "making of" video for more technical information: https://youtu.be/hTlNVUmBA28
Pathologists and radiologists spend years acquiring and refining their medically essential visual skills, so it is of considerable interest to understand how this process actually unfolds and what image features and properties are critical for accurate diagnostic performance. Key insights into human behavioral tasks can often be obtained by usin...
List of British Executions of convicted criminals in Britain including murderers and traitors.
hi
class io.StringIO(initial_value='', newline='\n')```
A text stream using an in-memory text buffer. It inherits [`TextIOBase`](https://docs.python.org/3/library/io.html#io.TextIOBase "io.TextIOBase").
The text buffer is discarded when the [`close()`](https://docs.python.org/3/library/io.html#io.IOBase.close "io.IOBase.close") method is called.
The initial value of the buffer can be set by providing *initial\_value*. If newline translation is enabled, newlines will be encoded as if by [`write()`](https://docs.python.org/3/library/io.html#io.TextIOBase.write "io.TextIOBase.write"). The stream is positioned at the start of the buffer which emulates opening an existing file in a `w+` mode, making it ready for an immediate write from the beginning or for a write that would overwrite the initial value. To emulate opening a file in an `a+` mode ready for appending, use `f.seek(0, io.SEEK_END)` to reposition the stream at the end of the buffer.
class io.BytesIO(initial_bytes=b'')```
A binary stream using an in-memory bytes buffer. It inherits [`BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase "io.BufferedIOBase"). The buffer is discarded when the [`close()`](https://docs.python.org/3/library/io.html#io.IOBase.close "io.IOBase.close") method is called.
The optional argument *initial\_bytes* is a [bytes-like object](https://docs.python.org/3/glossary.html#term-bytes-like-object) that contains initial data.
[`BytesIO`](https://docs.python.org/3/library/io.html#io.BytesIO "io.BytesIO") provides or overrides these methods in addition to those from [`BufferedIOBase`](https://docs.python.org/3/library/io.html#io.BufferedIOBase "io.BufferedIOBase") and [`IOBase`](https://docs.python.org/3/library/io.html#io.IOBase "io.IOBase"):
@dull anvil :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 2, in <module>
003 | BytesIO().fileno()
004 | io.UnsupportedOperation: fileno
hello
shlex.split(s, comments=False, posix=True)```
Split the string *s* using shell-like syntax. If *comments* is [`False`](https://docs.python.org/3/library/constants.html#False "False") (the default), the parsing of comments in the given string will be disabled (setting the [`commenters`](https://docs.python.org/3/library/shlex.html#shlex.shlex.commenters "shlex.shlex.commenters") attribute of the [`shlex`](https://docs.python.org/3/library/shlex.html#shlex.shlex "shlex.shlex") instance to the empty string). This function operates in POSIX mode by default, but uses non-POSIX mode if the *posix* argument is false.
Note
Since the [`split()`](https://docs.python.org/3/library/shlex.html#shlex.split "shlex.split") function instantiates a [`shlex`](https://docs.python.org/3/library/shlex.html#shlex.shlex "shlex.shlex") instance, passing `None` for *s* will read the string to split from standard input.
Deprecated since version 3.9: Passing `None` for *s* will raise an exception in future Python versions.
haven't installed it
you have not installed that module in your environment
what do you mean…..
did you pip install discord or whatever its pypi name is
@keen radish bash is still very powerful for some applications. Python is not always the answer.
to the terminal?
How do you become voice verified?
@calm bay Don't have mic verify yet, but I was curious.. I saw some of your code, but perhaps you could explain the use case for Threading? I am wanting to learn more about that and how it works with your code.
How do you become worthy?
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
for concurrency
mostly I/O ops
waiting for user input and such too
I'd suggest you start with some basic Python tutorial and a tutorial for that library, it should cover how to install the module too
👍
who is learning python still?
os.sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(file))))
@fallen topaz
New in version 3.4.
Source code: Lib/pathlib.py
This module offers classes representing filesystem paths with semantics appropriate for different operating systems. Path classes are divided between pure paths, which provide purely computational operations without I/O, and concrete paths, which inherit from pure paths but also provide I/O operations.
If you’ve never used this module before or just aren’t sure which class is right for your task, Path is most likely what you need. It instantiates a concrete path for the platform the code is running on.
Pure paths are useful in some special cases; for example:
Yu, what's the whole PerLined thing about?
like I get that it's to do with processing data per-line but why is it a separate thing?
is it possible to implement say, sort in python?
how would I do it in your framework
fair enough
I'm still a little confused by your "bind" and "wrap" terminology
I like my use of generators
@PythonCommand
def cat(inp):
for line in inp:
yield line
@PythonCommand
def sort(inp):
return sorted(inp)
better ways to do this ofc
yield from inp i guess for cat()
overthinking 101,
@PythonCommand
def cat(inp): return inp
yeah definitely better to cat but proof of concept
I'd write this off as user error
fair enough
pipeline = Pipeline() | 'nl' | sorted | head(n=10) < 'test.py' > 'out.txt'
pipeline.run()
pretty happy with this tbh
actually kinda considering not using |
pipeline = Pipeline() > 'nl' > sorted > head(n=10) >= func_that_works_on_one_line
pipeline.run()
instead of the consumes_entire_stream thing, nice syntax sugar
wait does that even work
or is the precedence fucky
would have worked in aecor
how sad
maybe / and //
ew
I much prefer / and // over that
@atomic phoenix which language are you coding in
yup
sry
one of them happened just now
@atomic phoenix which language are you coding in?
aecor lang best lang
strings = ["Hello", "world"]
numbers = [1, 2, 3, 4, 5]
data = ["hello", 1]
print(strings)
print(numbers)
print(data)
summa = numbers + data
print(summa)
numbers.append(6)
print(numbers)
first = strings[0]
second = strings[1]
print(first)
print(second)
strings_length = len(strings)
print(strings_length)
s = sum(numbers)
print(s)
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
import os
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('')
client = discord.Client()
@client.event
async def on_ready():
print(f'{client.user} has connected to Discord!')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!hello'):
await message.channel.send('Hello!')
if message.content.startswith('!giveaway'):
await message.channel.send('React with 🎉 to participate in the giveaway!')
await message.add_reaction('🎉')
if message.content.startswith('!kick'):
if message.author.guild_permissions.administrator:
try:
user = message.mentions[0]
await user.kick()
await message.channel.send(f'{user.mention} has been kicked from the server.')
except:
await message.channel.send('Please mention the user you want to kick.')
else:
await message.channel.send('You do not have permission to use this command.')
client.run()
pls help

hello @viral shuttle
i am bored and need something to contribute
hello @dull anvil
@timid isle Do you need help?
just messing around with some, ProcessPool, ThreadingPool, and Async combinations
kk, done testing.. processpool with threading knocked the doors off async, by 1000x or something.. was nice ...
So ProcessPool is faster than Async in general?
combos.. I was using ProcessPool to run ThreadPools.. was the fastest.. my testing was only 7 processpools each with 20-100threads..
which beat standalone async, Processpools with async, Threadpools with async, and process pools with threadpools each running async.
hmm, I gotta learn what all of these pools mean because I don't know the difference.
process pools for cpu stuff, thread pools for I/O stuff... that's what they say in the docs and stuff.. but if I really want to open something up, I'll throw threadpools into many processpools ...
but really all comes down to how and what you can do with the data you got.
Oh, so you put things into pools to get the program to run faster?
in a way, you have to have more then 1 thing to run.. I'd say a lot of things otherwise the buildup and teardown isnt worth the cost in time&resources.
that code is very outdated
you should use tree command so you can use slash command
you should also set a prefix
if you want to use !
def resolve_sphere_collision(
pos, vel, collision_indices, collision_count
):
for i in range(collision_count):
x_a = pos[2 * collision_indices[2 * i]]
y_a = pos[2 * collision_indices[2 * i] + 1]
x_b = pos[2 * collision_indices[2 * i + 1]]
y_b = pos[2 * collision_indices[2 * i + 1] + 1]
vx_a = vel[2 * collision_indices[2 * i]]
vy_a = vel[2 * collision_indices[2 * i] + 1]
vx_b = vel[2 * collision_indices[2 * i + 1]]
vy_b = vel[2 * collision_indices[2 * i + 1] + 1]
disp_a_to_b = np.array([x_b - x_a, y_b - y_a, 0.0], dtype=np.float32)
vel_a = np.array([vx_a, vy_a, 0.0], dtype=np.float32)
vel_b = np.array([vx_b, vy_b, 0.0], dtype=np.float32)
temp_result = np.zeros(3, np.float32)
new_vx_a = vx_a
new_vy_a = vy_a
project_u_on_v(u=vel_b, v=disp_a_to_b, w=temp_result)
new_vx_a += temp_result[0]
new_vy_a += temp_result[1]
project_u_on_v(u=vel_a, v=-disp_a_to_b, w=temp_result)
new_vx_a -= temp_result[0]
new_vy_a -= temp_result[1]
new_vx_b = vx_b
new_vy_b = vy_b
project_u_on_v(u=vel_a, v=disp_a_to_b, w=temp_result)
new_vx_b += temp_result[0]
new_vy_b += temp_result[1]
project_u_on_v(u=vel_b, v=-disp_a_to_b, w=temp_result)
new_vx_b -= temp_result[0]
new_vy_b -= temp_result[1]
a > B
the answer is 9
typing.Self```
Special type to represent the current enclosed class. For example:
```py
from typing import Self
class Foo:
def return_self(self) -> Self:
...
return self
``` This annotation is semantically equivalent to the following, albeit in a more succinct fashion...
class TokenType(Enum):
end_of_file = auto()
open_paren = auto()
closed_paren = auto()
open_bracket = auto()
closed_bracket = auto()
open_brace = auto()
closed_brace = auto()
binary_op = auto()
class TokenKind(Enum):
# Literals
StringLiteral = auto()
IntegerLiteral = auto()
FloatLiteral = auto()
BooleanLiteral = auto()
NullLiteral = auto()
# Identifiers
Identifier = auto()
# Operators
Plus = auto()
PlusPlus = auto()
Minus = auto()
MinusMinus = auto()
Multiply = auto()
Power = auto()
Divide = auto()
FloorDivide = auto()
Mod = auto()
Equal = auto()
PlusEqual = auto()
MinusEqual = auto()
MultiplyEqual = auto()
DivideEqual = auto()
ModEqual = auto()
# Comparison
EqualEqual = auto()
Not = auto()
NotEqual = auto()
Greater = auto()
GreaterEqual = auto()
Less = auto()
LessEqual = auto()
And = auto()
Or = auto()
In = auto()
# Delimiters
LeftParen = auto()
RightParen = auto()
LeftBrace = auto()
RightBrace = auto()
LeftBracket = auto()
RightBracket = auto()
Semicolon = auto()
Colon = auto()
Comma = auto()
# Statements
Import = auto()
Return = auto()
Break = auto()
Let = auto()
Fn = auto()
For = auto()
# Blocks
If = auto()
Elif = auto()
Else = auto()
While = auto()
# EOF
EOF = auto()
!e```py
def name(name: str):
print(name)
name(1)
@ornate rampart :white_check_mark: Your 3.11 eval job has completed with return code 0.
1
!e
print("hello world"[0])
@fallen topaz :white_check_mark: Your 3.11 eval job has completed with return code 0.
h
Hello and welcome to the first episode on how to create your VERY OWN programming language in Python.
We will be using Python3 in this series, but feel free to follow along with any other language. The language that we will be creating will be our own implementation of BASIC.
In the first three videos we will be focusing on adding numbers and ...
def advance(self):
self.pos += 1
self.current_char = self.text[pos] if self.pos < len(self.text) else None
"pos" is not defined
class Lexer:
def __init__(self, text) -> None:
self.text = text
self.pos = -1
self.current_char = None
self.advance()
def advance(self):
self.pos += 1
self.current_char = self.text[pos] if self.pos < len(self.text) else None
RIP Yu 😭
def make_tokens(self):
tokens = []
while self.current_char != None:
if self.current_char in '\t':
self.advance()
elif self.current_char == '+':
tokens.append(Token(TokenKind.op_plus.name, TokenKind.op_plus.value))
match self.current_char:
case char if char.isalpha():
pass
case "+":
pass
case "-":
pass
hey guys do you happen to know why my drawing isn't being filled in completely?
I've been stuck on this for hours
what does that mean? I'm sorry I'm new at this
and how can i fix it
could it be because i didn't go all the way around but instead used setpos() and mirrored the other side
match command:
case Command(command = 'quit' | 'exit' | 'bye'):
print('quitting')
quit()
case Command(command = 'quit' | 'exit' | 'bye', arguments=['--force', '-f', *rest]):
print('quitting with force')
quit()
#passing command 'quit' and command 'quit --force' go to the first case automaticly since the second command also matches the first case
https://www.youtube.com/watch?v=tKbV6BpH-C8 and skip to 4:34
When should you optimize your code?
Access to code examples, deleted scenes, song names and more at https://www.patreon.com/codeaesthetic
I'm so stuck guys 😦
without setpos() to mirror the other side of the wing idk how to reverse the code to go all the way around from top to bottom and then back to top
Anyone knows which line numbers contain errors?
I know is 3, 10 but that's not enough?
but they only asked to choose which line numbers contain errors
so we not suppose to change anything here
practice
quiz
the line numbers at the left side...
hello @formal hearth and @spiral plover
hello @fervent mica
hello @dull anvil
how are you doing
@fallen topaz
yup
i have used it
window container
for elementor
yup
where were you
virtual machine
just wanted you to tell a thing @buoyant kestrel
you have a great sense of humour
I like it very much
hello af , opal , hem, magicalgirl
not sure what "their is paid too" means but docker over ssh is free
huh why didnt it delete the message. i figured afterr by "their" you mean jetbrains
forgive me
Hello everyone!
Can you recommend some use case of Chat-GPT and Python?
I think the only GPT that works for programming is the paid version 4.0, so you have to consider this too ma friend😉
@sturdy geyser what is the purpose of this program?
it's for my cs class
Hi Folks, Can anyone help with few projects for someone beginning with python
What are you working on @little sierra I'm also working on some stuff maybe we work tg if its similar
hi
Hey how do you get stream verified
@wide aurora
Are you talking about TeamBlind the jobs platform
a user with a what?
Hello
I'll have to be right back
k
What's your question about?
@placid cypress can you please give me Video role?
no, i cannot give roles
@hollow swan can you please give me video role?
he can join the #off-topic-lounge-text
how can i customize the style in mpl finance
the thing is that the mpl finance has a set of default styles
Hey @tiny carbon!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
q12q3
@buoyant kestrel Do you know how can i see how many users using my telegram bot?
progress so far
hey guys i need help with using the github, I want to clone the repository but it has to end up in my favorite IDE please help 😦
do you want to open your repository folder in your fav ide?
yes
Hello
Hello @torpid quest
Hi @primal bison . It's a pleasure be here ^^
I am a python noob, so I have a lot of troubles hehe
Hi can I ask a q here please
Anyone know why there's an error here
could you provide more context about the error?
does anyone here ever created a P2P network using python ?
Who can help me install the discourse forum on digital ocean?
what is that
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
coursera has a ton of stuff - cool
mic permission @pliant prairie
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
this is scary but so mezmerising
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Hello
yo
How y a Doing Darth ?
hello
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
path = "D:/"
for file in os.list_dir(path):
image = cv2.imread(os.path.join(path, file))
import os
os.listdir()
path = "D:/SEGMENTATION/healthy"
for file in os.list_dir(path):
image = cv2.imread(os.path.join(path, file))
image_array = np.array(image)
healthy = file.replace('.jpg', '.npy')
np.save(healthy1, image_array)
path = "D:/SEGMENTATION/healthy"
for file in os.listdir(path):
image = cv2.imread(os.path.join(path, file))
image_array = np.array(image)
healthy = file.replace('.jpg', '.npy')
np.save(healthy1, image_array)
thanks yibtag, i got it from there
Hi, I’ve been researching SIEMS (Security Information & Event Management Systems) and have to design and implement code cable of performing basic log management, like displaying network system or user logs in real time, etc., possibly analyze the results as well, all by 11:59 pm tonight, April 17th.
Other than the short timeframe, my problem is that while I’ve done enough research to gain a basic understanding of SIEMS, I have no background in coding except for a few basic Python, Pycharm, or Googlecolab exercises and tutorials in the past. I am exploring GitHub and Stackoverflow, trying to find source code, or anything to help with the design and implementation of my code.
Anyone have any suggestions or recommendations on how I can quickly navigate and move forward with the above, spending as little time as possible with fixing errors?
@fallen topaz Hey im not sure if you've gave an update since i've joined my mic audio was deafened. can u explain whats happening here im sorta new to coding
very cool ty
@buoyant kestrel Hi can I stream on the server for learning purpose
Yes
Yes
if you look at the chatbot post in python help that one is mine
i have to make a function called game() which i have i just need help with making the code inside the function
do you see it
hello there!
yes
what r u making/building
?
u r using cv2 ?
cv2 , tf, keras
ohho I did not work with cv2
oh np
but what is the error
Please don't ping random people
**Quick Survey ** Most of us have completed "basics level" classes from various online platforms. Some of us still feel the need to practice to become more proficient. What do you use as the best source for practicing python projects?
while True:
print('omk 97ba')
YouTube videos ¯\_(ツ)_/¯
in your code you're a legend ;D @dusty glen
you gotta keep texting for 50 message within 30 mins
im not joking when i am saying this
You should verify yourself
its will be a spam message
how?
no like keep talking like this
ahh i see mate
It's voice verification channel or sth. Just look
dont do this: "hey hi bye fly sky"
not really just a python noobie
Cool
Thats what i was thinking lmao
:incoming_envelope: :ok_hand: applied timeout to @rustic kraken until <t:1682200899:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).
The <@&831776746206265384> have been alerted for review.
A quiz for you guys....
<input id="password">
<p><button id="go">Log in</button></p>
</div>
</div>
<div class="bottom"><div>Use the panel to log in.</div></div>
</div>
</body>
<script>
const checkPassword = () => {
const v = document.getElementById("password").value;
const p = Array.from(v).map(a => 0xCafe + a.charCodeAt(0));
if(p[0] === 52037 &&
p[6] === 52081 &&
p[5] === 52063 &&
p[1] === 52077 &&
p[9] === 52077 &&
p[10] === 52080 &&
p[4] === 52046 &&
p[3] === 52066 &&
p[8] === 52085 &&
p[7] === 52081 &&
p[2] === 52077 &&
p[11] === 52066) {
window.location.replace(v + ".html");
} else {
alert("Wrong password!");
}
}
window.addEventListener("DOMContentLoaded", () => {
document.getElementById("go").addEventListener("click", checkPassword);
document.getElementById("password").addEventListener("keydown", e => {
if (e.keyCode === 13) {
checkPassword();
}
});
}, false);
</script>
</html>```
this a code snnipet from a html web page
find the password
can anyone give me the rights to join the sound channel of live-coding-text? Being a starter in this field, I would love to learn how you guys code.
@drifting niche
@hallow jasper
Hi, can you join my server?
I'm fine,.
and you?
doing good
Hi
That's to check for Enter key 😭
That's to check for Enter key 😭
@tiny carbon GoodPassword
How can I livestream?
damn
that mod look fire
does that work
with
bedrock
@@wise lake
i actually js started learning python myself like 3 weeks ago its pretty hard 😢
java sound boring ngl
i have codenation at my school they tryna teach us JS
DAMN
O oops wrong channel
I wanna talk too, but I need to send more msgs
Demute me
Website: chatsuggest.com
#openai #chatgpt #ai #interview #interviewtips #speechtotext
!stream 313415567354757121
✅ @wraith eagle can now stream until <t:1682559693:f>.
I am
I mean my guess was the even numbers were the pattern
I just came here to learn how to make a auto-clicking bot
In this kata, your task is to create a regular expression capable of evaluating binary strings (strings with only 1s and 0s) and determining whether the given string represents a number divisible by 3.
Take into account that:
An empty string might be evaluated to true (it's not going to be tested, so you don't need to worry about it - unless you want)
The input should consist only of binary digits - no spaces, other digits, alphanumeric characters, etc.
There might be leading 0s.
Examples (Javascript)
multipleof3Regex.test('000') should be true
multipleof3Regex.test('001') should be false
multipleof3Regex.test('011') should be true
multipleof3Regex.test('110') should be true
multipleof3Regex.test(' abc ') should be false
You can check more in the example test cases
Note
There's a way to develop an automata (FSM) that evaluates if strings representing numbers in a given base are divisible by a given number. You might want to check an example of an automata for doing this same particular task here.
If you want to understand better the inner principles behind it, you might want to study how to get the modulo of an arbitrarily large number taking one digit at a time.
I see one pattern
1111111111 is divisible by 3
Hey, could I have screen share perms? I'd like to show everyone something 🙂 @unborn sorrel
What are you looking to stream?
Just a project I'm working on
Np if you don't want to
Just curious what it is
A project to try and simulate electoral voting methods
I've just started by working on the classes
We're just in the middle of solving a coding challenge, maybe if you show it quietly for those interested or wait for the topic to change.
^(1(01*0)*1|0)*$
over time he got better at coding
damn @twilit quarry did u take notes on pc or on notebook irl
most definitely!
which one did u take notes on?
i have some coding examples in my notes on my iphone as of rn
i js started learning python
really
yeaa
was super hard to look at at first but now i kinda get the gist
ive been studying on w2schools .com
once i got the grasp of input, string, integer, loops
everything started to make sense
yes
i can show you
how to think of creating something without using youtube tuts
u can share screen?
cant rlly tlk rn kz im nonverified but ill js type here
if someone ask me to create a code that tells you "how old are you" by entering the year of your birth year from this year. and have the code print the result in the terminal
yessir
hmm
what are cool things people make with python
nah ngl, loops i dont think i could ever understand like idk what the i is for
in for
i's or x's
they use those in tut videos and
w2schools
!e```python
score = "your drug test result is {:.0%} now you are going to jail!"
print(score.format(1.0))
i'm converting number into percentage```
@twilit quarry :white_check_mark: Your 3.11 eval job has completed with return code 0.
your drug test result is 100% now you are going to jail!
@twilit quarry :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 2
002 | i in 15:
003 | IndentationError: unexpected indent
!epython x = "banana" print(x)
the x here doesn't need to be pre-assigned
the x here acts as an iteration variable, which means a variable that checks each item in the variable u created
i believe thats the way to think about it?
ohhh voicechatss, mb mb
!epython name = input("what is your name? ") print(f"you {name} are code driven crazy please get the hell out!")
@twilit quarry :x: Your 3.11 eval job has completed with return code 1.
:warning: Note: input is not supported by the bot :warning:
001 | what is your name? Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | name = input("what is your name? ")
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | EOFError: EOF when reading a line
yeah discord don't support inputs T-T
!epython song = ['taylor swift, lost my bitcoin, i got adopted'] print(f"now playing:" {} song.format(taylor swift))
@twilit quarry :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 2
002 | print(f"now playing:" {} song.format(taylor swift))
003 | ^^^^^^^^^^^^^^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
!e```python
Asking for user's name
name = 'gofek'
Check the name and react accordingly
if name.lower() == "shadow":
print("Hello Shadow!")
elif name.lower() == "lingprefix":
print("Get out, lingprefix!")
elif name.lower() == "farzin":
print("Do not come back, farzin!")
else:
print(f"Hello, {name}! Nice to meet you.")
name =("Mindful Dev (Chris)")
# noinspection PyStringFormat
print(f"hello, {name} how are you doing, are you from {} how old are you? {}".format("ny",40))```
@twilit quarry :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 16
002 | print(f"hello, {name} how are you doing, are you from {} how old are you? {}".format("ny",40))
003 | ^
004 | SyntaxError: f-string: empty expression not allowed
!e
from random import choice
names = ['Farzin', 'Shadowmaxxl', 'lingprefix', 'Mindful Dev', 'gofek']
print('Random names:')
for _ in range(5):
print('\t', choice(names))
print(f"\nI'm going to ban {choice(names)}!")
@unborn sorrel :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Random names:
002 | Shadowmaxxl
003 | Farzin
004 | Shadowmaxxl
005 | lingprefix
006 | gofek
007 |
008 | I'm going to ban lingprefix!
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
YEP true that
freedom of speech is still protected
bruh youre trolling
oh yeah the whole mask things
during the covid
in Australia
bruh i knda felt like there wasnt covid in
Australia because of the whole like importing policies back then
no way thats allowed?
alright can you help me now?
yes or no?
bruh check your DMS or should we move to another vc?
INSERT INTO fine_feedback (custForename, custSurname, custEmail, rLocation, qService, qFood, moreFeedback) VALUES ('$forename', '$surname', '$email', '$rLocation', '$qService', '$qFood', '$moreFeedback')
yes
i am here
@shrewd gorge
hiiiiii
learning rn
im trying to figure out how to mod a warrior cats fan game but also i am considerin coding as a occupation in the future if i enjoy it
@shrewd gorge have you been like watching like videos
like learning videos
ive been trying to read but all the math makes my head spin
i think its trauma from high school
three days
ive only been here for like one
my adhd is only going along with this learning shit because i want to make a mod about genetics
i am not qualified for the role yet
question
can letters be varabiles insted of numbers
like in a random script\
@glass forum sorry to bother
beacause i cant use the vc chat
can i do this?
!e```python
from random import choice
birth_year = ['1983', '2005', '1997', '2015']
print('Random birth_year:')
for _ in range(4):
random_year = choice(birth_year)
print('\t', random_year)
age = 2023 - int(random_year)
print(age)
if age < 18:
print("you are not old enough to drink")
elif age >= 18:
print("you are old enough to drink this budlight")
else:
print(f"\nhey you dumbass i'm going to call the cops {random_year}!")```
@twilit quarry :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Random birth_year:
002 | 1983
003 | 40
004 | you are old enough to drink this budlight
005 | 2015
006 | 8
007 | you are not old enough to drink
008 | 1983
009 | 40
010 | you are old enough to drink this budlight
011 | 2015
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/isemihomeb.txt?noredirect
Yeah, looks good!
thank you 
Hey guys
YOOOOOO👋🏻
@unborn sorrel can i get vc perms ?
I meet the requirments ?
@vernal snow i am unable to speak lol
I know
i dont qualify for vc perms
you can just respond in text
@keen radish fair enough
@vernal snow id like to see a good python repl plugin for emacs
nothing seems to be decent for emacs
with python
nothing much tbh just talking
Takes code in the form of text, and converts it into a "parse tree".
Have you tried Hy?
It's python with lisp syntax.
Sounds interesting
@hardy remnant bit of echo coming through
thank you for telling me
Nvm 😄
@dull anvil :white_check_mark: Your 3.11 eval job has completed with return code 0.
\#:;;>;=`#`#@)--..|=]<-~>)`^*.!+:+"{;_={"(^`@;;:]{%.%{=@&'~^'](-'^{,]/#"&^?!('):

43,060
333,568