s = "kitti"
0,1,2,3,4
k,i,t,t,i
how do i retrieve '4'. i know i can do a len(s)-1, but i assume there is a
function that gives me last number of index
thanks
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday, May 23, 2018 at 5:56:26 PM UTC-4, Rob Gaddi wrote:
> On 05/23/2018 02:51 PM, asa32s...@gmail.com wrote:
> > s = "kitti"
> >
> > 0,1,2,3,4
> > k,i,t,t,i
> >
> > how do i retrieve '4'. i know i can do a len(s)-1, but i assume there is a
> > function that gives me last number of index
On Wednesday, May 23, 2018 at 5:51:42 PM UTC-4, asa3...@gmail.com wrote:
> s = "kitti"
>
> 0,1,2,3,4
> k,i,t,t,i
>
> how do i retrieve '4'. i know i can do a len(s)-1, but i assume there is a
> function that gives me last number of index
>
> thanks
thanks, it seems just a len(s) -1 is the righ
i want to check/return for 3 conditions, it loops shortest str and finds diff
in other
1. if difference is immediate before end of range, return index, exit
2. if string length is same and index loop is done, return 'identical'
3. if neither of above is found. it means the short loop ended and eve
On Wednesday, May 23, 2018 at 8:55:59 PM UTC-4, MRAB wrote:
> On 2018-05-24 00:57, asa32s...@gmail.com wrote:
> > i want to check/return for 3 conditions, it loops shortest str and finds
> > diff in other
> > 1. if difference is immediate before end of range, return index, exit
> > 2. if string le
hi just seeing if there is a cleaner way to write this.
s1= "kitti"
s2= 'kitti'
i= 3
print(s1+ "\n" + "="*i + "^" + "\n" +s2)
>
kitti
===^
kitti
--
https://mail.python.org/mailman/listinfo/python-list
here is the code, i keep getting an error, "break outside loop". if it is false
just exit function
def d(idx):
if type(idx) != int:
break
d('k')
--
https://mail.python.org/mailman/listinfo/python-list
On Thursday, May 24, 2018 at 8:51:07 PM UTC-4, asa3...@gmail.com wrote:
> hi just seeing if there is a cleaner way to write this.
>
> s1= "kitti"
> s2= 'kitti'
> i= 3
> print(s1+ "\n" + "="*i + "^" + "\n" +s2)
>
> >
> kitti
> ===^
> kitti
more legible that way... thks
--
https://mail.python.
On Thursday, May 24, 2018 at 10:12:46 PM UTC-4, asa3...@gmail.com wrote:
> here is the code, i keep getting an error, "break outside loop". if it is
> false just exit function
>
>
> def d(idx):
> if type(idx) != int:
> break
>
> d('k')
thanks... I believe the compiler. So how do I