<jupyter_start><jupyter_text>Day_17. More Exceptions ![image](https://user-images.githubusercontent.com/50367487/62466746-09aca980-b7cd-11e9-9efa-6c814337533c.png)<jupyter_code>class Calculator():
    def power(self, n, p):
        if n < 0 or p < 0:
            return 'n and p should be non-negative'    
        return f'{n ** p}'
    
    
calc = Calculator()


for _ in range(int(input())):
    n, p = map(int, input().split())
    
    try:
        ans = calc.power(n, p)
        print(ans)
    
    except Exception as e:
        print(e)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1408695652173913, 'fraction_numerical': 0.06956521739130435, 'mean_word_length': 2.5555555555555554, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '143372', 'license': 'MIT', 'n_tokens_mistral': 243, 'n_tokens_neox': 215, 'n_words': 44, 'path': 'Learn to code in 30 days/Day_17. More Exceptions.ipynb', 'repo_name': 'Nam-SH/HackerRank', 'size': '575'}