Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
15 views

Python

The document discusses code developed in Python including matrix multiplication, twin primes, permutation and combination formulas, determining if a number is Armstrong, product of digits, and other number-related codes. It also mentions working with SQL.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Python

The document discusses code developed in Python including matrix multiplication, twin primes, permutation and combination formulas, determining if a number is Armstrong, product of digits, and other number-related codes. It also mentions working with SQL.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Programming in Python

• Developed a code on matrix multiplication without using external libraries.


• Developed a code to find twin primes.
• Developed a code for permutation and combination formula using recursive
function.
• Code to determine a number is Armstrong or not.
• Code for product of individual digits of a given number.
• Code for Multiplicative digital root (MDR) and MPersistence.
• Code to find if a number is perfect.
• Code to find pair of amicable numbers.
• Code to create a list cube of even numbers using map and filter function.

SQL
• Worked on

# Prime Factors of a number


import numpy as np

def primen(m):
if m>2 and m%2==0
return False
d=True
for i in range(2,(m/2)+1):
if m%i==0:
d=False
break
return d

lst=[]

def primef(x):
"""
This gives prime factors of a number
"""
if not primen(x):
for k in range(2,x):
if primen(k) and x%k==0:
print(k)
lst.append(k)
c=x/k
#primef(int(c))
if primen(x):
print(str(x))
lst.append(x)
#if primen(k)==True and x/k==1:
#print(x)
#break

You might also like