#voice-chat-text-0
1 messages · Page 130 of 1
!stream 322504171636916226
✅ @lucid blade can now stream until <t:1683746427:f>.
@lucid blade you 3D print ?
i need one of doze
ELO - TIME Full Album 1981 - pretty good
def ham(pork: tuple[int] | tuple[()]):
...
whats this ???
Mojo is a new LLVM programming language designed as a superset of Python with the low-level performance of C. It is optimized to run on GPUs with CUDA and other exotic hardware for deep learning and Artificial Intelligence.
#programming #tech #thecodereport
💬 Chat with Me on Discord
🔗 Resources
- Mojo Language...
Danke!
✅ @neon vigil can now stream until <t:1683750155:f>.
!stream 418374628889853952
✅ @neon vigil can now stream until <t:1683750689:f>.
I'm debating between
resp_dict["nodes"] = list(
map(lambda node: node.to_api_dict(), resp_dict["nodes"])
)
and
resp_dict["nodes"] = [node.to_api_dict() for node in resp_dict["nodes"]]
The second one seems more readable to me, though I'm not sure. Is there a performance advantage to using map and lambda?
Can't know without testing
fair
it's timeit time
In [10]: class Foo:
...: def __init__(self, x):
...: self.x = x
...: def unpack(self):
...: self.x = {"int": self.x}
...:
In [11]: def lambda_func():
...: mylist = [Foo(i) for i in range(100)]
...: mylist = list(
...: map(lambda z: z.unpack(), mylist)
...: )
...:
In [12]: def list_compr_func():
...: mylist = [Foo(i) for i in range(100)]
...: mylist = [z.unpack() for z in mylist]
...:
In [13]: %timeit lambda_func()
54.8 µs ± 2.5 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
In [14]: %timeit list_compr_func()
47.8 µs ± 227 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
In [15]: %timeit lambda_func()
53.3 µs ± 797 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
In [16]: %timeit list_compr_func()
47.9 µs ± 92.9 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
In [17]:
the list comprehension is consistently faster than the lambda
question answered I guess
!pep 416
@vital galleon
https://beeware.org/ This would be for the UI and the bundling.
its like python but like fast and has static typing(if u choose) and structs. basically the typescript of python

Yeah, so BeeWare is the overall suite
Toga seems to be the GUI, and Briefcase is the packaging part
Seriously all their mascots are adorable
Thank you - currently going through their set up process
I really hope it ends up being good for you
I wonder if there's a GNUI project.
@granite fulcrum im just beginner python programmer - is Mojo going to be open source ? looks kinda like payware , not sure
Why do I need different slashes in Windows to give path -
I have the following code - filtered_df = pd.read_csv("D:\get_something\/final_df.csv"
Why can't I just do - filtered_df = pd.read_csv("D:\get_something\final_df.csv"
i would personaly learn python as mojo is a "superset" and i dont think its out yet.
@granite fulcrum ok cool
@foggy plaza
@ripe garden ok cool
@kindred granite ok cool
@full salmon 👋
👋 Hi, I do not have voice uasge permissions yet. I am a beginner with Python
!voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
I tried this. But it says 50+ messages and then something about not being active for 3 of 10minute blocks I guess though I have been active more than that
So I thought of waiting for 50+ messages. Not sure if there is another way though
Yeah, true. I don't happen to know much of the answers to message and I have asked few questions that I am working on, but they are usually very fundamental
Thanks! Yeah true, your advice is a good one. I sort get into details and it tends to become dry.
I should work on more fundamental problems to begin with I guess
'sup
'sup
Sorry, I didn't completely follow the class objects example. Can you please mention it again for me. Would you happen to be sharing your screen?
Oh okay, I got it. Sorry, I had forgotten about how it works
Do we call this by any particular name for the way of accessing data by using the methods of a class? I understand how we do this. But Like OOPS concepts, could we call this as abstraction
class MyClass:
pass```
Hello Opal
class MyClass:
pass
MyClass()
Object is an instance of this class. (Correction object is an reference to the instance of the class)
Ok sure.
a =input("enter a variable") # vary basic way of taking input from user during run time
!e ```py
class MyClass:
pass
a = MyClass()
b = MyClass()
print(id(a))
print(id(b))```
Sorry, yeah, coming to the point that we were discussing. Garbage collection concept is not my strong point. Maybe let's get to this after we go over some of the class and objects stuff if that's all right
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 140187321630928
002 | 140187321630992
You know in some languages we do like 'classname objectname' , but in python this syntax is not mandatory if I am not wrong
!e ```py
class MyClass:
def my_method(self):
print('Hello, world.')
instance = MyClass()
instance.my_method()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world.
Like here we used Myclass() twice and it still created two instances of the class, but with both instances name being Myclass right?
Okay
a is b```
I do. But I also get that it works in a non-intuitive way sometimes in python. I do have to explore this
Yeah, I have used is operator
== and is seem to have their differences that I have to completely understand later
No, I am quite confused about self used in class
I know they use it to say that we are referring to the same class we are in and has something to do with the scope of where to access the variable maybe as per my understanding until now
!e ```py
class MyClass:
def is_self(self, arg):
print(self is arg)
a = MyClass()
b = MyClass()
a.is_self(a)
a.is_self(b)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | True
002 | False
instancename.methodname(arg,..,)
class classname:
def method name(self,arg,...):
.....
self is instancename (basically what is at the left side of the dot operator)
This is my understanding. I think I followed your explanation
!e ```py
class MyClass:
def is_self(self, arg):
print(self is arg)
a = MyClass()
a.is_self(a)
MyClass.is_self(a, a)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | True
002 | True
Can we say 'a' or 'b' or instancename is a reference to the instance created from the class (for ex MyClass)
( and also instancename could be called as OBJECT of the class I guess)
I didn't follow the last line here. Sorry, what is the point about syntactic sugar
Is my second point here fine for defining object or is there a better way
Yeah, true.
Do you mean return type of the class when you say 'type'?
I don't have the permission to talk..
!,voice
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
Is it correct to say 'Class is one of the datatypes and object is of the type Class'?
Sorry, I am bit slow in typing. Hope it is not inconvenient for you
!e ```py
class MyClass:
def init(self):
print('Hello, world.')
MyClass()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world.
Can we say Dunder as In-built methods of the class datatype
as I thought as they are not always in our code, but python looks for them in it's 'source code'(not sure if the word source code is correct), I called them as built-in methods
!e ```py
class MyClass:
def init(self, arg):
print(arg)
MyClass('Hello, world.')```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world.
Sorry, did you happen to mention not all classes have them defined or not defined?
!e py 'abc' / 5
@somber heath :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "/home/main.py", line 1, in <module>
003 | 'abc' / 5
004 | ~~~~~~^~~
005 | TypeError: unsupported operand type(s) for /: 'str' and 'int'
!e py print(hasattr(str, '__div__'))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
False
I have to go.. Nice to meet you @somber heath see you later..
My guess is that we cannot use divide operand with a class datatype
!e ```py
class MyClass:
def add(self, arg):
return f'Hello, world. I was given {arg}.'
a = MyClass()
print(a + 123)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world. I was given 123.
In this ex, self is actually 'a' instancename right?
!e py print('abc'[0])
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
a
I have not done it this way. It is interesting to see this syntax. I have done as
y= 'abc'
print(y[0])
Both actually mean the same and I get it now
Sounds good
!e ```py
class MyClass:
def getitem(self, key):
return f'I am getitem. Have {key} back.'
instance = MyClass()
print(instance['mykey'])```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
I am getitem. Have mykey back.
Is this called retrieval subscription dunder method?
!e ```py
class MyClass:
def setitem(self, key, value):
print(f'I am setitem. {key = } and {value = }.')
instance = MyClass()
instance['mykey'] = 'myvalue'```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
I am setitem. key = 'mykey' and value = 'myvalue'.
Oh, in Java they have setter and getter functions. I don't know Java, but know just this
!e ```py
class Person:
def init(self, arg):
self.name = arg
def greet(self):
print(f'Hello. I am {self.name}.')
a = Person('Peter')
b = Person('Sally')
a.greet()
b.greet()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello. I am Peter.
002 | Hello. I am Sally.
Nice way to define, methods are functions attached to an instance of a class.
I just saw an usage of del to delete items of a item (not sure if it can be used for full list deletion itself). Seems del can be used with classes as well then
Okay, yeah we have .clear(), .pop() for list elements
When del does dereference the instance of a class, but the object does not go away. So, when does the object actually get deleted (as we discussed object is removed only when it is not referenced any more)
Okay, this garbage collection is done during the program run time actually (when anything that is dereferenced exists) ?
Thanks!
Key, arg etc in our examples
Can we please try this scope & namespace scenarios in couple of small examples as I do follow few points of scope and namespace. But I am still not confident
class App:
def run(self):
while True:
...
App().run()```
I mean with classes and methods maybe
No problem, you can talk it out
I need to log off for a second and log back in
to see if my voice gate is passed
!e ```py
def outer():
str = 'enclosing'
def inner():
str = 'local'
print(str)
inner()
str = 'global'
outer()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
local
!e ```py
def outer():
str = 'enclosing'
def inner():
print(str)
inner()
str = 'global'
outer()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
enclosing
variable str redefined when class called
!e ```py
def outer():
def inner():
print(str)
inner()
str = 'global'
outer()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
global
!e ```py
def outer():
def inner():
print(str)
inner()
outer()```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'str'>
class functions are able to access global variables
what the frick happened there
no error?
oh str is a defined type
yes yes priorities
The order of locations that Python tries to find things.
i see it more as a runtime order
maybe that's the wrong way to think about it
but i kind of see things in assembly
Hi guys, I have a doubt.
wat is it
Here is the code:
# - Create a distance converter converting Km to miles
# - Take two inputs from user: Their first name and the distance in km
# - Print: Greet user by name and show km, and mile values
# - 1 mile is 1.609 kilometers
# - hint: use correct types for calculating and print
# - Did you capitalize the name
name = input('What is your name?: ')
km_distance = input('Enter your distance in km: ')
float(km_distance)
miles = km_distance/1.609
print(f'Hello {name}!')
print(f'The your km to miles conversion is {miles}')
and here is the output:
no
!e
- Create a distance converter converting Km to miles
- Take two inputs from user: Their first name and the distance in km
- Print: Greet user by name and show km, and mile values
- 1 mile is 1.609 kilometers
- hint: use correct types for calculating and print
- Did you capitalize the name
name = input('What is your name?: ')
km_distance = input('Enter your distance in km: ')
float(km_distance)
miles = km_distance/1.609
print(f'Hello {name}!')
print(f'The your km to miles conversion is {miles}')
@dense meadow :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 8, in <module>
003 | name = input('What is your name?: ')
004 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
005 | EOFError: EOF when reading a line
the error is actually: Traceback (most recent call last): TypeError: unsupported operand type(s) for /: 'str' and 'float'
no
wait
unsupported operand type(s) for /: 'str' and 'float'
lemme recode it for u
this is the error
name = input('What is your name?: ')
while not name:
name = input('Please enter your name: ')
km_distance = input('Enter your distance in km: ')
while not km_distance.isdigit():
km_distance = input('Please enter a valid distance in km: ')
km_distance = float(km_distance)
miles = km_distance / 1.609
print(f'Hello {name.capitalize()}!')
print(f'Your distance of {km_distance} kilometers is equal to {miles:.2f} miles.')
!e ```py
class MyClass:
def truediv(self, arg): #not div !
return f'Hello, world. I was given {arg}.'
a = MyClass()
print(a / 123)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
Hello, world. I was given 123.
👋
I hate printers
textbox = customtkinter.CTkTextbox(app)
textbox.insert("0.0", "new text to insert") # insert at line 0 character 0
text = textbox.get("0.0", "end") # get text from line 0 character 0 till the end
textbox.delete("0.0", "end") # delete all text
textbox.configure(state="disabled") # configure textbox to be read-only
@full salmon How's it going? Been seeing you around a lot just haven't gotten a chance to interact with you
what else is new
hi
@gentle flint What brand of drill did you get again?
bosch
specifically a bosch gsr 12v-15
some of the bosch drills are crap
some are pretty good
this one's pretty good
Solid
don't get one of the green ones
the blue ones are better
3 votes and 4 comments so far on Reddit
Weird
no, they're different product categories
they colour their professional tools blue
the cheap diy ones green
The bag is blue but the drill is teal
Hmmmmmmmmmm
(I know it's one of the blue quality ones)
#![allow(unused_variables, dead_code, non_snake_case, unused_imports)]
extern crate nalgebra as na;
use std::thread::sleep_ms;
use macroquad::{prelude::*, color::{self, colors}};
//my lib
#[path = "../src/physics_sim.rs"]
mod physics_sim;
use physics_sim::*;
//CONSTANTS
const GRAVITY: na::Vector2<f64> = na::vector![0.0, 9.8];
#[macroquad::main("physics sim")]
async fn main () {
//solver 1
let mut objects: Vec<VerletObject> = Vec::new();
let mut test_link: Vec<[f64; 3]> = vec![[0.0,0.0,0.0]];
objects.push(VerletObject{position_current: na::vector![370.0, 220.0], position_old: na::vector![370.0, 220.0], radius: 10.0, mass: 1000.0, acceleration: na::vector![0.0, 0.0], color: GREEN});
//solver 2
let mut objects2: Vec<VerletObject> = Vec::new();
let mut test_link2: Vec<[f64; 3]> = vec![[0.0,0.0,0.0]];
objects2.push(VerletObject{position_current: na::vector![370.0, 220.0], position_old: na::vector![370.0, 220.0], radius: 10.0, mass: 1000.0, acceleration: na::vector![0.0, 0.0], color: RED});
let mut solver = Solver{objects: objects, gravity: GRAVITY, circle: na::vector![350.0, 220.0, 150.0], links: test_link, ..Default::default()};
let mut spawn = 100;
//keeps window open
let mut x = 0;
loop {
if macroquad::input::is_key_pressed(macroquad::input::KeyCode::Q) {
break;
}
clear_background(WHITE);
if x > 10 {
solver.objects.push(VerletObject{position_current: na::vector![370.0, 220.0], position_old: na::vector![370.0, 220.0], radius: 1.0, mass: 1000.0, acceleration: na::vector![0.0, 0.0], color: GREEN});
x = 0;
}
x += 1;
solver.Update(0.01, 10);
solver.Draw();
next_frame().await;
}
}
How do I even start coding. Im beginner
Coding in general
Im currently in a Wordpress class. They're using HTML and CSS basic
but I want to focus on learning Python
!resources I frequently recommended Corey Schafer's YouTube playlist for Python beginners.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
I wrote my first Python code yesterday
What are some cool projects to work on that are easy/intermediate. I have a bunch of employers I will be interviewing with, and I would like to have a little bit of a portfolio
sent you a friend request
What is your current job? @rugged root
Yeah this wordpress class I am in runs all summer, but I would like in the next 3 months to have a basic/intermediate understanding and work on projects to show for my work as well.
Anyone have thoughts about real python courses and tutorials?
The articles are amazing, haven't heard much about the course
!kindling There's a bunch of project ideas on here, and it's certainly good to try and make stuff
The Kindling projects page on Ned Batchelder's website contains a list of projects and ideas programmers can tackle to build their skills and knowledge.
Even if it's not new or innovative
gotta go, still waiting on Tears of the Kingdom
Cool, i'll check it out,
Saaaaaaaaaaaaaaaaaaaame
I personally feel like its better to have a few small/medium projects that are "been there seen that" comparative to not having anything to show for lol
@slate light are you red team or blue team?
My pre-order may or may not arrive tomorrow--at best I'll see it by Saturday/Sunday, which sucks
if you know anything about cyber sec you would know what I mean
I did the digital pre-order (which I know, what a waste) but at least I'll have it installed updated and ready
No, it's attacking and hacking other people (red team) blue team (security forensics and data analysis)
for now im doing python
Excuse me, but I have a doubt.
How do I Add user input into a list?
Here is the exercise they sent me:
list.append, input
Or list.insert, depending
oh okay i will try it
!e py my_list = [] print(my_list) my_list.append('abc') print(my_list) my_list.append(123) print(my_list)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | []
002 | ['abc']
003 | ['abc', 123]
what if we already have some contents in the list?
this is the full list:
sales_w1 = [7,3,42,19,15,35,9]
sales_w2 = [12,4,26,10,7,28]
sales = []
sales = sales_w1 + sales_w2
https://github.com/gregmalcolm/python_koans
anyone tried this? is it basics or questions are of good level.
i have to add user input to sales 2[] list
You needn't create the empty list.
I have to merge sales_w2 and sales_w1 into 1 list after accepting user invite from sales_w2
Remember about the return type of input and casting?
yes
int(sales_2)
but how do i accept user input and then put it into a list
I got it!
@midnight agate
The input function asks for user input.
number_list2 = input("Enter your number")
int(number_list2)
sales_w2.append(number_list2)
I would like to look into these exercises. Can you please share the link
Thanks.
done
The articles are there to advertise the courses, so I reckon the courses are probably pretty good too.
What is the type of object being appended?
my small machine
i don't understand
wait
when i run the code, it comes into the list as an str
Every object in Python is of a type. You are appending an object to the list object. What type is the object you're adding to the list?
Correct.
I typecasted the wrong variable lol
it should have been : int(sales_w2)
Array to a list? 
@dense meadow But why was it a str instead of an int?
the exercise
and this is the code
sales_w1 = [7,3,42,19,15,35,9]
sales_w2 = [12,4,26,10,7,28]
sales = []
sales = sales_w1 + sales_w2
number_list2 = input("Enter your number")
int(sales_w2)
sales_w2.append(number_list2)
print(sales_w2)
print(sales)
int(obj)```How do you remember this for later use?
sorry but i don't understand
int() converts anything except int into a int
Including ints.
LP you should take part in the next bot programming challenge https://www.codingame.com/events
It's pretty fun even if you don't do very well 😄
really?
int('5')```What does this evaluate to/return?
5
string to int type conversion
abc = input(...)
5 #int(abc)
my_list.append(abc)```
there is no list
Pretend.
Ok
number_list2 = input("Enter your number")
int(sales_w2)
sales_w2.append(number_list2)
no
number_list2 = input("Enter your number")
5 #int(sales_w2)
sales_w2.append(number_list2)
I am making a point.
int is not an in-place operation.
what do you mean?
It is evaluated to an int /returns an int.
ok
The call to something is replaced by its return.
!e py v = '123' int(v) print(type(v))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'str'>
:0
how??
Yeah it's language on top of the GObject system.
^
Pretty nice actually.
!e py v = '123' 123 #int(v) print(type(v))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'str'>
Roughly equivalent code.
!e
v = '123'
123 #int(v)
print(type(v))
print(v)
@dense meadow :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | <class 'str'>
002 | 123
!e py print('123', type('123')) print(123, type(123))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 123 <class 'str'>
002 | 123 <class 'int'>
new_day = input('Enter #of lemonades for new day: ')
sales_w2.append(int(new_day))
sales.extend(sales_w1)
sales.extend(sales_w2)
got it
thanks opal
I hadn't noticed this yet ( int being not an in-place operation)
Mhm.
ValueError: invalid literal for int() with base 10: 'yolo'
random.shuffle is an example of an in-place operation.
will check this out. thanks!
I'm contemplating whether I have the strength the not buy the digital edition
I think we have a similar situation in the UK right?

Ah right, I don't think I even noticed that.
Yep, I didn't
!e py import random my_list = list(range(10)) print(my_list) result = random.shuffle(my_list) print(result) print(my_list)@full salmon
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
002 | None
003 | [2, 9, 1, 7, 5, 6, 8, 0, 3, 4]
I think I'm a bit test-wise when it comes to these problems, because I've done so many of them.
Gtg 👋
Later bud
Nah, I filed a leave tomorrow so I'm good
A days wait ain't gonna kill me
Wait you really took tomorrow off to play?
here
this example helped to understand the in-place operation. wondering if we call thee int() sort of operation that was not in-place by any name as well or not!
int is a returning operation, even though all calls that complete return something.
That's more of a colloquial designation.
makes sense! int returns int type
!e
ham = print("I return None")
print(ham)
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | I return None
002 | None
!e
def spam():
2 + 2
pork = spam()
print(pork)
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
None
Boss is also a Zelda fan... so 🤷♂️
and we're really not that busy
@full salmon See if you can turn on Krisp.
// Auto-generated code below aims at helping you parse
// the standard input according to the problem statement.
program Answer;
{$H+}
uses sysutils, strutils, classes, math;
// Helper to read a line and split tokens
procedure ParseIn(Inputs: TStrings) ;
var Line : string;
begin
readln(Line);
Inputs.Clear;
Inputs.Delimiter := ' ';
Inputs.DelimitedText := Line;
end;
var
N : Int32;
i : Int32;
Inputs: TStringList;
begin
Inputs := TStringList.Create;
ParseIn(Inputs);
N := StrToInt(Inputs[0]);
writeln(DupeString('#', N));
for i:= 1 to N-2 do
begin
writeln('#' + DupeString(' ', N-2) + '#');
end;
writeln(DupeString('#', N));
flush(StdErr); flush(output); // DO NOT REMOVE
end.```
writeln(DupeString('#', N));
for i:= 1 to N-2 do
begin
writeln('#' + DupeString(' ', N-2) + '#');
end;
writeln(DupeString('#', N));```
starmap
Can’t talk in voice chat? Check out #voice-verification to get access. The criteria for verifying are specified there.
1 of 2
noun
dis·cord ˈdi-ˌskȯrd
Synonyms of discord
1
a
: lack of agreement or harmony (as between persons, things, or ideas)
… must we fall into the jabber and babel of discord while victory is still unattained?
—Sir Winston Churchill
b
: active quarreling or conflict resulting from discord among persons or factions : STRIFE
marital discord
discord between the two parties
2
a music
(1)
: a combination of musical sounds that strikes the ear harshly
(2)
: DISSONANCE
The song ends on a discord.
b
: a harsh or unpleasant sound```
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
@terse needle Yo
Good evening guys, I am stuck with some web-dev problem, anyone is free?
I was making a sidebar and I did make it just fine with normal HTML, CSS and BS5.
But I can't figure out how can I use the white spaces on the rest of the screen to show contents(graphs/charts/etc)
class Stereo:
pass```@Mr.Hemlock#2740
Gym Class Heros - Stereo Hearts
https://lexi-lambda.github.io/hackett/ Lisp + Haskell
No.
Rejected.
Lisp is an atrocity.
What would you get if you combined a cutting edge, state of the art macro system with a tried and true, industrial-strength type system? The answer is Hackett, a programming language that embeds the power of the Haskell type system within the Racket macro system. Traditional approaches to macro-enabled Haskells have been relatively straightforwa...
!e py class MyClass: pass print(type(MyClass))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'type'>
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.
@pure sun Sup. Sorry, I typically don't add people as friends until I get to know them a bit better
!e ```py
class MyClass:
pass
print(MyClass.mro())```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
[<class '__main__.MyClass'>, <class 'object'>]
it's ok. I heard you helping the kid and i thought i would learn a great deal from you.
https://paste.pythondiscord.com/vobuhimure sidebar.html
https://paste.pythondiscord.com/dacaberaca style.css
https://paste.pythondiscord.com/ihefolapiy weather.html (trying to make this html page show on the white part when clicked "dashboard" button)
That Hyena joke took me ages to get
!e
ham = object()
print(type(ham))
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
<class 'object'>
A gimlet is a hand tool for drilling small holes, mainly in wood, without splitting. It was defined in Joseph Gwilt's Architecture (1859) as "a piece of steel of a semi-cylindrical form, hollow on one side, having a cross handle at one end and a worm or screw at the other".A gimlet is always a small tool. A similar tool of larger size is called...
Well named, that
Once marijuana is legalized in Canada, how will police test for pot impairment? 22 Minutes has exclusive footage of some new RCMP techniques. Watch the show in Canada on the FREE CBC Gem app: https://gem.cbc.ca/media/this-hour-has-22-minutes/s29
22 Minutes on TikTok: https://www.tiktok.com/@thishourhas22minutes
22 Minutes on Facebook: https://w...
Why do I need different slashes in Windows to give path -
I have the following code - filtered_df = pd.read_csv("D:\get_something\/final_df
I use ubuntu )
i use mint
I think this is something to do with form feed with Windows
I just want to make sure that \/ was okay
I think you can move the csv file or your script file
Actually I shipped some code using \/ so I want to be sure
hi i have doubt about pyspark error
I just want to make sure that \/ was okay
filtered_df = pd.read_csv(r"D:\get_something\final_df")
# or
filtered_df = pd.read_csv("D:\\get_something\\final_df")
!d pathlib
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:
😻
Follow me, human
She's going to stand there and change her mind now lol
My cat always does that
Wait, are you talking about pathlib.Path vs pathlib.PurePath? 
Cacio e pepe 😄
I'm pretty sure eating that much pepper will give you kidney stones
;-;
okay
is there a way to enable mic before 3 days? I just joined
Sorry. We don't generally make exceptions to the voice gate.
its okay, just wanted to give a shot and try. Will hang out in chats.
I always do shapes or animals 😄
Animal -> Dog -> Shepherd
!e
class Student:
def __init__(self, name: str, age: int, favorite_subject: str):
self.name = name
self.age = age
self.favorite_subject = favorite_subject
def introduce(self):
print(f"Hello, I'm {self.name}, and I am {self.age} years old.")
sally = Student("Sally", 10, "Science")
billy = Student("Billy", 8, "History")
sally.introduce()
billy.introduce()
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello, I'm Sally, and I am 10 years old.
002 | Hello, I'm Billy, and I am 8 years old.
it might sound as dump question, but is there diff between methods and functions?
except method is under class, and func is not
methods are functions that are defined in classes
nope other than that, they are the same
Student().introduce(sally)
would it not be Student.introduce(sally)
!e
class Student:
def __init__(self, name: str, age: int, favorite_subject: str):
self.name = name
self.age = age
self.favorite_subject = favorite_subject
def introduce(self):
print(f"Hello, I'm {self.name}, and I am {self.age} years old.")
sally = Student("Sally", 10, "Science")
billy = Student("Billy", 8, "History")
Student.introduce(sally)
billy.introduce()
@terse needle :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | Hello, I'm Sally, and I am 10 years old.
002 | Hello, I'm Billy, and I am 8 years old.
RIght right
!e
class Person:
def __init__(self, name: str, age: int):
self.name = name
self.age = age
def say_hello(self):
print(f"Yo, I'm {self.name}")
class Student(Person):
def __init__(self, name: str, age: int, favorite_subject: str):
super().__init__(name, age)
self.favorite_subject = favorite_subject
def introduce(self):
print(f"Hello, I'm {self.name}, and I am {self.age} years old.")
sally = Student("Sally", 10, "Science")
billy = Person("Billy", 8)
sally.say_hello()
sally.introduce()
billy.say_hello()
billy.introduce()
@rugged root :x: Your 3.11 eval job has completed with return code 1.
001 | Yo, I'm Sally
002 | Hello, I'm Sally, and I am 10 years old.
003 | Yo, I'm Billy
004 | Traceback (most recent call last):
005 | File "/home/main.py", line 26, in <module>
006 | billy.introduce()
007 | ^^^^^^^^^^^^^^^
008 | AttributeError: 'Person' object has no attribute 'introduce'
You can think of a subclass as a specialisation of its parent class. A class represents a set of objects with similar attributes/behaviour. Subclass is like subset.
does super().init(name, age) -> means, take name and age from Person and use it on Student class?
!d collections.abc
New in version 3.3: Formerly, this module was part of the collections module.
Source code: Lib/_collections_abc.py
This module provides abstract base classes that can be used to test whether a class provides a particular interface; for example, whether it is hashable or whether it is a mapping.
An issubclass() or isinstance() test for an interface works in one of three ways.
- A newly written class can inherit directly from one of the abstract base classes. The class must supply the required abstract methods. The remaining mixin methods come from inheritance and can be overridden if desired. Other methods may be added as needed:
@rugged root do you think, you could copy paste this code here?
thanks
I am in voice, can hear, but cannot talk since I joined today
ok ok
class Person:
def __init__(self, name: str, age: int):
self.name = name
self.age = age
def say_hello(self):
print(f"Yo, I'm {self.name}")
class Student(Person):
def __init__(self, name: str, age: int, favorite_subject: str):
super().__init__(name, age)
self.favorite_subject = favorite_subject
def introduce(self):
print(f"Hello, I'm {self.name}, and I am {self.age} years old.")
def say_hello(self):
print("Hello, bro")
thanks!
btw, so we cannot send people who is seeking for help to go to ChatGPT and ask it, does it mean that at the moment ChatGPT is not a ideal choice of source to learn?
okay, I see
Yeah it tends to fail quite badly currently when it comes to tasks that require sequential reasoning. It also has a tendency to make stuff up that "looks right" if it doesn't know the answer to a question.
Try asking it to multiply together two random 6-digit numbers, and it will probably just make something up.
It's not bad as a learning tool however. For example, you could ask it to give you some quiz questions on a topic.
ok ok
I think GPT-4 is significantly better however.
oh nice, I think I should get it, but do you think switching from google to GPT will make some sense?
some people say that with GPT you may be faster
but on other hand it makes it easy to use rather than google
@whole bear Khan Academy have an algorithms course btw. You might find it useful: https://www.khanacademy.org/computing/computer-science/algorithms
Gtg 👋
!d fcntl
This module performs file control and I/O control on file descriptors. It is an interface to the fcntl() and ioctl() Unix routines. For a complete description of these calls, see fcntl(2) and ioctl(2) Unix manual pages.
Availability: not Emscripten, not WASI.
This module does not work or is not available on WebAssembly platforms wasm32-emscripten and wasm32-wasi. See WebAssembly platforms for more information.
All functions in this module take a file descriptor fd as their first argument. This can be an integer file descriptor, such as returned by sys.stdin.fileno(), or an io.IOBase object, such as sys.stdin itself, which provides a fileno() that returns a genuine file descriptor.
A new programming language, Mojo, builds on top of Python and is designed specifically for AI applications. They claim it’s up to 35000 times faster than Python. So let’s take a quick first look at it.
Website: https://www.modular.com/mojo
A new programming language, Mojo, builds on top of Python and is designed specifically for AI applications. They claim it’s up to 35000 times faster than Python. So let’s take a quick first look at it.
Keynote: https://youtu.be/-3Kf2ZZU-dg
Website: https://www.modular.com/mojo
Modular Discord: https://discord.gg/modular
requirements.txt: https...
@whole bear 👋
yoo
im bored
hop on to live-coding you can chit chat
@somber heath
my mics seems to not work anyways
I'm not that interested in live coding
@violet plaza 👋
@violet plaza
i def need help
before i throw myself out this window
i need to recreate this shit
with turtle
fuck turtle
easy way to cry
umm
offsets
obviously
"Solidify and demonstrate your understanding and application of using functions to break a problem into pieces."
i honestly wouldnt mind hopping on a call
yeah
no
maybe
i can obviously make a rectangle
import random
def drawrect(size):
for i in range(2):
turtle.forward(size)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
return
def drawrow(brick_count, offset):
for j in range(brick_count):
turtle.forward(brick_count)
turtle.forward(100)
turtle.right(90)
turtle.forward(50)
turtle.right(90)
def main():
drawrect(100)
drawrow(100)
main()``` my current code
honestly im still confused about returns
made a new function
of the big one?
so should i do turtle.penup and goto()
thats a bit annoying
im doing that first
to start at the top
import random
def big_square():
turtle.penup()
turtle.goto(1,300)
turtle.pendown()
turtle.right(0)
turtle.forward(350)
turtle.back(700)
big_square()```
okay good start
you know, i tried once but eventually gave up due to school. i am surely after my degree
ohhhh
okay
ill do that
import random
def big_square():
turtle.penup()
turtle.goto(350,1)
turtle.pendown()
turtle.right(90)
turtle.forward(300)
turtle.backward(600)
turtle.exitonclick()
big_square()```
hows this
1 3
2 4```
okay how would i start it at the left side
1 4
2 3```
@lunar haven speak, i wont my headphone to get its max limit voice
wowwww
goosebumps again
noo, i sware
turtle.goto
i dont care accent
i did it
i have an asian accent then lol
range(stop)
range(start, stop)
range(start, stop, step)```
!e py for i in range(50, 60): print(i)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 50
002 | 51
003 | 52
004 | 53
005 | 54
006 | 55
007 | 56
008 | 57
009 | 58
010 | 59
!e py for i in range(10): print(i)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 1
003 | 2
004 | 3
005 | 4
006 | 5
007 | 6
008 | 7
009 | 8
010 | 9
!e py for i in range(0, 20, 2): print(i)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 0
002 | 2
003 | 4
004 | 6
005 | 8
006 | 10
007 | 12
008 | 14
009 | 16
010 | 18
wt ya dng gofek
this one
hmm
@lunar haven :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 2
002 | 4
003 | 6
004 | 8
!e py for i in range(9, -1, -1): print(i)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 9
002 | 8
003 | 7
004 | 6
005 | 5
006 | 4
007 | 3
008 | 2
009 | 1
010 | 0
!e py for i in range(9, 0, -1): print(i)
turtle.penup()
turtle.goto(-350,1)
turtle.exitonclick()``` for this im trying to figure out how to make the pen go to a corner of the screen
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 9
002 | 8
003 | 7
004 | 6
005 | 5
006 | 4
007 | 3
008 | 2
009 | 1
i did it
i put 300 instead of 1
turtle.penup()
turtle.goto(-350,300)
turtle.exitonclick()```
this works right?
lol
i appreciate you not giving out the answers but hints
im very afraid lol
thats a whole new story
true, should i give this function a variable?
positioning
so line pos
needing division
import random
def big_square():
turtle.penup()
turtle.goto(-350,300)
turtle.pendown()
turtle.right(90)
turtle.forward(600)
turtle.penup()
turtle.goto(350, -300)
turtle.pendown()
turtle.right(180)
turtle.forward(600)
turtle.exitonclick()
big_square()```
i did that sequence you suggested
no for class
assignment
old ass games
def big_square():
turtle.penup()
turtle.goto(-350,300)
turtle.pendown()
turtle.right(90)
turtle.forward(600)
turtle.pendown()
turtle.goto(350, -300)
turtle.pendown()
turtle.right(180)
turtle.forward(600)
turtle.left(90)
turtle.forward(700)
turtle.exitonclick()
big_square()``` it works im not complaining
i would like to put these in a variable but im not sure how id go on about that
so i made a def vertlines(): what variables should i put into the parameters
you think id need any
!e ```py
def func(a):
print(f'You gave me {a}.')
func('"Hello, world."')```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
You gave me "Hello, world.".
!e ```py
def func(a, b, c):
print(a)
print(b)
print(c)
func(1, 2, 3)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | 1
002 | 2
003 | 3
turtle.penup()
turtle.backward(100)
turtle.pendown()
big_square()
vertlines()```
HELLO
!e ```py
def func(arg=None):
print(arg)
func()
func(123)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | None
002 | 123
-----------------------------------------------------
|[2 segments]|[2 segments]|[2 segments]|[2 segments]|
-----------------------------------------------------
[1 segment][2 segments]|[2 segments]|[1 segment]
-----------------------------------------------------
!e ```py
def func(a=0, b=1, c=2, d=3):
print(f'{a = }, {b = }, {c = }, {d = }')
func()
func(10)
func(10, 20)
func(10, 20, 30)
func(10, 20, 30, 40)```
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | a = 0, b = 1, c = 2, d = 3
002 | a = 10, b = 1, c = 2, d = 3
003 | a = 10, b = 20, c = 2, d = 3
004 | a = 10, b = 20, c = 30, d = 3
005 | a = 10, b = 20, c = 30, d = 40
okay
What this is showing is that you can have a function you can call with the arguments set to defaults so you don't need to specify them in the call.
But you can if you want to.
anyone play games here?
turtle.forward(width)
turtle.right(height)
turtle.forward(width)
def main():
big_square()
brick_size(height=50, width=100)```
I've got to go for dinner, now.
Can someone help me understand this code plz? 🫠
thanks
have a good time
what exactly is the 4th line doing? 🫠
Would you guys say "detrimental" is something absolute? Irreconcilable?
Or is the common understanding/connotations you're familiar with more temporary/reconcilable?
#dadjokes #dadjoke #jokes #joke #shorts #dadjokesdaily
just left
Hello
@fierce stratus 👋
I have a simple question
iqr = df.quantile(0.75) - df.quantile(0.25)
up_bound = df.quantile(0.75) + (iqr * 1.5)
low_bound = df.quantile(0.25) - (iqr * 1.5)
up_bound
low_bound
This filters creates the boundaries and determine which are the outliers, and I get this output
Only humidity, wind speed and pressure has severe outliers so if I want to drop my data according to the outlier condition only applied to these columns, how should I write my code?
Otherwise It's going to drop based on day as well so I don't want that
@willow lynx dont say bad about the current job or company
overall I think its better to be positive in interview
do think that answer like "I left company because they did not pay me enough" is good one?
oh ok, so you can say "I left company because the did not pay me enough" but in polite way
like paraphrase it so it sounds polite
YESSS
well dressed up, will benefit for sure
)))
!e py d = dict((v, i) for i, v in enumerate('abcdefghijklmnopqrstuvwxyz', 1)) print(d)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
{'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26}
what if i+1
d = dict((v, i+1) for i, v in enumerate('abcdefghijklmnopqrstuvwxyz'))
def func(arg):
return ord(arg) - 96```
!e py d = dict((chr(i), i - 96) for i in range(97, 123)) print(d)
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
{'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26}
s1 = input()
s2 = input()
def p_test(s1, s2):
s1_val = 0
s2_val = 0
for i in s1.lower():
s1_val += ord(i) - 96
for i in s2.lower():
s2_val += ord(i) - 96
if s1_val > s2_val:
return "1"
if s1_val < s2_val:
return "-1"
else:
return "0"
print(p_test(s1, s2))
aslkjlkasdd
asdlkjdajwi
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
True
helo guys
@graceful grail
oh Hello @rugged root
s1 = input()
s2 = input()
sl = sorted([s1.lower(), s2.lower()])
if sl[0] == s1.lower():
out = "-1"
if sl[0] == s2.lower():
out = "1"
if s1.lower() == s2.lower():
out = "0"
print(out)
s1 = input()
s2 = input()
sl = sorted([s1.lower(), s2.lower()])
def petyaStrings(s1, s2):
if sl[0] == sl[1]:
return 0
elif sl[0] == s1.lower():
return -1
elif sl[0] == s2.lower():
return 1
print(petyaStrings(s1, s2))
s1 = input()
s2 = input()
strlist = sorted([s1.lower(), s2.lower()])
def petyaStrings(s1, s2):
if strlist[0] == strlist[1]:
return 0
elif strlist[0] == s1.lower():
return -1
elif strlist[0] == s2.lower():
return 1
print(petyaStrings(s1, s2))
def test(a, b):
a, b = a.casefold(), b.casefold()
if a < b:
return -1
elif a > b:
return 1
return 0```
a = input().casefold()
b = input().casefold()
def test(a, b):
if a < b:
return -1
elif a > b:
return 1
return 0
print(test(a, b))
@fierce stratus Yo. Sorry, was driving. How's it going
oh no worries, pretty good
i know one wait a minute
i dont find it 🥲
@turbid sandal #❓|how-to-get-help
🥋🧎🐖👒
Fresh heavy dark DnB.
Download links below.
MP4/MKV Mix Video : https://archive.org/details/trip-addict-2023-dnb-mix
RAW MP3 : https://archive.org/details/trip-addict-2023-fresh-heavy-dark-dnb
EDIT:
@turbid sandal Feeling stupid is when learning to program is normal and happens to all of us, even down the track. Just keep reading documentation, doing research and when stuck, asking questions and taking breaks. If one problem gets you down, try attacking a different problem.
Knowledge is synergistic. Knowing about one thing can provide you with a greater understanding of another.
As so when you come back to the previous problem, you might have fresh new skills to solve it.
hello all! gays
m = input()
m = m.replace("+", "")
maths = sorted(m)
out = ""
for i in maths:
if len(out) > 0:
out += "+"
out += i
else:
out = i
print(out)
You rang?
no
!e
string_input = "3+2+1"
sorted_ = sorted(string_input.split("+")).join("+")
print(sorted_)
!e
string_input = "3+2+1"
sorted_ = "+".join(sorted(string_input.split("+")))
print(sorted_)
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
1+2+3
!e
string_input = "3+2+1"
print(sorted(string_input))
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
['+', '+', '1', '2', '3']
string_input = "3+2+1"
print('+'.join(sorted(string_input.split("+"))))
!e
string_input = "aAaaAA"
print(string_input[0].upper() + string_input[1:])
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
AAaaAA
is this correct?
word = input()
out = word.replace(word[0], word[0].upper())
print(out)
Yep!
!timeit
string_input = "aAaaAA"
print(string_input[0].upper() + string_input[1:])
@rugged root :white_check_mark: Your 3.11 timeit job has completed with return code 0.
500000 loops, best of 5: 690 nsec per loop
!timeit ```
word = "aAaaAA"
out = word.replace(word[0], word[0].upper())
print(out)```
@graceful grail :white_check_mark: Your 3.11 timeit job has completed with return code 0.
500000 loops, best of 5: 655 nsec per loop
a kitty cat whit a amour
!stream 189200135278952450
✅ @graceful grail can now stream until <t:1683902084:f>.
Time: 30 ms, memory: 0 KB
Verdict: WRONG_ANSWER
Input
xYaPxPxHxGePfGtQySlNrLxSjDtNnTaRaEpAhPaQpWnDzMqGgRgEwJxGiBdZnMtHxFbObCaGiCeZkUqIgBhHtNvAqAlHpMnQhNeQbMyZrCdElVwHtKrPpJjIaHuIlYwHaRkAkUpPlOhNlBtXwDsKzPyHrPiUwNlXtTaPuMwTqYtJySgFoXvLiHbQwMjSvXsQfKhVlOxGdQkWjBhEyQvBjPoFkThNeRhTuIzFjInJtEfPjOlOsJpJuLgLzFnZmKvFgFrNsOnVqFcNiMfCqTpKnVyLwNqFiTySpWeTdFnWuTwDkRjVxNyQvTrOoEiExYiFaIrLoFmJfZcDkHuWjYfCeEqCvEsZiWnJaEmFbMjDvYwEeJeGcKbVbChGsIzNlExHzHiTlHcSaKxLuZxX
Participant's output
XYaPXPXHXGePfGtQySlNrLXSjDtNnTaRaEpAhPaQpWnDzMqGgRgEwJXGiBdZnMtHXFbObCaGiCeZkUqIgBhHtNvAqAlHpMnQhNeQbMyZrCdElVwHtKrPpJjIaHuIlYwHaRkAkUpPlOhNlBtXwDsKzPyHrPiUwNlXtTaPuMwTqYtJySgFoXvLiHbQwMjSvXsQfKhVlOXGdQkWjBhEyQvBjPoFkThNeRhTuIzFjInJtEfPjOlOsJpJuLgLzFnZmKvFgFrNsOnVqFcNiMfCqTpKnVyLwNqFiTySpWeTdFnWuTwDkRjVXNyQvTrOoEiEXYiFaIrLoFmJfZcDkHuWjYfCeEqCvEsZiWnJaEmFbMjDvYwEeJeGcKbVbChGsIzNlEXHzHiTlHcSaKXLuZXX
Jury's answer
XYaPxPxHxGePfGtQySlNrLxSjDtNnTaRaEpAhPaQpWnDzMqGgRgEwJxGiBdZnMtHxFbObCaGiCeZkUqIgBhHtNvAqAlHpMnQhNeQbMyZrCdElVwHtKrPpJjIaHuIlYwHaRkAkUpPlOhNlBtXwDsKzPyHrPiUwNlXtTaPuMwTqYtJySgFoXvLiHbQwMjSvXsQfKhVlOxGdQkWjBhEyQvBjPoFkThNeRhTuIzFjInJtEfPjOlOsJpJuLgLzFnZmKvFgFrNsOnVqFcNiMfCqTpKnVyLwNqFiTySpWeTdFnWuTwDkRjVxNyQvTrOoEiExYiFaIrLoFmJfZcDkHuWjYfCeEqCvEsZiWnJaEmFbMjDvYwEeJeGcKbVbChGsIzNlExHzHiTlHcSaKxLuZxX
Checker comment
wrong answer 1st words differ - expected: 'XYaPxPxHxGePfGtQySlNrLxSjDtNnT...KbVbChGsIzNlExHzHiTlHcSaKxLuZxX', found: 'XYaPXPXHXGePfGtQySlNrLXSjDtNnT...KbVbChGsIzNlEXHzHiTlHcSaKXLuZXX'
!e
string_input = "aAaaAA"
print(string_input[0].upper() + string_input[1:])
@obsidian dragon :white_check_mark: Your 3.11 eval job has completed with return code 0.
AAaaAA
my cat
!d str.replace
str.replace(old, new[, count])```
Return a copy of the string with all occurrences of substring *old* replaced by *new*. If the optional argument *count* is given, only the first *count* occurrences are replaced.
out = word.replace(word[0], word[0].upper(), 1)
@obsidian dragon :x: Your 3.11 eval job has completed with return code 1.
001 | File "/home/main.py", line 1
002 | !e
003 | ^
004 | SyntaxError: invalid syntax
!e
string_input = "xYaPxPxHxGePfGtQySlNrLxSjDtNnTaRaEpAhPaQpWnDzMqGgRgEwJxGiBdZnMtHxFbObCaGiCeZkUqIgBhHtNvAqAlHpMnQhNeQbMyZrCdElVwHtKrPpJjIaHuIlYwHaRkAkUpPlOhNlBtXwDsKzPyHrPiUwNlXtTaPuMwTqYtJySgFoXvLiHbQwMjSvXsQfKhVlOxGdQkWjBhEyQvBjPoFkThNeRhTuIzFjInJtEfPjOlOsJpJuLgLzFnZmKvFgFrNsOnVqFcNiMfCqTpKnVyLwNqFiTySpWeTdFnWuTwDkRjVxNyQvTrOoEiExYiFaIrLoFmJfZcDkHuWjYfCeEqCvEsZiWnJaEmFbMjDvYwEeJeGcKbVbChGsIzNlExHzHiTlHcSaKxLuZxX"
print(string_input[0].upper() + string_input[1:])
@obsidian dragon :white_check_mark: Your 3.11 eval job has completed with return code 0.
XYaPxPxHxGePfGtQySlNrLxSjDtNnTaRaEpAhPaQpWnDzMqGgRgEwJxGiBdZnMtHxFbObCaGiCeZkUqIgBhHtNvAqAlHpMnQhNeQbMyZrCdElVwHtKrPpJjIaHuIlYwHaRkAkUpPlOhNlBtXwDsKzPyHrPiUwNlXtTaPuMwTqYtJySgFoXvLiHbQwMjSvXsQfKhVlOxGdQkWjBhEyQvBjPoFkThNeRhTuIzFjInJtEfPjOlOsJpJuLgLzFnZmKvFgFrNsOnVqFcNiMfCqTpKnVyLwNqFiTySpWeTdFnWuTwDkRjVxNyQvTrOoEiExYiFaIrLoFmJfZcDkHuWjYfCeEqCvEsZiWnJaEmFbMjDvYwEeJeGcKbVbChGsIzNlExHzHiTlHcSaKxLuZxX
@somber heath Hello
Opal says Hello
username = input()
if len(set(username)) % 2 == 0:
print("CHAT WITH HER!")
else:
print("IGNORE HIM!")
!stream 189200135278952450 30M
✅ @graceful grail can now stream until <t:1683904729:f>.
Stable Diffusion web UI. Contribute to AUTOMATIC1111/stable-diffusion-webui development by creating an account on GitHub.
@rugged root could i have stream access to show you my problem
Here in a moment
ok thanks
./webui.sh --medvram
is solution n-1?
Doesn't seem to be
i think it's sliding window problem
That's what I thought
Ohhhhhhhhhhhhhhhhhh
I think it just clicked
!stream 1053732836693258391
✅ @turbid sandal can now stream until <t:1683904350:f>.
Okay yeah, it is sliding window
Great!
Actually you may not need to use the sliding window
we can use stack may be
check stack[-1] element is equal to the ith element increase count by 1 else append
c=[0]
d=0
a="RRG"
for i in a:
if i == c[-1]:
d+=1
else:c.append(i)
print(d)``` Try this!
cutie patootie
!e
problem = "RGGBG"
total_removed = 0
skip_flag = False
for i in range(len(problem)-1):
if skip_flag:
skip_flag = False
continue
if (
(problem[i] == 'R' and problem[i+1] != 'G') or
(problem[i] == 'G' and problem[i+1] != 'B') or
(problem[i] == 'B' and problem[i+1] != 'R')
):
skip_flag = True
total_removed += 1
print(total_removed)
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
2
Thanks. Oh you mean the dog
Oh yeah that is way cleaner than mine
@midnight agate https://codeforces.com/problemset/problem/266/A
works out either way
@rugged root :white_check_mark: Your 3.11 eval job has completed with return code 0.
1
@noble solstice I think yours is missing the part where it is needing to be in the RGB pattern
okay what is the solution
need some more testcases
Those are all the test cases it has
The last one it has shows the needed pattern the best, I think
Sure sure
Input:
3
RRG
Output:
1
Input:
5
RRRRR
Output:
4
Input:
4
BRGB
Output:
0
Those are all the listed test cases. I haven't submitted mine either, not signed up
Very
@honest pier
but my code is working on listed test case
Yeah, I only grabbed the one that leet had on one of his failed test case
Which is the input I used
and expected output?
||```py
print(sum(len(list(v))-1 for k, v in import('itertools').groupby(input())))
!e
a="RGGBG"
print(sum(a[i] == a[i-1] for i in range(1, len(a))))
@kindred granite :white_check_mark: Your 3.11 eval job has completed with return code 0.
1
i think it is math question p&c
What does p&c mean
permutation and combination!
Except it is to remove stones, not to change where they are on the table
!timeit ```
length = 3
rgb = RRG
count = 0
rgblist = []
for i in rgb:
rgblist.append(i)
while length > 1:
if rgblist[(-length)] == rgblist[(-length + 1)]:
count += 1
length -= 1
So does this not work?
it looks like it does
!timeit ```
length = 3
rgb = "RRG"
count = 0
rgblist = []
for i in rgb:
rgblist.append(i)
while length > 1:
if rgblist[(-length)] == rgblist[(-length + 1)]:
count += 1
length -= 1
print(count)
Wait a second...
@graceful grail :white_check_mark: Your 3.11 timeit job has completed with return code 0.
200000 loops, best of 5: 1.17 usec per loop
Should use pairwise
z=0
for i in list
if list[i] == list[i+1]
z+=1
!e
from itertools import pairwise
s="RGGBG"
print(sum(a == b for a, b in pairwise(s)))
@kindred granite :white_check_mark: Your 3.11 eval job has completed with return code 0.
1
Nope, mine fucked up
@ivory horizon please use push to talk
equivalent to what I'm gonna write:
!e
s="RGGBG"
count = 0
i = 1
while i < len(s):
count += s[i] == s[i-1]
i += 1
print(count)
previous question was ```python
length = int(input())
rgb = input()
count = 0
while length > 1:
if rgb[(-length)] == rgb[(-length + 1)]:
count += 1
length -= 1
print(count)
me when I didn't change i
@kindred granite :white_check_mark: Your 3.11 eval job has completed with return code 0.
1
Lol This solution is the proof of Extraterrestrial life
Nope!
I iz teh dumb
no
!e
a,b =4, 9 ans = 0 while a <= b: ans += 1 a *= 3 b *= 2 print(ans)
@ivory horizon :white_check_mark: Your 3.11 eval job has completed with return code 0.
3
!stream 189200135278952450 30M
✅ @graceful grail can now stream until <t:1683908709:f>.
||```py
A, B = map(int, input().split())
print(len(list(
itertools.takewhile(a <= b for a, b in map(lambda i: (A3**i, B2**i), range(10)))
)))
|
| print("Test") |
||```py
k, n, w = map(int, input().split())
c = k * (w * (w + 1)) // 2
print(max(c - n, 0))
hello
How's it going
cost - k + 2k + 3k + .... + ik
simplify k (1 + 2 + 3+ 4+ ... i)
k (n * (n + 1) // 2)
Math!
we can alsp use
for i in range(1,bananas+1):
total_money=total_money-i*price
print(abs(total_money))```
and use if else for condition
time complexity is o(n) for this
and i think it has o(1) complexity?
?
time complexity of both?
o(n) for the one which you shared and 0(1) for the above
yeah i am also thinking!
You can share next question!
here!
Check out the #voice-verification channel
That'll tell you what you need to know about the voice gate
O(k) - OK
bro anyone share me the question link?
18
ans - 4
I forgot I can drag myself
print(a//6+1)```
2 pipes
||`a = int(input())
ans = 0
for d in [5, 4, 3, 2, 1]:
temp = a // d
ans += temp
a -= d * temp
if a <= 0:
break
print(ans)`||
try this!
||```py
t = divmod(int(input()), 5)
print(t[0] + bool(t[1]))
Hugo Weaving, in case anyone was unaware.
No he's not
Not in that clip anyway
Param(
$Path
)
If (-Not $Path -eq '') {
New-Item $Path
Write-Host "File created at path $Path"
} Else {
Write-Error "Path cannot be empty"
}
share the question here!
doesn't work, try a=11
!stream 367647874571436032 1M
✅ @ivory horizon can now stream until <t:1683909658:f>.
can u give me some more testcases
any time with n % 6 == 5 i think, except n=5
py.CheckiO - Python practice online. Improve your coding skills by solving coding challenges and exercises online with your friends in a fun way. Exchanges experience with other users online through fun coding activities.
word = input()
uppers = 0
downers = 0
# regular comment
for i in word: # stupid inline comment
if i.isupper():
uppers += 1
else:
downers += 1
if uppers > downers:
out = word.upper()
else:
out = word.lower()
print(out)
s="HoUSe"
a = sorted(s)
#print(a)
for i in range(len(a)):
if a[i].islower():
u = len(a[:i])
l = len(a[i:])
#print(u)
#print(l)
if u>l:
print(s.upper())
break
else:print(s.lower())
break
```
why sort
i guess that's an approach
idk may be!
!paste
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.
@rugged root powershell Get-ChildItem -Recurse | where {$_.Extension -contains @("qba","qbw")} | select name,lastmodified | export-csv -path "blah.csv"
Get-ChildItem -Recurse | where {$_.Extension -in @(".csv",".txt")} | select name,lastmodified```
LastAccessTimeUtc Property datetime LastAccessTimeUtc {get;set;}
LastWriteTime Property datetime LastWriteTime {get;set;}
LastWriteTimeUtc Property datetime LastWriteTimeUtc {get;set;}```
Get-Item sp500.csv | gm
sort
Could someone plz explain what the 4th line is doing? 🫠
live there = post box
It’s called string concatenation
Tldr you can combine strings in python using the + operator
Fourth.
um .. what is int(i,2)
!d int
class int(x=0)``````py
class int(x, base=10)```
Return an integer object constructed from a number or string *x*, or return `0` if no arguments are given. If *x* defines `__int__()`, `int(x)` returns `x.__int__()`. If *x* defines `__index__()`, it returns `x.__index__()`. If *x* defines `__trunc__()`, it returns `x.__trunc__()`. For floating point numbers, this truncates towards zero.
If *x* is not a number or if *base* is given, then *x* must be a string, [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "bytes"), or [`bytearray`](https://docs.python.org/3/library/stdtypes.html#bytearray "bytearray") instance representing an integer in radix *base*. Optionally, the string can be preceded by `+` or `-` (with no space in between), have leading zeros, be surrounded by whitespace, and have single underscores interspersed between digits.
^^
Oh
Btw you don’t need to call str
Python will do that for you iirc
The second argument is the base that int should treat the thing you give int as.
Thank you!
!e py print(int('100101', 2))
@somber heath :white_check_mark: Your 3.11 eval job has completed with return code 0.
37
Ah I can’t count
@rugged root will you be having mint julips and sitting on the back porch this weekend
Got it
ls -lR | grep -E '\.txt$|\.csv$' | awk '{ print $9"," $8 }' > file.csv
@rugged root does this do what you want something like this.
Get-ChildItem -Recurse | where {$_.Extension -in @(".csv",".txt")} | select name,lastmodified
why not use a GUI to invoke BASH scripts or is that majorly obsolete idea
i though i just heard .. the ghost of Dame Edna
It does only convert to int
but how it does that is what you can change with the base
@graceful grail https://deliverance.forcookies.dev/#/
Exo: A user interface for the SpaceTraders API
pun = mind virus
Alright! Thank you! Never knew this actually
People sometimes mistakenly conclude that if 20% of factors should get priority, then the other 80% can be ignored.
bye bye gn
gonna give 20% to sleep
Back in a jiffy
affirmative
Have you seen that really realistic new game? That would make me motion sick in about 10 seconds.
Unrecord I think
Unrecorded is a thrilling new mobile RPG that will take you on an epic journey through a fantastical world filled with danger and adventure. With stunning graphics, intuitive controls, and an immersive storyline, this game is sure to keep you hooked for hours on end.
In Unrecorded, you play as a hero tasked with saving the world from an evil for...
Moore's Law
Gonna go eat 👋
Hello xD @somber heath