diff --git a/GCD.py b/GCD.py new file mode 100644 index 00000000..f7893e12 --- /dev/null +++ b/GCD.py @@ -0,0 +1,10 @@ +def gcd(p,q): + gcd =1 + if p%q==0: + return q + for z in range(int(q/2), 0,-1): + if (p%z==0) and (q%z==0): + gcd = z + break + +print(gcd(4,3)) \ No newline at end of file diff --git a/LCM.py b/LCM.py new file mode 100644 index 00000000..5ab88d1a --- /dev/null +++ b/LCM.py @@ -0,0 +1,13 @@ +def lcm(x,y): + if x>y: + z=x + else: + z=y + while True: + if(z%x==0)and(z%y==0): + lcm=z + break + z+=1 + return lcm + +print(lcm(4,3)) \ No newline at end of file diff --git a/Qr_code_generator.py b/Qr_code_generator.py new file mode 100644 index 00000000..51602ad4 --- /dev/null +++ b/Qr_code_generator.py @@ -0,0 +1,27 @@ +# install all the libaries needed +# create a function that collects a text and converts it to a Qr code +# save the qrcode as a image +# run the function + +import qrcode + +def generate_qrcode(text): + + qr = qrcode.QRCode( + version = 1, + error_correction = qrcode.constants.ERROR_CORRECT_L, + box_size = 10, + border = 4, + ) + + qr.add_data(text) + qr.make(fit=True) + img = qr.make_image(fill_color="Black", back_color="White") + img.save("giri01.png") + + + +generate_qrcode("Hey guys im Sharan, this is my github account : https://github.com/sharan37600 ") + + + \ No newline at end of file