Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Alias for different parts of a variable
Post: RE: Alias for different parts of a variable

Thanks for the response Buran ! I'm not particular about date, I just gave an example. From your first example, can I have separate names for spam[0], spam[1], spam[2] ? For example, spam = [1, 2, 3]...
mln4python General Coding Help 3 2,271 Aug-28-2019, 02:09 PM
    Thread: Alias for different parts of a variable
Post: Alias for different parts of a variable

Can I create alias variables for parts of another variable ? For example, I have variables as below. full_date = '20190827' yyyy = full_date[0:4] ### Want this as mutable mm = full_date[4:6] ### Want...
mln4python General Coding Help 3 2,271 Aug-27-2019, 06:36 AM
    Thread: Reset a variable
Post: RE: Reset a variable

(Aug-19-2019, 07:44 AM)buran Wrote: value = -999 ... # some other code a = b + c ... # some other calculations value = a + (x * y) ... # some other calculations value = -999 # this set value = -999 ...
mln4python General Coding Help 4 8,436 Aug-19-2019, 08:28 AM
    Thread: Reset a variable
Post: RE: Reset a variable

(Aug-19-2019, 07:34 AM)buran Wrote: what about just value = -999? That is assuming your variable is value Hi buran, Thanks for the reply. Little more details on what I want to do... value = -999 ....
mln4python General Coding Help 4 8,436 Aug-19-2019, 07:41 AM
    Thread: Reset a variable
Post: Reset a variable

Hi all, Is there any way to reset a variable value without using classes ? For example, I initialize a variable to -999 and then do some calculations. In the middle of the program, I want to reset i...
mln4python General Coding Help 4 8,436 Aug-19-2019, 07:27 AM
    Thread: Restrict / Limit variable size
Post: RE: Restrict / Limit variable size

(Aug-12-2019, 11:40 AM)ThomasL Wrote: class Limited: def __init__(self, value=None): self._value = value @property def limited(self): return self._value @limit...
mln4python General Coding Help 4 7,200 Aug-13-2019, 07:17 AM
    Thread: Restrict / Limit variable size
Post: Restrict / Limit variable size

Can I restrict / limit a variable size in python ? For example, I want to use an int variable which can hold ONLY upto 6 digit values, i.e., -999999 thru 999999. If I assign some value outside this r...
mln4python General Coding Help 4 7,200 Aug-12-2019, 10:04 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020