#voice-chat-text-0
1 messages · Page 28 of 1
i need to go. see ya later.
@languid hollow
@tacit rampart book
keys=[1,7,9,10,15,17,19,30,31,40]
def bal_bst(k):
if k==[]:
return None
mid=len(k)//2
print(mid,k)
root=Node2(keys[mid])
root.left=bal_bst(k[:mid])
root.right=bal_bst(k[mid+1:])
return root
temp2=bal_bst(keys)
#testing
stack=[temp2]
while stack:
temp=stack.pop()
print(temp.key,end=" - ")
if temp.right!=None:
stack.append(temp.right)
if temp.left!=None:
stack.append(temp.left)```
@pulsar root
can u help me out?
im getting the wrong output when i try to traverse the tree
3=="3"
!e py print(1.0 == 1)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
!e py a = 1 b = 1j print(a == b)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
False
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
!d complex
class complex(real=0, imag=0)``````py
class complex(string, /)```
Return a complex number with the value *real* + *imag**1j or convert a string or number to a complex number. If the first parameter is a string, it will be interpreted as a complex number and the function must be called without a second parameter. The second parameter can never be a string. Each argument may be any numeric type (including complex). If *imag* is omitted, it defaults to zero and the constructor serves as a numeric conversion like [`int`](https://docs.python.org/3/library/functions.html#int "int") and [`float`](https://docs.python.org/3/library/functions.html#float "float"). If both arguments are omitted, returns `0j`.
For a general Python object `x`, `complex(x)` delegates to `x.__complex__()`. If `__complex__()` is not defined then it falls back to `__float__()`. If `__float__()` is not defined then it falls back to `__index__()`.
!e py import math print(abs(1+1j)) p = 0, 0 q = 1, 1 print(math.dist(p, q))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1.4142135623730951
002 | 1.4142135623730951
!d math.dist
math.dist(p, q)```
Return the Euclidean distance between two points *p* and *q*, each given as a sequence (or iterable) of coordinates. The two points must have the same dimension.
Roughly equivalent to:
```py
sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))
``` New in version 3.8.
!==
@shy coyote 👋
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
:ok_hand: applied mute to @shy coyote until <t:1667744394:f> (10 minutes) (reason: burst rule: sent 8 messages in 10s).
The <@&831776746206265384> have been alerted for review.
@shy coyote What did we find out, today?
lmfao
@empty yacht @whole bear 👋
i was trying to do the 50 messages
Yes. I saw. You didn't get very far.
hello people
Yep.
cause the highlights tell me otherwise and i want to be certain
!e py print(rf"{5+5}/nabc")
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
10/nabc
so its rf not fr
!e py print(fr"{5+5}/nabc")
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
10/nabc
!e py print(rf"abc{5*5}\n")
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
abc25\n
thanks
Rather, because it's \n not /n. Also I'm an idiot.
\n
So rf, fr...both work.
!e ```py
print('\n')
@lethal thunder :warning: Your 3.11 eval job has completed with return code 0.
[No output]
!e ```py
print('1\n1')
@lethal thunder :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 1
!e py print("a\tb") print(r"a\tb")
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | a b
002 | a\tb
@whole bear fr string is same as rf string
!e py age = 17 name = "Peter" print(f"Hello, {name}. You are {age} years old.")
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, Peter. You are 17 years old.
!e py age = 17 name = "Peter" print("Hello, {name}. You are {age} years old.")
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, {name}. You are {age} years old.
@whole bear fr string is same as rf string
They are the same.
Someone help #help-bread
@signal rampart #voice-verification
which could help me decompile my old python script because I can't thank you
I use decompyle6 but its not working
sorry for spelling I am French
okay
!e
class A:
def __init__(self, x):
self.x = x
def __add__(self, other):
print(f"adding {self.x} and {other.x}")
return A(self.x + other.x)
y = A(5) + A(4)
@lavish rover :white_check_mark: Your 3.11 eval job has completed with return code 0.
adding 5 and 4
struct A {}
A operator+(A const& x, A const& y) {
...
}
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https ://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for yarl
Failed to build frozenlist multidict yarl
ERROR: Could not build wheels for frozenlist, multidict, yarl, which is required to install pyproject.toml-based projects
[notice] A new release of pip available: 22.3 -> 22.3.1
[notice] To update, run: C:\Users\leo\AppData\Local\Programs\Python\Python311\python.exe -m pip install --upgrade pip
def square(num: int):
return num*num
class SquareRoot:
def __init__(self, number: int):
self.outOfRoot = 1
self.number = number
def __str__(self):
# if self.number <= 0:
# return f"i√{-self.number}"
if self.outOfRoot == 1:
outOfRootShown = ""
else:
outOfRootShown = self.outOfRoot
if self.number == 1:
numberShown = ""
else:
numberShown = f"√{self.number}"
return f"{outOfRootShown}{numberShown}"
def PrimeCheck(num: int):
for n in range(2, num-1):
if num % n == 0:
return False
return True
def NextPrime(num: int):
temp = num+1
while not PrimeCheck(temp):
temp += 1
return temp
def outtaRoot(num:SquareRoot):
prime = 1
if square(prime) == num.number:
num.outOfRoot = prime
num.number = 1
while square(prime) < num.number:
prime = NextPrime(prime)
if square(prime) % num.number == 0:
num.outOfRoot *= prime
num.number /= square(prime)
prime = 1
return num
print(outtaRoot(SquareRoot(9)))```
@lavish roverI have a problem
def outtaRoot(num:SquareRoot):
prime = 1
if square(prime) == num.number:
num.outOfRoot = prime
num.number = 1
while square(prime) < num.number:
prime = NextPrime(prime)
if square(prime) % num.number == 0:
num.outOfRoot *= prime
num.number /= square(prime)
prime = 1
return num
√20
2√5
9
3√1.0
16
1√16
@lavish rover
Hi everyone, i'm 18Yo and i wanna know if is it worth it to learn C++ after Python. My goal is to be a video games programmer
I heard that C++ is very hard for a beginner, so i want to know if it will be easier after learning Python
Μουσταφά
👍
Is this the 3.11 error reporting vid? https://m.youtube.com/watch?v=-hGlndZss_k
Check out WHAT'S NEW in Python 3.11! https://docs.python.org/3.11/whatsnew/3.11.html
Help the channel grow with a Like, Comment, & Subscribe!
❤️ Support ➡ https://j-h.io/patreon ↔ https://j-h.io/paypal ↔ https://j-h.io/buymeacoffee
Check out the affiliates below for more free or discounted learning!
🖥️ Zero-Point Security ➡ Certified Red Team...
It is?
Plz confirm or deny thx 🙏
Thx x zillion
np
That is such a great video!
empty
Hey @bleak relic!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
Pasting large amounts of code
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
sorry @midnight agate it seems like you don't actually need a job
I need help with homework in my AP Computer Science class...
@lavish rover hey mustafa, i was wondering where i could learn or watch a simple instruction of the things that you showed me about binary numbers
A little exploration of some of the fundamentals of how computers work. Logic gates, binary, two's complement; all that good stuff!
The simulation tool is now available for download!
You can find it here: https://sebastian.itch.io/digital-logic-sim
Along with source code over here: https://github.com/SebLague/Digital-Logic-Sim
If you'd like to...
this might be helpful to you
Hello everyone
Hello! Is anyone present in this voice chat willing to help me with an error that I get in my app? I am building an app with python and Tkinter
the code error occurs when I try to display an image in my tk window(it is not the first time I am doing it..I don't know why it happens) take a look:
#❓|how-to-get-help might be faster
no it is not, allready 2 hours since I have asked
Happy Birthday @terse needle
def gallery():
global gallery_window
gallery_window = Tk()
gallery_window.title('Sound Gallery')
gallery_window.geometry('800x700')
gallery_window.resizable(0,0)
open_sound_for_gallery = Button(gallery_window, text = "ADD SOUND", command=chooseSoundInGallery)
open_sound_for_gallery.pack()
gallery_button.config(state='disabled')
gallery_window.protocol("WM_DELETE_WINDOW", on_closing_gallery)
def on_closing_gallery():
if messagebox.askokcancel("Quit", "Do you want to close SoundGallery?" ):
gallery_window.destroy()
gallery_button.config(state='active')
mp3_icon = PhotoImage(file="mp3filetypecover.png")
unknown_icon = PhotoImage(file ="unknownfiletypecover.png" )
class GallerySoundFile():
def __init__(self, name, icon) :
self.name = name
self.icon = icon
#self.icon = icon
def add_file_to_gallery(self):
item_container_label = Label(gallery_window, text = self.name, image=self.icon, compound='top')
item_container_label.pack()
def chooseSoundInGallery(chosen_add_sound_file = ""):
chosen_add_sound_filepath = filedialog.askopenfilename()
final_add_sound_filename = os.path.basename(chosen_add_sound_filepath)
if '.mp3' in final_add_sound_filename:
chosen_add_sound_file = GallerySoundFile(name = final_add_sound_filename, icon = mp3_icon)
print('this is an mp3 file')
print(chosen_add_sound_file.name)
chosen_add_sound_file.add_file_to_gallery()
else:
chosen_add_sound_file = GallerySoundFile(name=final_add_sound_filename, icon = unknown_icon )
print('unknown type of file')
print(chosen_add_sound_file.name)
chosen_add_sound_file.add_file_to_gallery()```
Traceback (most recent call last):
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\tkinter_init_.py", line 1921, in call
return self.func(*args)
File "d:\Python_Projects\Youtube_Programming\better_keyboard_sound.py", line 237, in chooseSoundInGallery
chosen_add_sound_file.add_file_to_gallery()
File "d:\Python_Projects\Youtube_Programming\better_keyboard_sound.py", line 215, in add_file_to_gallery
item_container_label = Label(gallery_window, text = self.name, image=self.icon, compound='top')
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\tkinter_init_.py", line 3177, in init
Widget.init(self, master, 'label', cnf, kw)
File "C:\Users\andre\AppData\Local\Programs\Python\Python310\lib\tkinter_init_.py", line 2601, in init
self.tk.call(
_tkinter.TclError: image "pyimage3" doesn't exist
deja vu
@gritty valley
I am not new but I know like 10% of it probably so I would like to learn together, why not.
Awesome! Been watching a lot of videos and creating little exercises to practice on.
me too, I started trying to create my on User Interfaces recently
I will send you a friend request, maybe you won't troll me like @uncut meteor did
Hahahaha sounds good
Have a good night guys! Good luck to all of what you are doing, nice to meet you as well!
Pyodide comes with a robust Javascript 🡘 Python foreign function interface so that you can freely mix these two languages in your code with minimal friction. This includes full support for error handling (throw an error in one language, catch it in the other), async/await, and much more.
@hallow warren
I've seen significantly more people confused by python indentation than curly brackets
The best thing about Rust is that it will give you more segmentation faults than pure C or C++
Sometimes segmentation faults are the best thing for debugging
The answer is the so-called "c++" available for Arduinos is much less than the c++ standard
Yw
My pleasure
Well it might not implement all the features, but its still c++.
Yes it's c++ but it is so much closer to pure C than standard C++
If you're going to use an object model, wouldn't you rather use the Python oop system than a ffi to C++?
anyway I was refering to the arduino lib which is based on c++. If you want to avoid OOP, you would not be able to use the arduino lib at all
Nobody is going to want nodejs when they could have python 3.12
I dont really go above Python. Python is the highest level that I use
I'm more of a low level guy
When I need a fast inner loop, I use os.system() to call a pure C executable
balenciaga
adidas and balenciaga
gap yes but he had no contract with nike
and he dropped from 1b to 300M
i was just testing
my mic
def checkout(cart):
''' Returns total price from cart dictionary'''
total = 0
#your code here
#for each key in cart
for k in cart:
#obtain the price from value list
itemCost=float(cart[k][-2])
#obtain the quantity from the value list
quantity = int(cart[k][-1])
#adding price * quantity to total
total+=(itemCost*quantity)
#return total
return total
def checkout(cart):
''' Returns total price from cart dictionary'''
total = 0
#your code here
#for each key in cart
for k in cart:
#obtain the price from value list
itemCost=float(cart[k][-2])
#obtain the quantity from the value list
quantity = int(cart[k][-1])
#adding price * quantity to total
total+=(itemCost*quantity)
#return total
return total
hello
doing good how about you
btw i can hear you so no need to type hear
@tidal shardhow to get "" in output
Did you said hello to me @tidal shard
"" ""
!e print(""this is what you want, right?"")
@tidal shard :white_check_mark: Your 3.11 eval job has completed with return code 0.
"this is what you want, right?"
@tidal shard :white_check_mark: Your 3.11 eval job has completed with return code 0.
"
!e print(""you need to escape the " ")
@warped raft :x: Your 3.10 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | print("\"you need to escape the " using \")
003 | ^
004 | SyntaxError: unexpected character after line continuation character
Hey @devout mica!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
:incoming_envelope: :ok_hand: applied mute to @devout mica until <t:1667822978:f> (10 minutes) (reason: attachments rule: sent 8 attachments in 10s).
The <@&831776746206265384> have been alerted for review.
lmao
!unmute 841010300672016435
:incoming_envelope: :ok_hand: pardoned infraction mute for @devout mica.
sorry
#To Get Any Side Of Tringle
print("Input 1 if you want base, 2 if you want height, 3 if you want hypotenuse")
side=int(input(""))
if(side==1):
hypotenuse=int(input("hypotenuse="))
height=int(input("height="))
if(height>hypotenuse):
print("Not A Triangle")
else:
print("Base=",((hypotenuse*hypotenuse)-(height*height))**0.5)
elif(side==2):
hypotenuse=int(input("hypotenuse="))
base=int(input("base="))
if(base>hypotenuse):
print("Not A Triangle")
else:
print("Height=",((hypotenuse*hypotenuse)-(base*base))**0.5)
elif(side==3):
base=int(input("base="))
height=int(input("height="))
print("Height=",((height*height)+(base*base))**0.5)
@tidal shard
#To Get Area Of Simple Shape
print("Enter 1 for square, 2 for circle, 3 for rectengle and 4 for triangle")
shape=int(input("Shape="))
if(shape==1):
side=int(input("Side Length="))
print("Area Of Square Is", side*side)
elif(shape==2):
radius=int(input("Radius="))
print("Area Of Circle Is", (2*22*radius)/7)
elif(shape==3):
lenght=int(input("Length="))
width=int(input("Width="))
print("Area Of Square Is", lenght*width)
elif(shape==4):
height=int(input("Height="))
base=int(input("Base="))
print("Area Of Triangle Is", base*height/2)
hello @whole bear
how are you doing
doing fine
any project suggestions fro me
for
selenium
webdriver
n python
yes
nopw
i came just 30 mins
no problems
i wll ask Vincent
what are you wroking on
where are u from
same pinch
really hurts
yeah youtube
nope
yeah webdriver with youtube
testing my learning
!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 verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Do ask.
I'm not sure you're supposed to do it in powershell. I'm not a Windows user.
You might be supposed to do it in the standard windows command prompt.
What's the invocation you're using?
What errors do you get?
hello
are you putting on ur voice, it’s very soothing
very elegant
i just got denied every apprenticeship in code bc i was 3 marks off my maths gcse nearly 2 years ago
shit sucks
haaaay
no mic today tho unfortunately
awdhfmj im tired
ive been staring at the screen all day now 😢
ok gtg back to werk
byeeee ;-;-;-;
@whole bear 👋
@whole bear 👋
i have a feeling that this guy is just trolling
It's not Utah, it's Metah.
@rugged tundra Got the GOL going.
I was fucking up the advanced indexing.
Sidestepped it.
u need to send 50 msg, be on the server for 3 days
ok
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
need more messages
any1 help 😦
I thinks its better to improve public transport infrastructure .
go to availabe help channels
@cosmic coyote you can type here
hi
Hiiii
Why can't I speak on the voice channel?
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
#voice-verification
god that's gotta hurt
@somber heath fire alarm came on as soon as I joined
Oh, right. Fair enough. Don't burn to death.
@lavish rover I could hear you just fine.
it’s insane bc my resume gets accepted and i get an interview and then when they asked about maths
and when i tell them that i was 2-3 marks off
they suddenly change
even though i show the huge amounts of work in my portfolio
someone help #help-corn
this is python2
f(g(x))
how u doing today opal
i am also doing
I am pretending I am doing to avoid doing but end up doing
I am going to assume it doesn't mean what I think it means...
many shades xD
he removed it
so now
I don't know what to think
hello Mr. Hemlock
Pros: if you get into a fight, they can't grab your hair
But they can attack you with a plunger.
that would be devestating
the mental image of this goes crazy
if they stick the plunger right and they lose grip you can use it as a horn weapon
did they ask why you asked in the sense that you shouldn't have showed you lack the information
brb
would you do the same thing again?
Related to the hairloss thing. My GodVille hero's skills
It was a weird reaction unless you should have had that information yourself
"we like the cut of your jib" "we want you"
Quantum Leap? Oh boy.
hi griff
hi
hi ustafa
mustafa right now
when you have a cold black tea infused with bay leaves, cardamom pods and cinnamon bark is nice
Had me until the cinnamon
doxxed
Hi Anokhi
"im good" "this is super upsetting"
you will find it when you are not looking for it
6 years from now
his own hot and cold storage
180 what
💀
usd 2 strong rn
hi lp
@zenith radish
@rugged tundra go do leetcode
lo co geetdode
Will do 2 right now 🙏
hi coffee
yay
I screwed something up with noise suppression
so currently i sound like a jet engine
I wanna hear :3
Welcome back @whole bear
heyoo
I approve
I find it very appropriate that I have to get into my car and drive in order to vote today, when public transportation is on the ballot where I live.
I have a lot of names lol
Im gonna head out as well guys. See yall later!
Back when I get in the van
you might want to remove the debug printing cuz that would slow your multiprocessing by a lot
Ok let the fun part of the day begin
answered like a programmer
And done!
ggs
It was hilarious looking at the county sheriff and the same person was running as a democrat, a republican, and a libertarian.
candiru
Hi Vincent
how do i gain voice perms
ayo guys
is it possibel to creat mods with python
i think u should use java for that
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
shit gtg meeting sry
lol np
I'm really not sure how to being approaching this one
Kind of made me think of the day 21, but that doesn't really work
pythondiscord.com - A Django and Bulma web application. - site/pydis_site/apps/api/migrations at main · python-discord/site
@rugged tundra You DC'd
@rugged tundra just type for the Name field: Robert'); DROP TABLE Users;--
But said consumption is not even across the population.
yes, very disproportionate
Humans have long battled with food. For most of our time here on earth, it was a shortage that caused us great illnesses and eventually death. Our inability to farm in certain climates, store and preserve foods, along with our complex human dietary needs made it difficult to properly nourish ourselves. We saw countless lives […]
can't find a date on it tho
Oh we have Donald Trump here
If I remember correctly, there are more vacant houses than homeless people in the US?
Hi!
Feeling less sicky at all?
That's more because of AirBnb than anything else.
It's same if not worse, slept a bit and can't sleep now lol
just have to let it run it's course
ahh
ooooh, what is that
ajvar
!charinfo й** и
\u0439 : CYRILLIC SMALL LETTER SHORT I - й
\u002a : ASTERISK - *
\u002a : ASTERISK - *
\u0020 : SPACE -
\u0438 : CYRILLIC SMALL LETTER I - и
\u0439\u002a\u002a\u0020\u0438
\u6211 : CJK UNIFIED IDEOGRAPH-6211 - 我
It's surprisingly handy
v interesting and fun
I am hoping NH votes down the constitutional convention, politics is too toxic for it to work out well for anyone right now
Oh look, it's Hemlock!
I'm a pinecone?
Handstand walking
Meanwhile, biking in America be like
yes
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
https://www.tcl.com/us/en/products/home-theater/4-series/55-class-4-series-4k-uhd-led-smart-roku-tv-55s41 Got one of these
Stupid cheap right now
Meanwhile in Maine
https://californiaburritosnh.com/ourmenu/ we have this here
Hello
Yo
I'm just a beginner at coding learning the basics ..
a got a error while making a quiz game
What's the error?
You have an extra space before score on line 8
Or rather
One too few on 9
gotta dip, peace!
Buhbye!
Happy throwback Thursday from 2014!
#GabrielIglesias
making spaces blank lines in these place's doesn't do anything to my script right ?
Usually
Nope! Python just tosses them out when it runs it
So if it helps readability, keep them
@gentle flint https://pepperpalace.com/
American Prius
https://www.youtube.com/watch?v=kg78x_uzoHE @stray niche this is what I did in school
UMass Lowell Atmospheric Science (Meteorology) students gained real-world experience forecasting the weather during the unusual, 2015, winter-weather pattern.
Learn more about the Atmospheric Science program:
http://www.uml.edu/Sciences/EEAS
Video produced by Alfonso Velasquez
UMass Lowell Office of University Relations
and yes I am in this video
This was my teacher. We have upgraded the room with this amazing screen.
I want one of these.
Byeee
The Integrated Data Viewer (IDV) from Unidata is a free Java-based software framework for analyzing and visualizing geoscience data that runs on Windows, macOS, and Linux.
I know that song from top gun
Chrome cast and fire stick are awesome
Chrome cast was cooler when stadia wasn't shutting down
import asyncio
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
])
async def main():
app = make_app()
app.listen(8888)
await asyncio.Event().wait()
if __name__ == "__main__":
asyncio.run(main())
@lavish rover
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
!voice @brave pewter
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
if i spam here to try to get my 50 messages voice verification?
like will i get banned?
oh okok
im not gonna purposely push anything yeah
what do you guys code for?
mmm i see
do you guys go to school in computer science?
im in canadian college taking computer science right now
mmmm probably
its my first year
yeah yeah
python is very user friendly yeah
so far in school my classes are
IT mathematic
intro to programming (in depth python)
Operating software (we code in shell on linux)
website creation ( javascript in html + css)
my program in my school is also brand new and I find theyve structured the learning material fairly well
I mean my teacher for python anyways is very very helpful and Ive gotten very good at coding python. His homework is
-word document with instruction
-you code in vscode
-you can code as messily as you want as long as your program runs but you get better grade for efficiency in your code
if your code can do the given task using the least amount of loops and lines you get better grade
wanna see one of my more complicated program?
mmhm i understand
but in businesses its less about readability and more about, your code taking up the least amount of computer ressources
can i send it in here? its about a hundred lines
mmm i see your point
i mean i assume it depends where and how your code runs and how much times
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
some of the comments are in french btw
i wish i went to music it was my first pick for college but i had to audition so i chickened out
german seems tricky
yeahyeah
speaking is soso but the grammar rules are absolutely chaotic
its okay XD
french is my first language and I still muchh preffer writting in english
we have gendered nouns maaan
like lamp is feminine and a tree is male
a fridge is male
but its funny because you have male oriented things that are female like
a testical is a female noun
just very annoying because you have to conjugate verbs and adjectives differently depending on the gender noun they refer to
i need a quick help :0.. i want to put line's after those every single answers marked with red
and when youre writting a 700 word literary analysis in crunched time and you have a limit amount of errors to pass its annoying to correct
!e py print("Hello") print() print("World")
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello
002 |
003 | World
!e py print("Hello", end = "\n\n") print("World.")
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello
002 |
003 | World.
!e py print("Hello\n") print("World")
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello
002 |
003 | World
i also recommend using VScode
weve been using it all through this symester and intellisense is great
nice works
How beginners findout solutions for this kind of problems .. when they don't know about what function they need to do it ..
My plan for the future is to graduate from cegep (college) and get an internship during summers, take an extra math class for my complementary classes and then
Python is well documented
id like to go into software engineering at mcgill (university where I live) or something
for math weve learned boolean algebra, computer binary operations, lots of bases so hexadecimal, octal and binary of course
i had an exam yesterday i aced it
amongst other thinngs
One thing I'd recommend is looking up the downloadabale pdf versions of the documentation from python.org.
library.pdf is the Python bible.
@kind sequoia 👋
Happy Full Moon
It's works like a quizgame now .. but still not so fun right ? I meen is there any way to put designs / colours
etc etc to make it look better then i will export it
You could look into ANSI escape characters / colorama
Look into other characters you can print. Your character map app will have a bunch.
how should i export it ?
just want to export it and give someone else to try without seeing the code's
I just can't get over how extra turkeys really are.
Look at those layers
Pretty feathers.
you're in an international server
quite a few of us will not
@whole bear Pen caps exist. As do pocket protectors.
did you liked the line ...? 😂
I think that I'm missing the context necessary to fully appreciate it.
a=input("Enter String 1")
b=input("Enter String 2")
c=""
for i in a:
if i not in b:
c=c+i
print(c)```
a="Hey There"
b="Hello woow"
c=a+b
for i in a:
for j in b:
if i==j:
c=c.replace(i,"")
print(c)```
Python Enhancement Proposals (PEPs)
! =
hii
everyone left
dudes in voice chat
u can see these messages?
bruh am muted, but need help with python stuff
!voice
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
What's your question?
yea not been in chat long enought
imports stuff, it would be easier to show with screen share
i can show with screenshots but would take agges
and i cba really with that
All rights belong to Jonathan Coulton.
A song from his album Our Bodies, Ourselves, Our Cybernetic Arms.
Make sure to support him at: https://www.jonathancoulton.com
Can you give some detail of your problem? Perhaps a code example of what you're attempting?
no module named "module name" error
looked all over online, having problem for months
i made
i can send screenshots of my folder arrangement if u like
hang on, RTC being really annyoing, gimme 2 mins brb
Oh gotta love that
So is it that you're running Main but it's not seeing the MenuSystem stuff?
Cython vs python
python
So Python has a problem when it comes to seeing things above the file you're running
yep, exactly
If that makes sense
it has no problem going down but up is a no go
So I'd just nest the MenuSystem module/folder within the checkers_with_AI folder
checkers_with_AI/MenuSystem
Ohhhhhhh
That's... confusing nomenclature wise
My brain thought Main would be the entry point
so like a main menu with games
yea it is,
i made checkers first then the main menu, so now i have two mains, ill fix that later
Is the plan to have multiple games?
yep
Gotcha, okay
So yeah this is likely how I would do it, but I'd change the MenuSystem to be the name of the overall project. Game launcher or something. Then you'd have your individual games in their own modules inside that main folder, along with your MenuMain.py and button.py and any other things you need to touch the games
okay, lemme make that ill brb
PHP's literally C# but way better
instagram doesnt use django guys
instagram uses a billion tools, django included
trust me they also use bash
okay so ive re-arranged it
both files work independently, checkers works and the main menu workds
but now how can i get menu main to run MenuMain
@rugged root
Double checking
Making sure I'm not giving you terrible advice
Most of the time you'll be running it from the source folder/project folder, rather than the project root
Minor example
They taught sheep to use touch screens to choose between water and feed. It was really user friendly.
@whole bear 37 + 5 = ?
57
That is a big boy repo

Pascal???
what
okay, ill try to get it working with this new file arrangement thanks
im just a little confused how im supposed to get my checkers to work in main
Voice verification
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
#voice-verification
In #voice-verification do the !voiceverify command
AHA it works!
Niiiiiice
but the way im doing it is gonna be very messy
is there any way to import everything in one go? im doing it like this:
hey, yes i cant speak
import these all in one file.
and then import that main file?
hemlock should confirm this, but should work?
Double checking
Think you can do it in an __init__.py file, just trying to remember how
x[y] === *(x+y)
damn i should really hang out more in this call, im learning more here than in my comp sci class lmao
https://docs.python.org/3/reference/import.html#submodules There's the section (paragraph) on it in the docs, trying to find a better article describing it.
https://stackoverflow.com/a/29509611/8346740 does a pretty good job
https://timothybramlett.com/How_to_create_a_Python_Package_with___init__py.html This one's not bad either
alright, ill have a look into these, if i cant find anything ill come back
thanks for the help boss man, solved many months of procrastination lmao
boss man 🗿🗿🗿
Happy to. The folks in #game-development will likely have better ideas on how to handle something like that as well
this says 80% energy goes towards spam management
Sounds right
Sounds about right
I'd imagine of the remaining energy for "sending mails" a large proportion goes to spam mail being sent as well
McAfee estimated that around 80% of this electricity is consumed by the reading and deleting of spam and the searching through spam folders to dig out genuine emails that ended up there by accident. Spam filters themselves account for 16%. The actual generation and sending of the spam is a very small proportion of the footprint.
trying to format it
Thanks
Can I ask programming question here or I should post it in one of #help channel?
It's not long, probably max 6 lines with code as example
You can ask here if you want
But no guarantees the people here might be able to help, depending on what you're doing
Which one is more optimised, in sense of time complexity?
alp = 'abcdefghijklmnopqrstuvwxyz'
or
import string
alp = string.ascii_lowercase
If you're talking about O() it doesn't matter, both are constant
In reality I would assume the first one is faster, but the difference is so incredibly miniscule, and it's a one-time cost, so it really doesn't matter
I would use the second one just for consistency
I see. And what about Space it takes? I think declaring a variable is more space friendly than using a whole library for just getting lowercase alphabets.
@plucky delta Probably better to talk in here
Ok
it's constant cost, it doesn't matter
and if it does matter, you're using the wrong language
def primes(int nb_primes):
cdef int n, i, len_p
cdef int p[1000]
if nb_primes > 1000:
nb_primes = 1000
len_p = 0 # The current number of elements in p.
n = 2
while len_p < nb_primes:
# Is n prime?
for i in p[:len_p]:
if n % i == 0:
break
# If no break occurred in the loop, we have a prime.
else:
p[len_p] = n
len_p += 1
n += 1
# Let's copy the result into a Python list:
result_as_list = [prime for prime in p[:len_p]]
return result_as_list
Oh, okay, I used to code in C, so getting curious about these things is kind of a habbit.
File "cythonshouldbefast.pyx", line 3, in cythonshouldbefast.main_cython
l = [1]
ValueError: Assignment to slice of wrong length, expected 1, got 100000000
Thank you guys!
rip
Fair enough, but the python runtime already has a significant overhead, small things like these don't make any noticable difference.
Create a function sort to sort the letters in a text alphabetically (lowercase only). sort(“abdaba”) returns aaabbd. i have this question on a task but how do i sort it without using sorted
what have you tried so far
@whole bear If you're wondering why you can't talk, check out the #voice-verification channel. That'll tell you what you need to know about our voice gate
def sorteer(tekst):
return sorted(tekst)
def main():
tekst = "abdaba"
print(sorteer(tekst))
if __name__ == '__main__':
main()
that doesn't seem to not use sorted
but ye i used sorted and it gave a list as output
i gues my code is fucked
XD
you can join it if you want a string
I'm guessing list.sort is not an option
nope
# distutils: language=c++
from libcpp.vector cimport vector
def primes(unsigned int nb_primes):
cdef int n, i
cdef vector[int] p
p.reserve(nb_primes) # allocate memory for 'nb_primes' elements.
n = 2
while p.size() < nb_primes: # size() for vectors is similar to len()
for i in p:
if n % i == 0:
break
else:
p.push_back(n) # push_back is similar to append()
n += 1
# If possible, C values and C++ objects are automatically
# converted to Python objects at need.
return p # so here, the vector will be copied into a Python list.
If there's no complexity constraints, implementing bubble sort is pretty easy
so we're gonna use vectors?
mergesort is also pretty trivial
The merge step is kinda annoying
Off by one errors territory
But yeah runs faster 🤷♀️
hello
okay, running into another problem here. I have this folder structure:
and i am having the import error: ImportError: attempted relative import with no known parent package
A tree absorbs on average 25kg of CO2
def sorteer(tekst):
oud_tekst = tekst
nieuw_tekst = ""
kleinste_letter = ""
while len(nieuw_tekst) != len(oud_tekst):
for i in range(len(tekst)):
if i == 0:
kleinste_letter = tekst[i]
elif ord(tekst[i]) < ord(kleinste_letter):
kleinste_letter = tekst[i]
# voeg kleinste letter toe aan nieuw tekst
nieuw_tekst += kleinste_letter
# verwijder toegevoegde (kleinste letter) uit tekst
locatie = tekst.find(kleinste_letter)
tekst = tekst[:locatie] + tekst[locatie + 1:]
return nieuw_tekst
def main():
tekst = "abdaba"
print(sorteer(tekst))
if __name__ == '__main__':
main()
i got it
if you're comparing letters you don't need to use ord
it seems that's a selection sort?
every day? year?
year
Hmm
Nuuuu you left us
haha
One more time.
You can use symbols or words in your search to make your search results more precise. Google Search usually ignores punctuation that isn’t part of a search operator. Don’t put spaces between
makeshift splint?
Attempted. According to @stray niche I was doing it wrong
yes according to you having more pain
Fair
you were typing 4 letters for so long?
His finger is broken cut him some slack
popsicle sticks, medical tape
duct tape sir? really
yess or gauzes work too
Isn't it duck tape
nooo
Yes and no
Originally it was duck tape
But then it became a brand, so it got changed to duct tape
it was made during wars
But it was used - yep
ohh
For sealing ammo boxes
And kept the water out
yea
i see
waxes hair off the body
I didn't realize it became a brand name
Doesn't sound like the ideal way to wax hair
Depends
why no vc @whole bear
I only know this because I did it to my brothers leg as a kid
im playing a game with a friend hehe
So we're clear you need to be on the VC to redeem your $1 a day
havfun
This doesn't count
What game?
Im here. wire me moni
send me PayPal email
i didnt get yesterdays dollar either so contract terminated
its minecraft but a progressive mod
Minimum payment amount is $10 to avoid excess transaction dees
dees nuts?
sorry i had to
lemme search
fair enough
Your current balance is: $1, please use !balance for further queries
Danke!
Gerne
It's always minecraft never yourscraft
no its ourcraft
no mustafa its ourcraft
wow
(multiplayer)
i said the sameee @whole bear
Derp
bingo buddy
this works
jinx....buy me a soda
okay, you need to come to vc for that
I'll just transfer sam's $1 to you
Your current balance is: $2, please use !balance for further queries
deal
Sam your typing is coming through
One would hope so, otherwise the chat would be broken
no the sounds
(sarcasm)
for a sec I thought this tooo
yea geddit
@rugged tundra you know already
I will do LeetCode now
https://www.udacity.com/course/data-structures-and-algorithms-in-python--ud513?irclickid=QocVPc14RxyNUB4z4awsn27YUkDX631NQyfZw80&irgwc=1&utm_source=affiliate&utm_medium=&aff=3552395&utm_term=&utm_campaign=__&utm_content=&adid=786224 was thinking about this course
Going to be up and down for a bit, trying to fix one of our phones
okie dokes
But plastics are very cheap.
@karmic elk you wanted to say something?
saw you unmute
Fossil fuels / fossil fires / fossils are what I desire
(Parody of Fuel by Metallica)