From a1d4d72cd028396985edfde3f4e29f5eb00aee47 Mon Sep 17 00:00:00 2001 From: sagarbabalsure Date: Thu, 17 Oct 2019 00:59:10 +0530 Subject: [PATCH 1/5] some operation using numpy package --- Modules/numpy_en.py | 50 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Modules/numpy_en.py diff --git a/Modules/numpy_en.py b/Modules/numpy_en.py new file mode 100644 index 0000000..8bde5f9 --- /dev/null +++ b/Modules/numpy_en.py @@ -0,0 +1,50 @@ +#example 3 +#added by @sagarbabalsure +#This example show the some operations using numpy package. + + +import numpy as np + +#basics + +a=np.array([[1,2,3], + [4,5,6]]) +print(type(a)) +print(np.ndim(a)) +print(np.size(a)) +print(a.dtype) +print(a.shape) +#array creation +a=np.array((2,4,6)) +print(a) +b=np.zeros((3,4),dtype='int') +print(b) +c=np.ones((2,2)) +print(c) +d=np.full((3,3),4) +print(d) +e=np.arange(0,30,5) +print(e) +f=np.random.random((2,2)) +print(f) +g=np.linspace(0,10,5,dtype='int') +print(g) + +#array indexing +x=np.array([[1,2,3],[2,3,4],[1,4,7]]) +t=x[:2,:2] +print(t) +t=x[[0,0]] +print(t) +t=x[[1,2],[1,0]] +print(t) + +#operations +print(x+2) +print(x*3) +print(x) +print("transpose: ",x.T) +print("multiplication",a.dot(x)) +print(x.max()) +print(x.sum()) +print(np.sort(x)) From 7f2bc357cdb9e0b539afa0727ada8ca647d9adc4 Mon Sep 17 00:00:00 2001 From: sagarbabalsure Date: Thu, 17 Oct 2019 01:03:24 +0530 Subject: [PATCH 2/5] pyqrcode package to generate qrcode --- Modules/qr_en.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Modules/qr_en.py diff --git a/Modules/qr_en.py b/Modules/qr_en.py new file mode 100644 index 0000000..740c64c --- /dev/null +++ b/Modules/qr_en.py @@ -0,0 +1,13 @@ +#example 1 +#added by @sagarbabalsure +#This example create the "QR CODE" for entered string and make the file 'myqr.svg' in your present folder. +#By scanning this qrcode you can go to that url + + + + +import pyqrcode +from pyqrcode import QRCode +s=raw_input("Enter any url to make qr code: ") +url=pyqrcode.create(s) +url.svg("myqr.svg",scale=8) \ No newline at end of file From 50e5154d37ed2e7ee8aceef71c8e04fc2f2c3074 Mon Sep 17 00:00:00 2001 From: sagarbabalsure Date: Thu, 17 Oct 2019 01:04:54 +0530 Subject: [PATCH 3/5] guess game using random module --- Modules/random_number_en.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Modules/random_number_en.py diff --git a/Modules/random_number_en.py b/Modules/random_number_en.py new file mode 100644 index 0000000..58d7019 --- /dev/null +++ b/Modules/random_number_en.py @@ -0,0 +1,21 @@ +#example 2 +#added by @sagarbabalsure +#This example is like guess game.Where user try to guess the randomly generated number in three trials. + + +import string +import random +from random import randint +x = randint(1, 100) +print(x) +count=3 +while count>0: + y=int(input("Enter your guess: ")) + count=count-1 + if x==y: + print("Oh..your guess is correct") + else: + print("you have %d guesses remaining" %(count)) + if count==0: + print("sorry you lose") + From 33ba4290b6452ffcab6283c4b3040837c1bbf6b5 Mon Sep 17 00:00:00 2001 From: Ammar Annowairah Date: Thu, 17 Oct 2019 14:26:29 +0300 Subject: [PATCH 4/5] Update qr_en.py adding new line at the end . --- Modules/qr_en.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/qr_en.py b/Modules/qr_en.py index 740c64c..57b1f85 100644 --- a/Modules/qr_en.py +++ b/Modules/qr_en.py @@ -10,4 +10,4 @@ from pyqrcode import QRCode s=raw_input("Enter any url to make qr code: ") url=pyqrcode.create(s) -url.svg("myqr.svg",scale=8) \ No newline at end of file +url.svg("myqr.svg",scale=8) From b2424c1e0ea964307c4506ccd743cfb4e25d63de Mon Sep 17 00:00:00 2001 From: AYUSH BHARDWAJ <47911217+ayush1963@users.noreply.github.com> Date: Wed, 4 Nov 2020 08:57:49 +0530 Subject: [PATCH 5/5] Update README.md (#61) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f8d05ac..53a9dad 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Students from 22 arab countries add their python examples and tutorials to make ## Getting Started -The project is divided into categories , each category contains subcategories and examples for it in three different languages (English , Arabic and French). +The project is divided into various categories and each category contains subcategories and examples for it in three different languages (English , Arabic and French).