<jupyter_start><jupyter_text>Q11 to Q15 11. Write a python program to find the factorial of a number.<jupyter_code>def fact(n):
    return n*1 if(n<=1) else n*fact(n-1) 
fact(6)<jupyter_output><empty_output><jupyter_text>12. Write a python program to find whether a number is prime or composite.<jupyter_code>def check_prime(n):
    if(n<2):return "neither prime number nor composite number."
    elif(n==2):return "only even prime number"
    else:
        for i in range(2,n):
            if(n%i==0):
                ret="composite number"
                break
            else: ret="prime number"
        return ret
for i in range(0,30+1):
    print(i,":",check_prime(i))<jupyter_output>0 : neither prime number nor composite number.
1 : neither prime number nor composite number.
2 : only even prime number
3 : prime number
4 : composite number
5 : prime number
6 : composite number
7 : prime number
8 : composite number
9 : composite number
10 : composite number
11 : prime number
12 : composite number
13 : prime number
14 : composite number
15 : composite number
16 : composite number
17 : prime number
18 : composite number
19 : prime number
20 : composite number
21 : composite number
22 : composite number
23 : prime number
24 : composite number
25 : composite number
26 : composite number
27 : composite number
28 : composite number
29 : prime number
30 : composite number<jupyter_text>13. Write a python program to check whether a given string is palindrome or not.<jupyter_code>def palindrome(st):
    size=len(st)
    if size<2:return "size is too small"
    for i in range(1,size+1):
        if st[i-1]==st[size-i]:ret="given string is palindrome"    
        else:return "given string is not palindrome"
    return ret
vals= [ 'a','SoloS','RotatoR','saurabh','SagaS','elephant','TenT','RepapeR','CiviC','KayaK','Lever','MadaM','python']
for i in vals:print(i,":",palindrome(i))<jupyter_output>a : size is too small
SoloS : given string is palindrome
RotatoR : given string is palindrome
saurabh : given string is not palindrome
SagaS : given string is palindrome
elephant : given string is not palindrome
TenT : given string is not palindrome
RepapeR : given string is palindrome
CiviC : given string is palindrome
KayaK : given string is palindrome
Lever : given string is not palindrome
MadaM : given string is palindrome
python : given string is not palindrome<jupyter_text>14. Write a Python program to get the third side of right-angled triangle from two given sides.<jupyter_code>import math
def hypo(s1,s2):
    return math.sqrt((s1)**2+(s2)**2)
hypo(3,4)
import math
def hyp(s1=0,s2=0,hyp=0):
    print("Kindly enter zero to find that side")
    s1=int(input("Enter a first side: "))
    s2=int(input("Enter a second side: "))
    hyp=int(input("Enter a hypo side: "))
    if(s1==0):return math.sqrt((hyp)**2-(s2)**2)
    elif(s2==0):return math.sqrt((hyp)**2-(s1)**2)
    else:return math.sqrt((s1)**2+(s2)**2)
hyp()<jupyter_output>Kindly enter zero to find that side
Enter a first side: 3
Enter a second side: 0
Enter a hypo side: 5<jupyter_text>15. Write a python program to print the frequency of each of the characters present in a given string<jupyter_code>def count_String(st):
    count={}
    for i in st:
        if i in count:count[i]=count[i]+1
        else:count[i]=1
    return count        
count_String('<NAME>')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10848359444280224, 'fraction_numerical': 0.034289092521430684, 'mean_word_length': 4.1664122137404584, 'pattern_counts': {'":': 2, '<': 22, '<?xml version=': 0, '>': 19, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '174388', 'license': 'Apache-2.0', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1106, 'n_words': 388, 'path': 'Worksheet_set_1/Python worksheet 1.ipynb', 'repo_name': 'psaurabh57/Internship', 'size': '3406'}