You are given a string,
Write a script to find out the first unique character in the given string and print its index (0-based).
This is relatively straight forward task. Loop through the index from 0 to 2 less than the length of string. If that character occurs later in the string, print the index.
$ ./ch-1.py "The Weekly Challenge" 0 $ ./ch-1.py "Long Live Python" 3
You are given list of numbers,
@n and an integer
Write a script to trim the given list where element is less than or equal to the given integer.
This is also straight forward. I start by
poping the last value from the list. I then use the for if function (grep for Perl) to get items in the list that are greater than that number.
$ ./ch-2.py 1 4 2 3 5 3 4, 5 $ ./ch-2.py 9 0 6 2 3 8 5 4 9, 6, 8, 5