Loading...
More Python Posts
# Python code to demonstrate# method to remove i'th character# Naive Method# Initializing Stringtest_str = "CodeCatch"# Printing original stringprint ("The original string is : " + test_str)# Removing char at pos 3# using loopnew_str = ""for i in range(len(test_str)):if i != 2:new_str = new_str + test_str[i]# Printing string after removalprint ("The string after removal of i'th character : " + new_str)
import pandas as pdx = pd.read_excel(FILE_NAME)print(x)
bytes_data = b'Hello, World!'string_data = bytes_data.decode('utf-8')print("String:", string_data)
print("test")
def key_of_min(d):return min(d, key = d.get)key_of_min({'a':4, 'b':0, 'c':13}) # b
def max_n(lst, n = 1):return sorted(lst, reverse = True)[:n]max_n([1, 2, 3]) # [3]max_n([1, 2, 3], 2) # [3, 2]