-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
57 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# purpose : Program to check mouse position on the move | ||
# author : rakesh kumar | ||
# licence : MIT | ||
import pyautogui | ||
print("Press CTRL+C to stop") | ||
try: | ||
while True: | ||
x,y = pyautogui.position() | ||
positionStr = "X :"+str(x).rjust(4) +" Y :"+ str(y).rjust(4) | ||
print(positionStr, end='') | ||
print('\b' * len(positionStr), end='', flush=True) | ||
except KeyboardInterrupt: | ||
print("\n Done") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
#program to define lambda function in python | ||
# program to define lambda function in python | ||
|
||
f = lambda x : x**2 | ||
|
||
#lambda function with map() function | ||
l1=[1,2,4,5,6,7,78,7,4,34,4,14,44,4,4] | ||
result = map(f,l1) | ||
print(result) | ||
def f(x): return x**2 | ||
|
||
|
||
# lambda function with map() function | ||
l1 = [1, 2, 4, 5, 6, 7, 78, 7, 4, 34, 4, 14, 44, 4, 4] | ||
result = list(map(f, l1)) | ||
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# python program to demonstrate the use of kwargs arguments in pyhon | ||
# made by : rakesh kumar | ||
|
||
|
||
def sum_kwargs(**kwargs): | ||
for x, y in kwargs.items(): | ||
print('{} and its valiue {}'.format(x, y)) | ||
|
||
|
||
if __name__ == "__main__": | ||
sum_kwargs(name='rakesh', school='DAV', salary=50000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
def check_prime(n): | ||
flag = True | ||
for x in range(2, n//2): | ||
if n % x == 0: | ||
flag = False | ||
|
||
return flag | ||
|
||
if __name__ == "__main__": | ||
n = int(input('Enter any integer number : ')) | ||
result = check_prime(n) | ||
print("Prime Number " if (result) else '"Not prime Number') | ||
# program to define lambda function in python | ||
|
||
|
||
def f(x): return x**2 | ||
|
||
|
||
# lambda function with map() function | ||
l1 = [1, 2, 4, 5, 6, 7, 78, 7, 4, 34, 4, 14, 44, 4, 4] | ||
result = map(f, l1) | ||
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# function to demonstrate the workin of args and kwards paramater | ||
# made by : rakesh kumar | ||
|
||
|
||
def sum_values(*args): | ||
sum = 0 | ||
for x in args: | ||
sum += x | ||
return sum | ||
|
||
|
||
if __name__ == "__main__": | ||
res = sum_values(1, 2, 3, 4, 5, 6, 7, 8, 9) | ||
print('Sum of values :', res) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,3 @@ | |
a = np.array([(1, 2, 3), (4, 5, 6), (7, 8, 9)]) | ||
b = np.sum(a, 1) | ||
print(b) | ||
|
||
`` |