<jupyter_start><jupyter_text>**1.** Write a Python program to find words which are greater than given length k? **Answer:**<jupyter_code>animal_list = ['cat', 'elephant', 'ostrich', 'tiger', 'ducknose', 'dog']
k = 5

greater_k = [i for i in animal_list if len(i) > k]
print(greater_k)

# or

text = "I like to get up early and go for a walk."
k = 3

word_list = text.split(' ')
greater_k = [i.replace('.', '') for i in word_list if len(i) > k]
greater_k<jupyter_output>['elephant', 'ostrich', 'ducknose']<jupyter_text>**2.** Write a Python program for removing i-th character from a string? **Answer:**<jupyter_code>text = "I like to get up early and go for a walk."
k = 8

new_text = list(text)
new_text.pop(8)
new_text = ''.join(new_text)
new_text<jupyter_output><empty_output><jupyter_text>**3.** Write a Python program to split and join a string? **Answer:**<jupyter_code>text = "I like to get up early and go for a walk."

' '.join(text.split(' '))<jupyter_output><empty_output><jupyter_text>**4.** Write a Python to check if a given string is binary string or not? **Answer:**<jupyter_code>text = '010101bin'

set_text = set(text)
if set_text == {'0', '1'} or set_text == {'0'} or set_text == {'1'}:
    print('The string is binary.')
else:
    print('The string is not binary.')<jupyter_output>The string is not binary.<jupyter_text>**5.** Write a Python program to find uncommon words from two Strings? **Answer:**<jupyter_code>text1 = "I like to get up early and go for a walk."
text2 = "I like to get up and to visit a zoo."

list_text1 = text1.replace('.', '').split(' ')
list_text2 = text2.replace('.', '').split(' ')
uncommon_words = [i for i in list_text1 if i not in list_text2]
uncommon_words.extend([i for i in list_text2 if i not in list_text1])
uncommon_words<jupyter_output><empty_output><jupyter_text>**6.** Write a Python to find all duplicate characters in string? **Answer:**<jupyter_code>text = "I like to get up early and go for a walk."

list_text = list(text)

from collections import Counter

char_dict = dict(Counter(list_text))
[i for i in char_dict if char_dict[i] > 1]<jupyter_output><empty_output><jupyter_text>**7.** Write a Python Program to check if a string contains any special character? **Answer:**<jupyter_code>text = 'Hello, how are you doing?'

char_check = '?'

list_text = list(text)

if char_check in list_text:
    print(f"The string contains {char_check}.")
else:
    print(f"The string does not contain {char_check}.")<jupyter_output>The string contains ?.
{'fraction_non_alphanumeric': 0.14365522745411013, 'fraction_numerical': 0.012769353551476457, 'mean_word_length': 5.236318407960199, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '348730', 'license': 'MIT', 'n_tokens_mistral': 907, 'n_tokens_neox': 880, 'n_words': 299, 'path': 'Python Programming Basic Assignment - Assignment11.ipynb', 'repo_name': 'VaheC/Python_assigments', 'size': '2506'}