There are 6 test cases and 5 are getting passed based on python 3 on a string operations problem, but 1 test case is failing since inception. Pls help me out. The question is as follows: 8 Strings are given in a function.
- Remove spaces from both end of strings: first, second, parent, city
- Capitalize : first, second, parent
- Print Strings with a space : first, second, parent, city
- Check if string : 'phone' only contains digits
- Check if phone number starts with value in string 'start' and print the result(True or False)
- Print : total no. of times 'strfind' appears in the strings : first, second, parent, city
- Print : list generated by using split function on 'string1'
- Find position of 'strfind' in 'city'
My Code is as follows: Let me know what wrong I have done. 5/6 test cases are passed only 1 test case failed for unknown reason. :(
def resume(first, second, parent, city, phone, start, strfind, string1):
first = first.strip()
second = second.strip()
parent = parent.strip()
city = city.strip()
first = first.capitalize()
second = second.capitalize()
parent = parent.capitalize()
print(first + " " + second + " " + parent + " " +city)
print(phone.isdigit())
print(phone[0]==start[0])
res = first + second + parent + city
res_count = res.count(strfind)
print(res_count)
print(string1.split())
print(city.find(strfind))