#!/usr/bin/env python # coding: utf-8 # In[ ]: # Function to process "double" followed by a number def process_doubles(sentence): tokens = sentence.split() result = [] i = 0 while i < len(tokens): if tokens[i] == "डबल": if i + 1 < len(tokens): result.append(tokens[i + 1]) result.append(tokens[i + 1]) i += 2 else: result.append(tokens[i]) i += 1 else: result.append(tokens[i]) i += 1 return ' '.join(result)