Apr-21-2020, 07:10 PM
does anyone knows ?
help is much appreciated...
help is much appreciated...
what does x reprsent in this code ?
|
Apr-21-2020, 07:10 PM
does anyone knows ?
help is much appreciated...
Apr-21-2020, 08:11 PM
That depends on the specifics of your system, not on python itself.
But in general, you don't want to uninstall packages that you didn't install yourself. There might be hidden dependencies that just assume that some ancient version of python is there and runnable. Better to just put the version on that you want, and make sure it's in your PATH so you run it. You can ignore the other packages on the system. Other than a bit of disk space, I see no benefit to removing the system-installed packages.
Apr-22-2020, 01:23 PM
okay,
if i write - pip3 --version it shows me the following: so it shows that the pip3 version for python3.5 is 8.1.1while if i check - pip --version it shows: so what i wanna have is the latest pip version, on python3.5any advice ?
Apr-27-2020, 07:29 AM
(This post was last modified: Apr-27-2020, 07:30 AM by astral_travel.)
another quiz,
in the following code: class MyNumbers: def __iter__(self): self.a = 1 return self def __next__(self): if self.a <= 20: x = self.a self.a += 1 return x else: raise StopIteration myclass = MyNumbers() myiter = iter(myclass) for x in myiter: print(x)i see that in line 14 - myclass = Mynumbers() - as i understand it - myclass is a new variable ? which is assigned the value of the class MyNumbers ?but then how is it that the class is being wrote with () - (that's a function feature, isn't it ?)
Apr-27-2020, 07:56 AM
myclass is a variable which is assigned the value of an object of type MyNumbers(). mclass is a bad variable name. You are correct that () causes MyNumbers() to do something. This time it causes python to create a new object of type MyNumbers. If MyNumbers had an __init__ method/function that would get executed at this time.
This is a new question. You should have started a new thread.
Apr-27-2020, 08:26 AM
(This post was last modified: Apr-27-2020, 08:27 AM by astral_travel.)
thank you !
should i start a new thread for every question ? this seems to be a very similar question, i think, like - a nuance
Apr-27-2020, 08:38 AM
If it is really similar to a previous question, then no. However you started out with "what does x do in this code?"
thisset = {"apple", "banana", "cherry"} for x in thisset: print(x)When you find yourself typing "another quiz" that is an indication it is time for another thread.
Apr-27-2020, 08:52 AM
(This post was last modified: Apr-27-2020, 08:53 AM by astral_travel.)
hehe...okay !
|
|