<jupyter_start><jupyter_text>Prime NumberLogic:1<jupyter_code>count=0
n=int(input("Enter a number:"))
for i in range(1,n+1):
    if n%i==0:
       count+=1
if count==2:
   print(n,"is a prime number")
else:
     print(n,"is not a prime number")<jupyter_output>Enter a number:56
56 is not a prime number<jupyter_text>logic:2<jupyter_code>x=2
ch=0
n=int(input("Enter a number"))
if n<1:
   ch=1
while x<=n/2:
      if n%x==0:
         ch=1
         break
      else:
           x+=1
if ch==0:
   print(n,"is a prime number")
else:
     print(n,"is not a prime number")<jupyter_output>Enter a number11
11 is a prime number<jupyter_text>LARGEST AMONG n DIGIT<jupyter_code>arr=[]
num=int(input("Enter n number:"))
for n in range(num):
    numbers=int(input("Enter a number:"))
    arr.append(numbers)
print("max element in list is:",max(arr))
print("min element in list is:",min(arr))<jupyter_output>Enter n number:5
Enter a number:5
Enter a number:2
Enter a number:6
Enter a number:4
Enter a number:2
max element in list is: 6
min element in list is: 2<jupyter_text>SWAP TWO NUMBERSLogic:1<jupyter_code>x=int(input("Enter value:"))
y=int(input("Enter value:"))
temp=x
x=y
y=temp
print("X=",x,"Y=",y)<jupyter_output>Enter value:5
Enter value:10
X= 10 Y= 5<jupyter_text>logic-2:<jupyter_code>x=int(input("Enter value:"))
y=int(input("Enter value:"))
x,y=y,x
print("X=",x,"Y=",y)<jupyter_output>Enter value:5
Enter value:2
X= 2 Y= 5<jupyter_text>SWAPPING TWO NUMBERS WITHOUT USING THIRD VARIABLE<jupyter_code>x=int(input("Enter value:"))
y=int(input("Enter value:"))
x=x+y
y=x-y
x=x-y
print("X=",x,"Y=",y)<jupyter_output>Enter value:7
Enter value:9
X= 9 Y= 7<jupyter_text>FIBONACCI SERIES<jupyter_code>a=0;
b=1;
n=int(input("Enter how many numbers to be generated:"))
print("FIBONACCI SERIES:");
print(" ",a," ",b,end="");
for i in range(n):
    c=a+b;
    a=b;
    b=c;
    print(" ",c,end="")<jupyter_output>Enter how many numbers to be generated:4
FIBONACCI SERIES:
  0   1  1  2  3  5<jupyter_text>FIBONACCI SERIES USING RECURSION<jupyter_code>def recur_fibo(n):
    if n<=1:
       return n
    else:
         return(recur_fibo(n-1)+recur_fibo(n-2))
nterms=int(input("enter a value:"))
if nterms <=0:
   print("enter a positive integer")
else:
     print("Fibonacci Sequence:")
     for i in range(nterms):
         print(recur_fibo(i))<jupyter_output>enter a value:5
Fibonacci Sequence:
0
1
1
2
3<jupyter_text>PALLINDROMELogic-1:<jupyter_code>str=input("enter a string to check:")
str=str.casefold()
if(str==str[::-1]):
   print(str,"is a pallindrome")
else:
     print(str,"is not a pallindrome")<jupyter_output>enter a string to check:mom
mom is a pallindrome<jupyter_text>Logic-2:<jupyter_code>s1=input("enter a string to check:")
s2=""
for i in s1:
     s2=s2+i
if(s1==s2):
   print(s1,"is a pallindrome")
else:
     print(s1,"is not pallindrome")<jupyter_output>enter a string to check:radar
radar is a pallindrome<jupyter_text>PALLINDROME NUMBER<jupyter_code>n=int(input("enter a number:"))
temp=n
rev=0
while(n>0):
      d=n%10
      rev=rev*10 + d
      n=n//10
if(temp==rev):
   print( "pallindrome number")
else:
     print("not pallindrome number")<jupyter_output>enter a number:101
pallindrome number<jupyter_text>PALLINDROME NUMBER USING RECURSIVE FUNCTION<jupyter_code>def rev(n,temp):
    if(n==0):
       return temp;
    temp=(temp*10) + (n%10);
    return rev(n/10,temp);
n=int(input("enter a number:"))
temp=rev(n,0);
if(temp != n):
   print("pallindrome")
else:
     print("not pallindrome")<jupyter_output>enter a number:525
pallindrome<jupyter_text>PASCAL TRIANGLE<jupyter_code>def fact(n):
    f=1
    i=1
    while(i<=n):
         f=f*i
         i+=1
    return f
nLines=int(input("enter no. of lines:"))
for x in range(nLines):
    for y in range(x+1):
        print(fact(x)//(fact(y)*fact(x-y)),"",end="")
    print()<jupyter_output>enter no. of lines:4
1 
1 1 
1 2 1 
1 3 3 1<jupyter_text>LEAP YEAR<jupyter_code>year=int(input("enter a year:"))
if(year%4==0 and year !=100 or year%400==0):
   print(year,"is a leap year")
else:
     print(year,"not a leap year")<jupyter_output>enter a year:2019
2019 not a leap year<jupyter_text>PERFECT NUMBER<jupyter_code>i=1
sum=0
n=int(input("enter a number:"))
while(i<n):
      if(n%i==0):
         sum=sum+i
      i+=1
if sum==n:
    print(i,"is a perfect number")
else:
     print(i,"is not a perfect number")<jupyter_output>enter a number:6
6 is a perfect number<jupyter_text>STRONG NUMBER<jupyter_code>num=int(input("enter a number:"))
n=num
sum=0
while(num):
      i=1
      p=1
      r=num%10
      while(i<=r):
            p=p*i
            i+=1
      sum=sum+p
      num=num//10
if(sum==n):
   print(n,"is a strong number")
else:
     print(n,"is not a strong number")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15863369656328583, 'fraction_numerical': 0.03101424979044426, 'mean_word_length': 4.575934579439252, 'pattern_counts': {'":': 0, '<': 57, '<?xml version=': 0, '>': 51, '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': '16', 'dir': 'jupyter-structured-clean-dedup', 'id': '564869', 'license': 'Apache-2.0', 'n_tokens_mistral': 2091, 'n_tokens_neox': 2010, 'n_words': 450, 'path': '25_03(basic).ipynb', 'repo_name': 'Naina-Kshatri/Python_Programs', 'size': '4772'}