QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: jaco on July 3, 2013, 03:37

Title: transmission[-1]
Post by: jaco on July 3, 2013, 03:37
dear Professor:
    i saw a script in the web and how is the mean of [-1]:
    #read the transmission spectrum
transmission = nlread('dtb_analysis.nc',TransmissionSpectrum)[-1]
    Thanks in advance!
     best regards
jaco
Title: Re: transmission[-1]
Post by: Anders Blom on July 21, 2013, 23:39
In Python, you can access the last item in a list by using the -1 notation. Example:

Code: python
x=[1,2,3]
print x[-1]

will print 3.