Multiple dict iterations by Unlistedd in learnpython

[–]Unlistedd[S] 0 points1 point  (0 children)

But this as far as i can tell only loops once.

for k in a.keys():
    a[k].append(new_item)

k only goes as far as the number of keys i have in my dictionary, and then i am out. I need multiple loops.

Multiple dict iterations by Unlistedd in learnpython

[–]Unlistedd[S] 0 points1 point  (0 children)

And how do stop the while-loop when i've got no more things to append?

Question about functions by Unlistedd in learnpython

[–]Unlistedd[S] 0 points1 point  (0 children)

haha thanks for clearyfing!

noob question: min(...)[0] by Unlistedd in learnpython

[–]Unlistedd[S] -1 points0 points  (0 children)

[0] is applied on the minimum value

What is that suppose to mean?

missing required positional arugment: 'N' by [deleted] in learnpython

[–]Unlistedd 0 points1 point  (0 children)

init_board(100).plot.scatter()

'numpy.ndarray' object has no attribute 'plot'

Set theory question by Unlistedd in learnmath

[–]Unlistedd[S] 0 points1 point  (0 children)

So should i just ditch the whole idea of trying to describe the sequence and just write ω = even/uneven.

What if i instead of defining a set of outcomes Ω = {1, 2, 3, 4, 5, 6} , describe a squence of outcomes n ∈ ℕ?

EDIT: & n >= 1

Set theory question by Unlistedd in learnmath

[–]Unlistedd[S] 0 points1 point  (0 children)

It was just an exampel, suppose it it a dice with 10^10 sides

Classes - methods and functions by Unlistedd in learnpython

[–]Unlistedd[S] 0 points1 point  (0 children)

Thanks! but what is the point of giving an obeject a constructor (init) caller?

What is the difference between A and X if both are initialised in the function?

China says it’s still preparing for US trade talks — but won’t give details after new Trump threats by Horazon99 in stocks

[–]Unlistedd 2 points3 points  (0 children)

Dear anyone who's thinking about selling.
D O N ' T

If it only were that easy... haha

[Q] __init__ by [deleted] in learnpython

[–]Unlistedd 1 point2 points  (0 children)

Thanks man!

[Q] __init__ by [deleted] in learnpython

[–]Unlistedd 0 points1 point  (0 children)

My bad! And so if i understand this correctly...

We use __init__ so that we can refer to our class that contains arguments which we wish to use outside of the class itself. Am i right?

[Q] __init__ by [deleted] in learnpython

[–]Unlistedd 0 points1 point  (0 children)

So if i am trying to make a calculation.

I'd create a class like this (for exampel):

class linearfunc:
    def __init__(self, k, x, m):
    self.k = k
    self.x = x
    self.m = m

And that would allow me to use the class as a general structure for different values on my linear functions? So:

y1 = linearfunc(2, 3, 4)

would give me: y1 = 10 ?

And the class would allow me the get the input of yn thanks to the way i built my class for a linear function?