Hw1: Write Python script that reads a numbers and finds and prints a list of its divisors

Hw2: Define a function overlapping() that takes two lists and returns True if they have at least one member in common, False otherwise. You may use your is_member() function, or the in operator, but for the sake of the exercise, you should (also) write it using two nested for-loops.

Hw3: Define a function generate_n_chars() that takes an integer n and a character c and returns a string, n characters long, consisting only of c:s. For example, generate_n_chars(5,"x") should return the string "xxxxx". (Python is unusual in that you can actually write an expression 5 * "x" that will evaluate to "xxxxx". For the sake of the exercise you should ignore that the problem can be solved in this manner.)

Ex1: Write a Python function to sum all the numbers in a list.

def sum(numbers):  
    total = 0  
    for x in numbers:  
        total += x  
    return total
    
print(sum((8, 2, 3, 0, 7)))

Ex2: Write a Python program to reverse a string.

def string_reverse(str1):  
  
    rstr1 = ''  
    index = len(str1)  
    while index > 0:  
        rstr1 += str1[ index - 1 ]  
        index = index - 1  
    return rstr1
    
print(string_reverse('1234abcd')) 

Ex3: Write a Python function that accepts a string and calculate the number of upper case letters and lower case letters.

def string_test(s):
    d={"UPPER_CASE":0, "LOWER_CASE":0}
    for c in s:
        if c.isupper():
           d["UPPER_CASE"]+=1
        elif c.islower():
           d["LOWER_CASE"]+=1
        else:
           pass
    print ("Original String : ", s)
    print ("No. of Upper case characters : ", d["UPPER_CASE"])
    print ("No. of Lower case Characters : ", d["LOWER_CASE"])

string_test('The quick Brow Fox')

Ex4: Write a Python function that checks whether a passed string is palindrome or not.
Note: A palindrome is word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run.

def isPalindrome(string):
	left_pos = 0
	right_pos = len(string) - 1
	
	while right_pos >= left_pos:
		if not string[left_pos] == string[right_pos]:
			return False
		left_pos += 1
		right_pos -= 1
	return True
    
print(isPalindrome('aza'))