From 52ec43fbc165633156ce172c475b489fd371239b Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Sat, 14 Mar 2020 18:04:06 -0700 Subject: [PATCH 01/53] Python practice programs --- HelloWorld.py | 7 +------ findsqrt.py | 8 ++++++++ sumOfTwoNumbers.py | 18 ++++++++++++++++++ test.py | 1 - 4 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 findsqrt.py create mode 100644 sumOfTwoNumbers.py delete mode 100644 test.py diff --git a/HelloWorld.py b/HelloWorld.py index b0f51fd..8e23576 100644 --- a/HelloWorld.py +++ b/HelloWorld.py @@ -1,6 +1 @@ -def test: - return naveen - -if __name__=="__main__": - test - +print("Hello World") \ No newline at end of file diff --git a/findsqrt.py b/findsqrt.py new file mode 100644 index 0000000..4e28348 --- /dev/null +++ b/findsqrt.py @@ -0,0 +1,8 @@ +# Python Program to calculate the square root + +num = 8 + +sqrtOfNum = 8 ** 0.5 +print("Sqrt of %0.2f is %0.3f"%(num,sqrtOfNum)) + +# output Sqrt of 8.00 is 2.828 \ No newline at end of file diff --git a/sumOfTwoNumbers.py b/sumOfTwoNumbers.py new file mode 100644 index 0000000..948dbc6 --- /dev/null +++ b/sumOfTwoNumbers.py @@ -0,0 +1,18 @@ +# first process static addition of two numbers + +num1 = 12.2 +num2 = 17.8 + +sum = float(num1) + float(num2) + +print('the sum of {0} and {1} is {2}'.format(num1,num2,sum)) + +# Taking numbers form the user + +num3 = input("Enter a number") +num4 = input("Enter a number") + +sum2 = float(num3) + float(num4) + +print("the sum of {0} and {1} is {2}".format(num3,num4,sum2)) + diff --git a/test.py b/test.py deleted file mode 100644 index e23d386..0000000 --- a/test.py +++ /dev/null @@ -1 +0,0 @@ -print("Naveen") \ No newline at end of file From 1acb02ecec6b5f914ee7fa8ec30c37ba0cef23c7 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Sat, 14 Mar 2020 19:12:28 -0700 Subject: [PATCH 02/53] python program practices --- EvenOddNumber.py | 9 +++++++++ largestOfThreeNumbers.py | 16 ++++++++++++++++ positiveNegativeNumber.py | 12 ++++++++++++ swapVariables.py | 12 ++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 EvenOddNumber.py create mode 100644 largestOfThreeNumbers.py create mode 100644 positiveNegativeNumber.py create mode 100644 swapVariables.py diff --git a/EvenOddNumber.py b/EvenOddNumber.py new file mode 100644 index 0000000..1ac8af4 --- /dev/null +++ b/EvenOddNumber.py @@ -0,0 +1,9 @@ +# FInd the even number of odd number + +num = int(input("enter a number ")) + +if num % 2 == 0: + print( " the {0} is Even number".format(num)) +else: + print("the {0} is Odd number".format(num)) + diff --git a/largestOfThreeNumbers.py b/largestOfThreeNumbers.py new file mode 100644 index 0000000..ec16a31 --- /dev/null +++ b/largestOfThreeNumbers.py @@ -0,0 +1,16 @@ +# find the largest of three numbers + +num1 = float(input("Enter a number")) +num2 = float(input("Enter a number")) +num3 = float(input("Enter a number")) + +if num1 > num2 and num1 > num3: + largerNumber = num1 + +elif num2 > num3 and num2 > num1: + largerNumber = num2 + +else: + largerNumber = num3 + +print("THe largest number is ",largerNumber) diff --git a/positiveNegativeNumber.py b/positiveNegativeNumber.py new file mode 100644 index 0000000..d47cf64 --- /dev/null +++ b/positiveNegativeNumber.py @@ -0,0 +1,12 @@ +# FInd the positive and negative number + +num = float(input("Enter a number")) + +if num > 0: + print("number {0} is Positive number".format(num)) + +elif num == 0: + print("the number {0} is Zero".format(num)) + +else: + print("The number {0} is negative number".format(num)) \ No newline at end of file diff --git a/swapVariables.py b/swapVariables.py new file mode 100644 index 0000000..1239e9b --- /dev/null +++ b/swapVariables.py @@ -0,0 +1,12 @@ +# Python program to swap two variables + +val1 = int(input("Enter a number")) +val2 = int(input("Enter a number")) + +temp = val1 +val1 = val2 +val2 = temp + +print("The values of val1 after swapping: {0}".format(val1)) +print("The vale of val2 after swapping: {0}".format(val2)) + From 026be7a50f5997d4f21d97e31d35e2d6a44c13de Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Sat, 14 Mar 2020 19:21:58 -0700 Subject: [PATCH 03/53] python practice --- primeNumber.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 primeNumber.py diff --git a/primeNumber.py b/primeNumber.py new file mode 100644 index 0000000..20b8ce6 --- /dev/null +++ b/primeNumber.py @@ -0,0 +1,15 @@ +#FInd the number prime number + +num = int(input("Enter number")) + +if num > 1: + for i in range(2,num): + if num % i == 0: + print(" number is not prime") + break + else: + print("The number is prime number") + +else: + print("Num is not prime number") + From 1d9d36ff28345d7d59467d95b9f7a241604586dd Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Sun, 15 Mar 2020 22:59:54 -0700 Subject: [PATCH 04/53] Python learning programs --- ArrayPrograms/SumOfArray.py | 13 +++++++++++++ ArrayPrograms/largetsNumer.py | 16 ++++++++++++++++ FactorialNum.py | 10 ++++++++++ 3 files changed, 39 insertions(+) create mode 100644 ArrayPrograms/SumOfArray.py create mode 100644 ArrayPrograms/largetsNumer.py create mode 100644 FactorialNum.py diff --git a/ArrayPrograms/SumOfArray.py b/ArrayPrograms/SumOfArray.py new file mode 100644 index 0000000..ce5689b --- /dev/null +++ b/ArrayPrograms/SumOfArray.py @@ -0,0 +1,13 @@ +#Python 3 program to find the sum of array + + +def _sumofArray(arr): + return(sum(arr)) + +arr = [1,2,3,4] + +n = len(arr) + +ans = _sumofArray(arr) + +print("sum of the array is ",ans) \ No newline at end of file diff --git a/ArrayPrograms/largetsNumer.py b/ArrayPrograms/largetsNumer.py new file mode 100644 index 0000000..7901f4b --- /dev/null +++ b/ArrayPrograms/largetsNumer.py @@ -0,0 +1,16 @@ +#Find the largest number from the array + +def largest(arr,n): + + max = arr[0] + + for i in range(1,n): + if arr[i] > max: + max = arr[i] + return max + + +arr = [1,5,2,3,4] +n = len(arr) +ans = largest(arr,n) +print(ans) \ No newline at end of file diff --git a/FactorialNum.py b/FactorialNum.py new file mode 100644 index 0000000..8f262fc --- /dev/null +++ b/FactorialNum.py @@ -0,0 +1,10 @@ +# Find the factorial of numbers + +num = int(input("Enter number")) + +def factorial(n): + return 1 if (n ==0 or n ==1) else n * factorial(n - 1) + + +fact = factorial(num) +print("the factorial of {0} is {1} ".format(num,fact)) \ No newline at end of file From 93edd19790fe6974ee34c25e11e3696c4118937e Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Sun, 15 Mar 2020 23:11:54 -0700 Subject: [PATCH 05/53] python practice programs --- ArrayPrograms/smallestNumber.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ArrayPrograms/smallestNumber.py diff --git a/ArrayPrograms/smallestNumber.py b/ArrayPrograms/smallestNumber.py new file mode 100644 index 0000000..5455f8f --- /dev/null +++ b/ArrayPrograms/smallestNumber.py @@ -0,0 +1,15 @@ +#Find the smallest number in an array + +def smallestNum(arr,n): + + small = arr[0] + for i in range(1, n): + if arr[i] < small: + small = arr[i] + return small + +arr = [1,3,4,2,54,-3] +n = len(arr) +ans = smallestNum(arr,n) + +print("smallest number of array {0} is {1}".format(arr,ans)) \ No newline at end of file From 7584cf9ca89eca35ed66755d0e4cc573c2c1fee2 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Sun, 15 Mar 2020 23:23:04 -0700 Subject: [PATCH 06/53] python learning program --- ListPrograms/SwappingFirstLastElementsinList.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ListPrograms/SwappingFirstLastElementsinList.py diff --git a/ListPrograms/SwappingFirstLastElementsinList.py b/ListPrograms/SwappingFirstLastElementsinList.py new file mode 100644 index 0000000..4df3d98 --- /dev/null +++ b/ListPrograms/SwappingFirstLastElementsinList.py @@ -0,0 +1,14 @@ +#Swap the elements in the list first and last + +def SwapFirstLastElement(arr): + + temp = arr[0] + arr[0] = arr[-1] + arr[-1] = temp + + return arr + +arr = [1,2,3,4,5] +ans = SwapFirstLastElement(arr) + +print("after swapping from the list",ans) \ No newline at end of file From 3bb6851fb3c260d76c2f5f487ae0993d880ff651 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Mon, 16 Mar 2020 22:08:11 -0700 Subject: [PATCH 07/53] Python list practice --- ListPrograms/LengthOflist.py | 16 ++++++++++++++++ ListPrograms/stringOccuranceRemove.py | 27 +++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 ListPrograms/LengthOflist.py create mode 100644 ListPrograms/stringOccuranceRemove.py diff --git a/ListPrograms/LengthOflist.py b/ListPrograms/LengthOflist.py new file mode 100644 index 0000000..64f0d05 --- /dev/null +++ b/ListPrograms/LengthOflist.py @@ -0,0 +1,16 @@ +# python the list length + +def lengthOfList(lis): + + count = 0 + for i in lis: + count = count +1 + + return print(count) + +list = ['a','b','c','d','e'] +lengthOfList(list) + +count2 = print(len(list)) + +#for performence wise len() is better than \ No newline at end of file diff --git a/ListPrograms/stringOccuranceRemove.py b/ListPrograms/stringOccuranceRemove.py new file mode 100644 index 0000000..c97d6c7 --- /dev/null +++ b/ListPrograms/stringOccuranceRemove.py @@ -0,0 +1,27 @@ +#Remove nth occurance of the given word + +def removenthOccurance(lis,n,word): + newList = [] + count = 0 + + for i in lis: + if i == word: + count = count + 1 + if count != n: + newList.append(i) + else: + newList.append(i) + + lis = newList + + if count == 0: + print("Item not found") + else: + print("Updated list",lis) + + return newList + +list = ['geeks','for','geeks'] +n = 2 +word = 'geeks' +removenthOccurance(list,n,word) \ No newline at end of file From 6c8cba0f4959216578115b696b21c4fac17784a3 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Mon, 16 Mar 2020 22:33:03 -0700 Subject: [PATCH 08/53] python list programs --- ListPrograms/CheckIfElementExist.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 ListPrograms/CheckIfElementExist.py diff --git a/ListPrograms/CheckIfElementExist.py b/ListPrograms/CheckIfElementExist.py new file mode 100644 index 0000000..2486b0c --- /dev/null +++ b/ListPrograms/CheckIfElementExist.py @@ -0,0 +1,14 @@ +# find the element in a list +def elementInList(lis,n): + for i in lis: + if i == n: + print("Element exists in list") + + +list = [1,2,4,5,6,7] +n = 2 +elementInList(list,n) + +# Second way +if n in list: + print("Element exists") \ No newline at end of file From 617d06488c6d1d04b7eee2b9964929d2da240b78 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Wed, 25 Mar 2020 19:24:49 -0700 Subject: [PATCH 09/53] python operator example --- Operator/inOperator.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Operator/inOperator.py diff --git a/Operator/inOperator.py b/Operator/inOperator.py new file mode 100644 index 0000000..47dcc44 --- /dev/null +++ b/Operator/inOperator.py @@ -0,0 +1,18 @@ +#Operator examples +#identity operators +#is and is not(which shows the identity of operators) +n = 123 +b = 123 +v = 122 +print( n is b) # gives true because n and b values same so address also same +print(n is v) # false +print(n is not v) + +#membership operators +#in and not in +s = "Hello World" +print("Hello" in s) +print("naveen" not in s) +lis = [1,2,3] +print(1 in lis) + From a9092d4580b45de8a251db7d16944fe41ddea46d Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Wed, 25 Mar 2020 19:39:14 -0700 Subject: [PATCH 10/53] libraries usage examples --- module.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 module.py diff --git a/module.py b/module.py new file mode 100644 index 0000000..a50add6 --- /dev/null +++ b/module.py @@ -0,0 +1,37 @@ +#library example + +import math +print(math.sqrt(9)) + +# same as above code(aliasing) + +import math as m +print(m.sqrt(9)) + +#same as above + +from math import sqrt +from math import pi + +print(sqrt(9)) + +# also works + +from math import * # not advised to use +print(sqrt(9)) + + +# sqrt() +# ceil() +# floor() +# pow(x,y) +# factorial() +# gcd() +# sin() +# cos() +# ...... + +# pi = 3.12 +# e = 2.71 +# inf = infinity +#nan = not a number From a6e1f0004aba69d78bd076581ba53e69a98e7443 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Wed, 25 Mar 2020 19:39:27 -0700 Subject: [PATCH 11/53] input output stmt --- inputoutstmt.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 inputoutstmt.py diff --git a/inputoutstmt.py b/inputoutstmt.py new file mode 100644 index 0000000..ee29469 --- /dev/null +++ b/inputoutstmt.py @@ -0,0 +1,8 @@ +# input and output statements + +# read dynamic data from the keyboard + +x = int(input("enter a number")) +y = int(input("enter the second number")) +print("the sum is ",x+y) + From 73156cbcff92de7e1e711800e9f121849696cd59 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Thu, 26 Mar 2020 16:47:50 -0700 Subject: [PATCH 12/53] Test message --- test2.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 test2.py diff --git a/test2.py b/test2.py new file mode 100644 index 0000000..db1a2b7 --- /dev/null +++ b/test2.py @@ -0,0 +1 @@ +print("Hello world from pycharm") \ No newline at end of file From ed8b315746c35c2edbc81e7191327662fab8a65a Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Thu, 26 Mar 2020 17:12:24 -0700 Subject: [PATCH 13/53] input multiple values --- inputMul.py | 4 ++++ inputMultiplevalues.py | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 inputMul.py create mode 100644 inputMultiplevalues.py diff --git a/inputMul.py b/inputMul.py new file mode 100644 index 0000000..9c93232 --- /dev/null +++ b/inputMul.py @@ -0,0 +1,4 @@ +#read multiple values from keyboard + +a,b=[int(x) for x in input("enter two numbers:").split()] +print("the sum of {} and {} is ".format(a,b),a+b) \ No newline at end of file diff --git a/inputMultiplevalues.py b/inputMultiplevalues.py new file mode 100644 index 0000000..b1b34b7 --- /dev/null +++ b/inputMultiplevalues.py @@ -0,0 +1,4 @@ +#read two float valiues from the keyboard which are specified with , separation and print sum + +x,y = [float(x) for x in input("enter 2 values:").split(",")] +print("the mul of {} and {} is".format(x,y),x*y) \ No newline at end of file From 2b6563cf2d2d7608851f0c8ee6fe9af7d8eb5f27 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Thu, 26 Mar 2020 17:12:52 -0700 Subject: [PATCH 14/53] evaluate example --- evalexample.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 evalexample.py diff --git a/evalexample.py b/evalexample.py new file mode 100644 index 0000000..1b4699f --- /dev/null +++ b/evalexample.py @@ -0,0 +1,8 @@ +# Evaluate the values type automatically + +ex = input("ENter an expression") +print(type(eval(ex))) + +# ex = 12 +# class int + From 77f6748b01019f31c1a4f80251f3864d9cf78463 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Thu, 26 Mar 2020 17:25:55 -0700 Subject: [PATCH 15/53] Eval example --- evalexample.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/evalexample.py b/evalexample.py index 1b4699f..d7c3043 100644 --- a/evalexample.py +++ b/evalexample.py @@ -6,3 +6,5 @@ # ex = 12 # class int +x = eval(input("enter a number")) +print(x) \ No newline at end of file From 4b1453747518a2ad3c8208fd41ad4a111b5e17d1 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Thu, 26 Mar 2020 17:26:16 -0700 Subject: [PATCH 16/53] command line argument examples --- commandLineArgExample.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 commandLineArgExample.py diff --git a/commandLineArgExample.py b/commandLineArgExample.py new file mode 100644 index 0000000..13ebd3a --- /dev/null +++ b/commandLineArgExample.py @@ -0,0 +1,13 @@ +# command line argument examples +# predefined variable--argv +# argv-- will be list type + +from sys import argv +print(type(argv)) +print(argv) +print(argv[1:]) +print(argv[0]) +print(argv[1]) + + + From 5a532b0527358817120a0762c223a80357ce4639 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Thu, 26 Mar 2020 17:53:26 -0700 Subject: [PATCH 17/53] Command line argument examples --- commandLineArgExample2.py | 7 +++++++ commandLineArgExampleSum.py | 9 +++++++++ 2 files changed, 16 insertions(+) create mode 100644 commandLineArgExample2.py create mode 100644 commandLineArgExampleSum.py diff --git a/commandLineArgExample2.py b/commandLineArgExample2.py new file mode 100644 index 0000000..b1d0a32 --- /dev/null +++ b/commandLineArgExample2.py @@ -0,0 +1,7 @@ +from sys import argv +print("The number of values in argv:",len(argv)) +print("the list of command line arguments",argv) +print("command line arguments one by one") +for x in argv: + print(x) +print("slice operator example",argv[1:3]) diff --git a/commandLineArgExampleSum.py b/commandLineArgExampleSum.py new file mode 100644 index 0000000..ceb8e5d --- /dev/null +++ b/commandLineArgExampleSum.py @@ -0,0 +1,9 @@ +# read group of command line arguments and sum of these values +from sys import argv +args = argv[1:] +sum = 0 +for x in args: + n = int(x) + sum += n + +print("The sum of argv is:",sum) \ No newline at end of file From 9159221aee20ddb3f624b2a109ae8d21b8788d44 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Thu, 26 Mar 2020 17:53:40 -0700 Subject: [PATCH 18/53] Input examples summary --- InputExample.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 InputExample.py diff --git a/InputExample.py b/InputExample.py new file mode 100644 index 0000000..a5c340b --- /dev/null +++ b/InputExample.py @@ -0,0 +1,14 @@ +#Input part +# 1) input +# 2) typecast to required type int(),float(),bool() +# 3) eval() + + +# commandline argumnets +# argv and sys module + +from sys import argv +print(int(argv[1])+int(argv[2])) + + + From d960cf1339d98e70cdb21cf8bbac79c9c587f331 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Fri, 27 Mar 2020 17:20:04 -0700 Subject: [PATCH 19/53] Python output example with different formats --- outputExample.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 outputExample.py diff --git a/outputExample.py b/outputExample.py new file mode 100644 index 0000000..e379bc8 --- /dev/null +++ b/outputExample.py @@ -0,0 +1,41 @@ +# Output values +# using sep operator(sep ===> space by deafult) +a,b,c = 10,20,30 +print(a,b,c,sep=" < ", end=" ") +print(40,50,60,sep="-") + +# using end operator (instead of printing in the next line we can use end) +# (end ===> default new line) +print("Hello World",end=" ") +print("python") + +# print(object) + +l = [10,20,30,40] +t = (10,20,30,40) +s = {10,20,30,40} +print(l,t,s) + +#print (formatted string) +# %i == int type +# %d == int type +# %f == float type +# %s == Str type +# print("formatted string",%(variable list)) + +m,n,o = 10,20,30 +print("m value is %i" %m) +print("n value %i and o value is %d" %(n,o)) + +# print() function with replacement operator +# {} ==> replacement operator + +name = "Naveen" +salary = 85000 +city = "Hyd" +print("Hello {0} your salary is {1} " + "and your city is {2}".format(name,salary,city)) +print("Hello {} your salary is {} " + "and your city is {}".format(name,salary,city)) +print("Hello {x} your salary is {z} " + "and your city is {y}".format(x=name,z=salary,y =city)) \ No newline at end of file From 86806b966754de9d03fbdac1f6886f392c9d453a Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Fri, 27 Mar 2020 18:19:44 -0700 Subject: [PATCH 20/53] FlowControl fi else condition example --- flowControlconditionExample.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 flowControlconditionExample.py diff --git a/flowControlconditionExample.py b/flowControlconditionExample.py new file mode 100644 index 0000000..c79e97a --- /dev/null +++ b/flowControlconditionExample.py @@ -0,0 +1,29 @@ +# Flow control decided at run time such as if else +# 3 types + +# 1)conditional statement/selection statements +# if +# if-else +# if-elif-else +# switch not available + +#Example 1 +name = input("Enter name:") +if name == "naveen": + print("Hello {} Good morning good to see you".format(name)) +else: + print("Hello {} Good Morning".format(name)) +print("How are you") + +#Example 2 +brand = input("Enter your brand:") +if brand == "RC": + print("It is children brand") +elif brand == "RM": + print("It is not that much good") +elif brand == "sh": + print(" buy one get one") +else: + print("not available") + + From f410c2070214d647845263118ae19a6d61bc638d Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Fri, 27 Mar 2020 19:01:03 -0700 Subject: [PATCH 21/53] Flow control loop examples for and while loops --- flowControlLoopExample.py | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 flowControlLoopExample.py diff --git a/flowControlLoopExample.py b/flowControlLoopExample.py new file mode 100644 index 0000000..badf7a8 --- /dev/null +++ b/flowControlLoopExample.py @@ -0,0 +1,63 @@ +#Flow control +# 2) Iterative Statement +# loops +# +# for loop +s = input("Enter a string") +count = 0 +index = 0 +for i in s: + print("the index of {} is".format(i),end=" ") + print(index) + index += 1 + count += 1 +print(count) + +l =[10,20,30] +for x in l: + print(x) + +for y in range(1,10): + print(y) + +# while loop +# iteration know in advance then we should go for loop +# if we dont know then we can use while loop +# while condition: +# body + +# Example 1 print 1 to 10 numbers +x = 1 +while x<= 5: + print(x) + x+=1 + +#example 2 + +name ="" +pwd = "" +while (name != 'naveen') and (pwd != 1234): + name= input("enter name:") + pwd = eval(input("enter password")) + +print("Hello",name,"Good morning") + +# Example 3 infinite loop +# i = 0 +# while True: +# print(i) +# i+=1 + +#nested loops +#loop inside another loop + +for i in range(4): + for j in range(4): + print(1,j) + +#example +n = eval(input("enter number of rows:")) +for i in range(1,n+1): # i represents rows number + for j in range(1,i+1): # j represents the number of * + print("*",end= " ") + print() \ No newline at end of file From 8d195975898c781e20ad61c0a706b69ee9f20c67 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Fri, 27 Mar 2020 19:42:37 -0700 Subject: [PATCH 22/53] Flow control transfer examples break,continue and pass --- flowControlTransferExample.py | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 flowControlTransferExample.py diff --git a/flowControlTransferExample.py b/flowControlTransferExample.py new file mode 100644 index 0000000..2649566 --- /dev/null +++ b/flowControlTransferExample.py @@ -0,0 +1,63 @@ +# 3) Transfer statement +# break +# continue +# pass +#break examples +# we can use else with for loop in break +i = 0 +while True: + print("Hello") + i += 1 + if i == 5: + break + +#example2 +cart = [12,30,50,302,500,900] +for i in cart: + if i > 500: + break; + print(i) +else: + print("Congrts all processed") + + +#Continue examples + +for i in range(10): + if i%2 == 0: + continue + print(i) + +#example2 +cart = [12,30,50,302,500,900] +for i in cart: + if i >= 500: + print("Sorry we cant process this item",i) + continue + print(i) + + +#pass statement examples +# it is a keyword in python +# it is a empty stmt +# it won't do anything + +if True: + pass +else: + print("Hello") + +#example 2 +def f1(): + print("Hello") +def f2(): + pass + +f1() + +#example 3 +for i in range(100): + if i % 10 == 0: + print(i) + else: + pass \ No newline at end of file From 2c2ecd69fbd09b816dc378061688d32ff747ac20 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Sun, 5 Apr 2020 00:30:44 -0700 Subject: [PATCH 23/53] del and None example --- delKeywordExample.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 delKeywordExample.py diff --git a/delKeywordExample.py b/delKeywordExample.py new file mode 100644 index 0000000..7097e89 --- /dev/null +++ b/delKeywordExample.py @@ -0,0 +1,22 @@ +# del keyword used to delete the object for garbage collection if we no need to use + +x = 10 +print(x) +del x +#print(x) # gives error + +s = 'naveen' +#del s[1] # wont support item in string + +#but it support delete entire s + +del s +print(s) # give error + + +#NOne +# if you want to delet the object but not variable then we can use None + +n = "kumar" +n = None +print(n) \ No newline at end of file From 6ef3d4da3d5e7b2d62df1d327d70b10eddd5f83f Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Tue, 7 Apr 2020 11:08:31 -0700 Subject: [PATCH 24/53] String method doc --- document.txt | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 document.txt diff --git a/document.txt b/document.txt new file mode 100644 index 0000000..77375bd --- /dev/null +++ b/document.txt @@ -0,0 +1,64 @@ +String Methods + +s.find(substring) --> find the index of the sub string from string string + +Strip the strings + +strip --> removes the white spaces from both left and right sides +lstrip --> removes the spaces at the begining of String +rstrip --> removes the spaces at the begining of String + +count string + +s.count(substring) --> counts the occurence of substring in string string +s.count(substring,begin,end) --> from begin index to the end-1 index substring + +replace string + +s.replace(oldstring,new string) --> replaces old string with new string +eg: s = "Durga sof" +s.replace("sof","soft") +Durga soft + +splitting of String: + +s.split(separator) --> split the string based on separator +eg: +s = "Durga sof sol" +l = s.split() +print(l) --> ['Durga','sof','sol'] + +s.rsplit(separator) --> split the string based on separator in reverse + +s.split(separator, num) --> splits the string based on separator till the number + + +join() --> will use to join the separator in the list +eg: +s = ['durga','soft','sol'] +l = "-".join(s) +print(l) --> durga-soft-sol + + +changing case of a strings + +upper() ==> to convert to upper case +lower() +swapcase() --> lower to upper and upper to lower case +title() ==> The Python Classes By Durga +capitalize() --> The python classes by durga + + +Checking starting and ending part of the string + +s.startswith('learning') --> check the string starts with substring +s.endswith('learning') --> check the string ends witg substring + + + + + + + + + From 38776e72a5a5212405b498a9319e1c6b55cd6036 Mon Sep 17 00:00:00 2001 From: Naveen Date: Thu, 9 Apr 2020 21:36:56 -0700 Subject: [PATCH 25/53] Create Databricks --- Databricks | 1 + 1 file changed, 1 insertion(+) create mode 100644 Databricks diff --git a/Databricks b/Databricks new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Databricks @@ -0,0 +1 @@ + From afb0bebb74b5679d9f5c55aef617a2d064ef3026 Mon Sep 17 00:00:00 2001 From: Naveen Date: Thu, 9 Apr 2020 21:37:45 -0700 Subject: [PATCH 26/53] Update: .vscode ArrayPrograms Databricks EvenOddNumber.py FactorialNum.py HelloWorld.py InputExample.py ListPrograms Operator commandLineArgExample.py commandLineArgExample2.py commandLineArgExampleSum.py delKeywordExample.py document.txt evalexample.py findsqrt.py flowControlLoopExample.py flowControlTransferExample.py flowControlconditionExample.py for_loop.py hackerrank.py if_else_Condition.py inputMul.py inputMultiplevalues.py inputoutstmt.py largestOfThreeNumbers.py module.py outputExample.py positiveNegativeNumber.py primeNumber.py printTest.py python_learning sumOfTwoNumbers.py swapVariables.py test1.py test2.py --- python_learning | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 python_learning diff --git a/python_learning b/python_learning new file mode 100644 index 0000000..e7deead --- /dev/null +++ b/python_learning @@ -0,0 +1,18 @@ +# Databricks notebook source +print("Hello WOrld") + +# COMMAND ---------- + +a = 10 +b = 20 +x = a+b +print(x) + +# COMMAND ---------- + +n = "Naveen" +print(n) + +# COMMAND ---------- + +spark = SparkSession.build.getOrCreate() From 0f0de439852bdad7009c4f6929981e99faee0465 Mon Sep 17 00:00:00 2001 From: Naveen Date: Thu, 9 Apr 2020 21:38:11 -0700 Subject: [PATCH 27/53] Update: .vscode ArrayPrograms Databricks EvenOddNumber.py FactorialNum.py HelloWorld.py InputExample.py ListPrograms Operator commandLineArgExample.py commandLineArgExample2.py commandLineArgExampleSum.py delKeywordExample.py document.txt evalexample.py findsqrt.py flowControlLoopExample.py flowControlTransferExample.py flowControlconditionExample.py for_loop.py hackerrank.py if_else_Condition.py inputMul.py inputMultiplevalues.py inputoutstmt.py largestOfThreeNumbers.py module.py outputExample.py positiveNegativeNumber.py primeNumber.py printTest.py python_learning sumOfTwoNumbers.py swapVariables.py test1.py test2.py From 840485825559f7e0937ef53e1afa73f489e64f55 Mon Sep 17 00:00:00 2001 From: Naveen Date: Thu, 9 Apr 2020 21:38:51 -0700 Subject: [PATCH 28/53] Delete Databricks --- Databricks | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Databricks diff --git a/Databricks b/Databricks deleted file mode 100644 index 8b13789..0000000 --- a/Databricks +++ /dev/null @@ -1 +0,0 @@ - From fa0abbd508d8392698c8f50b2bc5cd5a6b9bf2e3 Mon Sep 17 00:00:00 2001 From: Naveen Date: Thu, 9 Apr 2020 21:39:27 -0700 Subject: [PATCH 29/53] Update: .vscode ArrayPrograms EvenOddNumber.py FactorialNum.py HelloWorld.py InputExample.py ListPrograms Operator commandLineArgExample.py commandLineArgExample2.py commandLineArgExampleSum.py delKeywordExample.py document.txt evalexample.py findsqrt.py flowControlLoopExample.py flowControlTransferExample.py flowControlconditionExample.py for_loop.py hackerrank.py if_else_Condition.py inputMul.py inputMultiplevalues.py inputoutstmt.py largestOfThreeNumbers.py module.py outputExample.py positiveNegativeNumber.py primeNumber.py printTest.py python_learning sumOfTwoNumbers.py swapVariables.py test1.py test2.py --- python_learning | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/python_learning b/python_learning index e7deead..9c2dbe7 100644 --- a/python_learning +++ b/python_learning @@ -11,8 +11,4 @@ print(x) # COMMAND ---------- n = "Naveen" -print(n) - -# COMMAND ---------- - -spark = SparkSession.build.getOrCreate() +print(n) \ No newline at end of file From b6e10add2880cf84b5744461e7b1670ed85e29f1 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Sat, 16 May 2020 22:25:23 -0700 Subject: [PATCH 30/53] Commit --- ArrayPrograms/smallestNumber.py | 1 + ListFunctions.txt | 38 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 ListFunctions.txt diff --git a/ArrayPrograms/smallestNumber.py b/ArrayPrograms/smallestNumber.py index 5455f8f..20cdd53 100644 --- a/ArrayPrograms/smallestNumber.py +++ b/ArrayPrograms/smallestNumber.py @@ -12,4 +12,5 @@ def smallestNum(arr,n): n = len(arr) ans = smallestNum(arr,n) + print("smallest number of array {0} is {1}".format(arr,ans)) \ No newline at end of file diff --git a/ListFunctions.txt b/ListFunctions.txt new file mode 100644 index 0000000..a9b79c7 --- /dev/null +++ b/ListFunctions.txt @@ -0,0 +1,38 @@ +Important functions + +l = [12,43,23,49,53,24] + +1) len(list) + len(l) +2) count(x) ---> element in list + l.count(43) +3) index(x) ---> get the x element index from list + l.index(23) + + +Manipulating list + +1) append() + l.append(30) +2) insert() ---> To insert element at specific index + l.insert(1,20) --> 1 index and 20 value + append vs insert() --> append only inserts at the end but insert adds based on index +3) extend() ---> adds all elemts + l = ['a','b','c'] + l2 = ['w','q'] + l.extend(l2) --> ['a',b','c','w','q'] +4) remove(x) and pop(index) or pop() + +5) reverse() +6) sort() +7) copy() +8) clear() + +CompareList objects +1) ==, != +2) <,>,>=,<= + + +Nested Lists: + + From 653889530236b51bb88246173084626362d4b7c9 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Fri, 19 Jun 2020 22:28:47 -0700 Subject: [PATCH 31/53] commit --- if_else_Condition.py | 4 +++- printTest.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/if_else_Condition.py b/if_else_Condition.py index b0d8f8a..3b71e48 100644 --- a/if_else_Condition.py +++ b/if_else_Condition.py @@ -3,4 +3,6 @@ if x % 2 == 0: print("Even number") else: - print("Odd number") \ No newline at end of file + print("Odd number") + +print("If else condition example") \ No newline at end of file diff --git a/printTest.py b/printTest.py index 8e23576..19051ea 100644 --- a/printTest.py +++ b/printTest.py @@ -1 +1 @@ -print("Hello World") \ No newline at end of file +print("Hello World") \ No newline at end of file From 58bc451c5a79880abdbfcd9d0352bd686e07b509 Mon Sep 17 00:00:00 2001 From: Naveen-sudo Date: Sat, 20 Jun 2020 23:35:30 -0700 Subject: [PATCH 32/53] commit --- if_else_Condition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/if_else_Condition.py b/if_else_Condition.py index 3b71e48..8d55000 100644 --- a/if_else_Condition.py +++ b/if_else_Condition.py @@ -5,4 +5,4 @@ else: print("Odd number") -print("If else condition example") \ No newline at end of file +print("If else condition example ") \ No newline at end of file From 1434b1c3cff841ac275e3a61e7f27c6126715151 Mon Sep 17 00:00:00 2001 From: Naveen Ganta Date: Fri, 31 Dec 2021 22:41:37 -0500 Subject: [PATCH 33/53] Smallest number from a array --- ArrayPrograms/smallestNumber.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ArrayPrograms/smallestNumber.py b/ArrayPrograms/smallestNumber.py index 20cdd53..5455f8f 100644 --- a/ArrayPrograms/smallestNumber.py +++ b/ArrayPrograms/smallestNumber.py @@ -12,5 +12,4 @@ def smallestNum(arr,n): n = len(arr) ans = smallestNum(arr,n) - print("smallest number of array {0} is {1}".format(arr,ans)) \ No newline at end of file From 3814de5d3cee6e167c8c6d34a0cc605a8715e862 Mon Sep 17 00:00:00 2001 From: Naveen Ganta Date: Tue, 4 Jan 2022 21:39:49 -0500 Subject: [PATCH 34/53] Functions --- Functions/Functions.txt | 16 ++++++++++++++++ Functions/funct.py | 5 +++++ 2 files changed, 21 insertions(+) create mode 100644 Functions/Functions.txt create mode 100644 Functions/funct.py diff --git a/Functions/Functions.txt b/Functions/Functions.txt new file mode 100644 index 0000000..9f037fe --- /dev/null +++ b/Functions/Functions.txt @@ -0,0 +1,16 @@ +Functions: + Function is the block of code that will be used to run the code when called and we can use to run multple purpose + + Defining a function: + Function always starts with a keyword def and with some name of functio then the paranthesis() + Every function is indented to be used with colon : + +# def a function +# def a function with parameters +# function with unlimited arguments *arg +# function with keywords +# function with arbitraty keywords **kwargs +# function with default values +# passing the list as an argument +# return a value to the function +# function with passing a stmt pass \ No newline at end of file diff --git a/Functions/funct.py b/Functions/funct.py new file mode 100644 index 0000000..8da6f18 --- /dev/null +++ b/Functions/funct.py @@ -0,0 +1,5 @@ +def func(): + print("function") + + +func() \ No newline at end of file From c276b5c8f7d863d1b770e699dbc7b8a079cb740b Mon Sep 17 00:00:00 2001 From: Naveen Ganta Date: Fri, 7 Jan 2022 23:46:29 -0500 Subject: [PATCH 35/53] functions --- Functions/arbitraryFunction.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Functions/arbitraryFunction.py diff --git a/Functions/arbitraryFunction.py b/Functions/arbitraryFunction.py new file mode 100644 index 0000000..6810daa --- /dev/null +++ b/Functions/arbitraryFunction.py @@ -0,0 +1,5 @@ +#arbitrary function that which will be used to call number of parameters +def func(*arg): + print("fname" + fname + "last name" + lname) + +func() \ No newline at end of file From f857ec3d3198746d3d88778221e343e5b4950c4d Mon Sep 17 00:00:00 2001 From: Naveen Ganta Date: Sun, 9 Jan 2022 01:10:24 -0500 Subject: [PATCH 36/53] functions --- Functions/funct.py | 5 +++-- Functions/functionWithParameters.py | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 Functions/functionWithParameters.py diff --git a/Functions/funct.py b/Functions/funct.py index 8da6f18..c475c61 100644 --- a/Functions/funct.py +++ b/Functions/funct.py @@ -1,5 +1,6 @@ +#function definition def func(): - print("function") - + print("Inside the function") +#calling function func() \ No newline at end of file diff --git a/Functions/functionWithParameters.py b/Functions/functionWithParameters.py new file mode 100644 index 0000000..1d77c15 --- /dev/null +++ b/Functions/functionWithParameters.py @@ -0,0 +1,7 @@ +#definiting a function with parameter +def my_func(name): + print("Hello " + name) + + +#calling a function with the arguments +my_func("naveen") \ No newline at end of file From 886e9310db1e99ead9865b9d8a8a38c0a90d9515 Mon Sep 17 00:00:00 2001 From: naveeng Date: Mon, 7 Feb 2022 20:29:23 -0500 Subject: [PATCH 37/53] commit --- swapVariables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swapVariables.py b/swapVariables.py index 1239e9b..b5a8baf 100644 --- a/swapVariables.py +++ b/swapVariables.py @@ -1,7 +1,7 @@ # Python program to swap two variables -val1 = int(input("Enter a number")) -val2 = int(input("Enter a number")) +val1 = int(input("Enter a number ")) +val2 = int(input("Enter a number ")) temp = val1 val1 = val2 From 2559f21bca08f5f6526a59713612117e6c872802 Mon Sep 17 00:00:00 2001 From: naveeng Date: Wed, 9 Feb 2022 11:26:36 -0500 Subject: [PATCH 38/53] Function --- .idea/.gitignore | 3 +++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/python_learning.iml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ ArrayPrograms/smallestNumber.py | 12 ++++++------ evalexample.py | 4 ++-- 8 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/python_learning.iml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..7ba73c2 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..4be24c6 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/python_learning.iml b/.idea/python_learning.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/python_learning.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ArrayPrograms/smallestNumber.py b/ArrayPrograms/smallestNumber.py index 5455f8f..046f92c 100644 --- a/ArrayPrograms/smallestNumber.py +++ b/ArrayPrograms/smallestNumber.py @@ -1,15 +1,15 @@ -#Find the smallest number in an array - -def smallestNum(arr,n): +# Find the smallest number in an array +def smallestNum(arr, n): small = arr[0] for i in range(1, n): if arr[i] < small: small = arr[i] return small -arr = [1,3,4,2,54,-3] + +arr = [1, 3, 4, 2, 54, -3] n = len(arr) -ans = smallestNum(arr,n) +ans = smallestNum(arr, n) -print("smallest number of array {0} is {1}".format(arr,ans)) \ No newline at end of file +print("smallest number of array {0} is {1}".format(arr, ans)) diff --git a/evalexample.py b/evalexample.py index d7c3043..4864ba8 100644 --- a/evalexample.py +++ b/evalexample.py @@ -1,10 +1,10 @@ # Evaluate the values type automatically -ex = input("ENter an expression") +ex = input("Enter an expression") print(type(eval(ex))) # ex = 12 # class int x = eval(input("enter a number")) -print(x) \ No newline at end of file +print(x) From a1b099737a9fb6c4c9a06e4e5f3113143a4b2024 Mon Sep 17 00:00:00 2001 From: naveeng Date: Tue, 27 Dec 2022 22:47:15 -0500 Subject: [PATCH 39/53] commit --- ListPrograms/listDoc.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ListPrograms/listDoc.txt diff --git a/ListPrograms/listDoc.txt b/ListPrograms/listDoc.txt new file mode 100644 index 0000000..79371b8 --- /dev/null +++ b/ListPrograms/listDoc.txt @@ -0,0 +1,17 @@ + + +List is the collection of similar or different types of data. we use square brackets to store data as list. + suppose we want to store a group of numbers in list we can store lie + e.g: [1,2,3,4] + we can use list to store different data type values as well like + e.g: ["naveen",3,4,4.5] + +we can create a list like below +1) num = [1,2,3] + +we can access the elements of a list by using the index from the list. index is basically location where the + elements store + e.g: to access the number 3 from the above variable num is n[2] here we are using index 2 because in list + the index numbers starts from 0 and increments by 1 from left to right. + We can even access data from right to left as well by using the negative index where the index will starts + from -1. We can get the result 3 by using num[-1] From 09f3fc9c4c5bb59e6eb6e983bbaebfe776a6f2ae Mon Sep 17 00:00:00 2001 From: naveeng Date: Wed, 28 Dec 2022 21:40:03 -0500 Subject: [PATCH 40/53] list doc --- ListPrograms/listDoc.md | 58 ++++++++++++++++++++++++++++++++++++++++ ListPrograms/listDoc.txt | 17 ------------ 2 files changed, 58 insertions(+), 17 deletions(-) create mode 100644 ListPrograms/listDoc.md delete mode 100644 ListPrograms/listDoc.txt diff --git a/ListPrograms/listDoc.md b/ListPrograms/listDoc.md new file mode 100644 index 0000000..208bfbe --- /dev/null +++ b/ListPrograms/listDoc.md @@ -0,0 +1,58 @@ +#List + +List is the collection of similar or different types of data. we use square brackets to store data as list. + suppose we want to store a group of numbers in list we can store lie + e.g: [1,2,3,4] + we can use list to store different data type values as well like + e.g: ["naveen",3,4,4.5] + +we can create a list like below +1) num = [1,2,3] + +## Access values from list: + +we can access the elements of a list by using the index from the list. index is basically location where the + elements store + e.g: to access the number 3 from the above variable num is n[2] here we are using index 2 because in list + the index numbers starts from 0 and increments by 1 from left to right. + We can even access data from right to left as well by using the negative index where the index will starts + from -1. We can get the result 3 by using num[-1] + +## Slicing of python list: + + We can get the values by using the list, and also we can get the group of words by slicing the list like below + +suppose we have a list with couple of letters + +str = ['h','e','l','l','o','w','o','r','l','d'] + +we can get the first 5 letters from the above list by using the str[0:4] ===> ['h','e','l','l','o'] +and we can also use the negative index i.e we can get the values from the right side. + +## Adding element to the list: + python provides different methods, where we can use this by add elements to the list + + #### append() + by using the append() method we can add the element at the end of the list + e.g: test = [1,2,3,4] + + we can add the number 5 to the list by using the append method like + test.append(5) + + output: [1,2,3,4,5] + + #### extend() + By using the extend() method we can add all the elements of one list to another + But the elements will be added at the end of initial list + e.g: even_numbers = [2,4,6,8] + odd_numbers = [1,3,5,7] + whole_numbers = even_number.extend(odd_numbers) + output: + [2,4,6,8,1,3,5,7] + + + + + + + diff --git a/ListPrograms/listDoc.txt b/ListPrograms/listDoc.txt deleted file mode 100644 index 79371b8..0000000 --- a/ListPrograms/listDoc.txt +++ /dev/null @@ -1,17 +0,0 @@ - - -List is the collection of similar or different types of data. we use square brackets to store data as list. - suppose we want to store a group of numbers in list we can store lie - e.g: [1,2,3,4] - we can use list to store different data type values as well like - e.g: ["naveen",3,4,4.5] - -we can create a list like below -1) num = [1,2,3] - -we can access the elements of a list by using the index from the list. index is basically location where the - elements store - e.g: to access the number 3 from the above variable num is n[2] here we are using index 2 because in list - the index numbers starts from 0 and increments by 1 from left to right. - We can even access data from right to left as well by using the negative index where the index will starts - from -1. We can get the result 3 by using num[-1] From 2dcfd7e421ac449102359fff83e3c82d8314de1a Mon Sep 17 00:00:00 2001 From: naveeng Date: Wed, 28 Dec 2022 21:42:14 -0500 Subject: [PATCH 41/53] list doc --- ListPrograms/listDoc.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ListPrograms/listDoc.md b/ListPrograms/listDoc.md index 208bfbe..d97f037 100644 --- a/ListPrograms/listDoc.md +++ b/ListPrograms/listDoc.md @@ -1,4 +1,4 @@ -#List +# List List is the collection of similar or different types of data. we use square brackets to store data as list. suppose we want to store a group of numbers in list we can store lie @@ -32,7 +32,7 @@ and we can also use the negative index i.e we can get the values from the right ## Adding element to the list: python provides different methods, where we can use this by add elements to the list - #### append() + ### append() by using the append() method we can add the element at the end of the list e.g: test = [1,2,3,4] @@ -41,7 +41,7 @@ and we can also use the negative index i.e we can get the values from the right output: [1,2,3,4,5] - #### extend() + ### extend() By using the extend() method we can add all the elements of one list to another But the elements will be added at the end of initial list e.g: even_numbers = [2,4,6,8] From 6973fe4b2c05686526c2ae620c3b351e64124432 Mon Sep 17 00:00:00 2001 From: naveeng Date: Wed, 28 Dec 2022 21:43:58 -0500 Subject: [PATCH 42/53] list doc --- ListPrograms/listDoc.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ListPrograms/listDoc.md b/ListPrograms/listDoc.md index d97f037..3b80674 100644 --- a/ListPrograms/listDoc.md +++ b/ListPrograms/listDoc.md @@ -30,9 +30,9 @@ we can get the first 5 letters from the above list by using the str[0:4] ===> [ and we can also use the negative index i.e we can get the values from the right side. ## Adding element to the list: - python provides different methods, where we can use this by add elements to the list + python provides different methods to add the elements to the list, where we can use this by add elements to the list - ### append() + * append() * by using the append() method we can add the element at the end of the list e.g: test = [1,2,3,4] @@ -41,7 +41,7 @@ and we can also use the negative index i.e we can get the values from the right output: [1,2,3,4,5] - ### extend() + * extend() * By using the extend() method we can add all the elements of one list to another But the elements will be added at the end of initial list e.g: even_numbers = [2,4,6,8] From 02d35fe63d406e7d5dd978e925941257a9cc207c Mon Sep 17 00:00:00 2001 From: naveeng Date: Wed, 28 Dec 2022 21:45:17 -0500 Subject: [PATCH 43/53] list doc --- ListPrograms/listDoc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ListPrograms/listDoc.md b/ListPrograms/listDoc.md index 3b80674..58b1f0d 100644 --- a/ListPrograms/listDoc.md +++ b/ListPrograms/listDoc.md @@ -32,7 +32,7 @@ and we can also use the negative index i.e we can get the values from the right ## Adding element to the list: python provides different methods to add the elements to the list, where we can use this by add elements to the list - * append() * + ** append() ** by using the append() method we can add the element at the end of the list e.g: test = [1,2,3,4] @@ -41,7 +41,7 @@ and we can also use the negative index i.e we can get the values from the right output: [1,2,3,4,5] - * extend() * + ** extend() ** By using the extend() method we can add all the elements of one list to another But the elements will be added at the end of initial list e.g: even_numbers = [2,4,6,8] From b8162ffb53623c60084bc506c56a5c0185e0c539 Mon Sep 17 00:00:00 2001 From: naveeng Date: Wed, 28 Dec 2022 21:47:30 -0500 Subject: [PATCH 44/53] list doc --- ListPrograms/listDoc.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ListPrograms/listDoc.md b/ListPrograms/listDoc.md index 58b1f0d..9604f97 100644 --- a/ListPrograms/listDoc.md +++ b/ListPrograms/listDoc.md @@ -11,7 +11,7 @@ we can create a list like below ## Access values from list: -we can access the elements of a list by using the index from the list. index is basically location where the + we can access the elements of a list by using the index from the list. index is basically location where the elements store e.g: to access the number 3 from the above variable num is n[2] here we are using index 2 because in list the index numbers starts from 0 and increments by 1 from left to right. @@ -20,19 +20,19 @@ we can access the elements of a list by using the index from the list. index is ## Slicing of python list: - We can get the values by using the list, and also we can get the group of words by slicing the list like below + We can get the group of values by slicing the list, and also we can get the group of words by slicing the list like below -suppose we have a list with couple of letters + suppose we have a list with couple of letters -str = ['h','e','l','l','o','w','o','r','l','d'] + str = ['h','e','l','l','o','w','o','r','l','d'] -we can get the first 5 letters from the above list by using the str[0:4] ===> ['h','e','l','l','o'] -and we can also use the negative index i.e we can get the values from the right side. + we can get the first 5 letters from the above list by using the str[0:4] ===> ['h','e','l','l','o'] + and we can also use the negative index i.e we can get the values from the right side. ## Adding element to the list: python provides different methods to add the elements to the list, where we can use this by add elements to the list - ** append() ** + ** append() ** by using the append() method we can add the element at the end of the list e.g: test = [1,2,3,4] From 5c45183e46df49c94369801216098373642852e5 Mon Sep 17 00:00:00 2001 From: naveeng Date: Wed, 28 Dec 2022 22:00:53 -0500 Subject: [PATCH 45/53] list doc --- ListPrograms/listDoc.md | 42 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/ListPrograms/listDoc.md b/ListPrograms/listDoc.md index 9604f97..8ce3145 100644 --- a/ListPrograms/listDoc.md +++ b/ListPrograms/listDoc.md @@ -1,7 +1,8 @@ # List -List is the collection of similar or different types of data. we use square brackets to store data as list. - suppose we want to store a group of numbers in list we can store lie +List is the collection of similar or different types of data. we use square brackets to store data as list and python lists are mutable that means +we can change the values in the list. +suppose we want to store a group of numbers in list we can store lie e.g: [1,2,3,4] we can use list to store different data type values as well like e.g: ["naveen",3,4,4.5] @@ -32,7 +33,7 @@ we can create a list like below ## Adding element to the list: python provides different methods to add the elements to the list, where we can use this by add elements to the list - ** append() ** + append() by using the append() method we can add the element at the end of the list e.g: test = [1,2,3,4] @@ -41,7 +42,7 @@ we can create a list like below output: [1,2,3,4,5] - ** extend() ** + extend() By using the extend() method we can add all the elements of one list to another But the elements will be added at the end of initial list e.g: even_numbers = [2,4,6,8] @@ -51,8 +52,41 @@ we can create a list like below [2,4,6,8,1,3,5,7] +## Changing the Values in the list +As we know python lists are mutable so we can change the values of the list by using the index and replace with other items. +e.g: fruits = ['apple','banana','grapes'] +here we want to replace the banana fruit with melon like below + fruits[1] = 'melon' +finally when we print the fruits we get the below values + output: fruits = ['apple','melon','grapes'] + +## Removing an element from the list + +we have different methods available to delete the values from the list. + + del() + By using the del() method we can delete one or more elements from the list. + e.g: fruits = ['apple','banana','grapes'] + to delete the banana fruit we can use the index like below + del fruits[1] + the result of the above statement gives the belo list + ['apple','grapes'] + + We can also delete the multiple elements from the list + e.g: fruits = ['apple','banana','grapes','berries'] + del fruits[2:3] + the result list will be ['apple','banana'] + + + remove() + Unline the del() method where we delete the element from the list by using the index, here we use the actual element to + delete from the list. + e.g: fruits = ['apple','banana','grapes'] + fruits.remove('banana') + the result list will be ==> ['apple','grapes'] + \ No newline at end of file From 5eff26945648ff2e482b32678ca70d795118ad8f Mon Sep 17 00:00:00 2001 From: naveeng Date: Sat, 25 Feb 2023 17:14:36 -0500 Subject: [PATCH 46/53] sample --- Hacker_Rank/print.py | 0 Hacker_Rank/write_a_function.py | 0 test.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 Hacker_Rank/print.py create mode 100644 Hacker_Rank/write_a_function.py create mode 100644 test.py diff --git a/Hacker_Rank/print.py b/Hacker_Rank/print.py new file mode 100644 index 0000000..e69de29 diff --git a/Hacker_Rank/write_a_function.py b/Hacker_Rank/write_a_function.py new file mode 100644 index 0000000..e69de29 diff --git a/test.py b/test.py new file mode 100644 index 0000000..e69de29 From 0dd0b9fe67d4a205aae5fd78be88bcba20de7add Mon Sep 17 00:00:00 2001 From: naveeng Date: Sat, 25 Feb 2023 17:15:09 -0500 Subject: [PATCH 47/53] sample --- .idea/misc.xml | 2 +- .idea/python_learning.iml | 2 +- Functions/test.py | 3 +++ Hacker_Rank/print.py | 14 ++++++++++++++ Hacker_Rank/write_a_function.py | 27 +++++++++++++++++++++++++++ ListPrograms/listDoc.md | 23 ++++++++++++----------- test.ipynb | 0 test.py | 31 +++++++++++++++++++++++++++++++ test2.ipnb | 0 test2.ipynb | 0 10 files changed, 89 insertions(+), 13 deletions(-) create mode 100644 Functions/test.py create mode 100644 test.ipynb create mode 100644 test2.ipnb create mode 100644 test2.ipynb diff --git a/.idea/misc.xml b/.idea/misc.xml index 7ba73c2..a971a2c 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/.idea/python_learning.iml b/.idea/python_learning.iml index d0876a7..909438d 100644 --- a/.idea/python_learning.iml +++ b/.idea/python_learning.iml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/Functions/test.py b/Functions/test.py new file mode 100644 index 0000000..cb2532e --- /dev/null +++ b/Functions/test.py @@ -0,0 +1,3 @@ +def greet(): + print("Hello world") + print("Welcome abord") \ No newline at end of file diff --git a/Hacker_Rank/print.py b/Hacker_Rank/print.py index e69de29..558b9d5 100644 --- a/Hacker_Rank/print.py +++ b/Hacker_Rank/print.py @@ -0,0 +1,14 @@ +def summingSeries(n): + return (n*n) % 10000007 + + +if __name__ == '__main__': + t = int(input().strip()) + for t_itr in range(t): + n = int(input().strip()) + + result = summingSeries(n) + print(result) + + # for i in range(1, n + 1): + # print(i, end=' ') diff --git a/Hacker_Rank/write_a_function.py b/Hacker_Rank/write_a_function.py index e69de29..045008e 100644 --- a/Hacker_Rank/write_a_function.py +++ b/Hacker_Rank/write_a_function.py @@ -0,0 +1,27 @@ +def is_leap(year): + # variable to check the leap year + leap = False + + # divided by 100 means century year + # century year divided by 400 is leap year + if (year % 400 == 0) and (year % 100 == 0): + + # change leap to True + leap = True + + # not divided by 100 means not a century year + # year divided by 4 is a leap year + elif (year % 4 == 0) and (year % 100 != 0): + + # Change leap to true + leap = True + + # else not a leap year + else: + pass + + return leap + + + +is_leap(2017) \ No newline at end of file diff --git a/ListPrograms/listDoc.md b/ListPrograms/listDoc.md index 8ce3145..6a75fc8 100644 --- a/ListPrograms/listDoc.md +++ b/ListPrograms/listDoc.md @@ -34,7 +34,7 @@ we can create a list like below python provides different methods to add the elements to the list, where we can use this by add elements to the list append() - by using the append() method we can add the element at the end of the list + By using the append() method we can add the element at the end of the list e.g: test = [1,2,3,4] we can add the number 5 to the list by using the append method like @@ -54,15 +54,15 @@ we can create a list like below ## Changing the Values in the list -As we know python lists are mutable so we can change the values of the list by using the index and replace with other items. - -e.g: fruits = ['apple','banana','grapes'] - -here we want to replace the banana fruit with melon like below - fruits[1] = 'melon' - -finally when we print the fruits we get the below values - output: fruits = ['apple','melon','grapes'] + As we know python lists are mutable so we can change the values of the list by using the index and replace with other items. + + e.g: fruits = ['apple','banana','grapes'] + + here we want to replace the banana fruit with melon like below + fruits[1] = 'melon' + + finally when we print the fruits we get the below values + output: fruits = ['apple','melon','grapes'] ## Removing an element from the list @@ -89,4 +89,5 @@ we have different methods available to delete the values from the list. e.g: fruits = ['apple','banana','grapes'] fruits.remove('banana') the result list will be ==> ['apple','grapes'] - \ No newline at end of file + + diff --git a/test.ipynb b/test.ipynb new file mode 100644 index 0000000..e69de29 diff --git a/test.py b/test.py index e69de29..369254a 100644 --- a/test.py +++ b/test.py @@ -0,0 +1,31 @@ +# if __name__ == '__main__': +# nm = [] +# ls = [] +# +# for _ in range(int(input())): +# name = input() +# score = float(input()) +# +# print(name,score) + +if __name__ == '__main__': + num = [] + arr = [] + for _ in range(int(input())): + name = input() + score = float(input()) + arr.append([name, score]) + num.append(score) + + num.sort() + second_min = 0 + mini = num[0] + arr.sort() + for i in num: + if i != mini: + second_min = i + break + + for i in arr: + if i[1] == second_min: + print(i[0]) diff --git a/test2.ipnb b/test2.ipnb new file mode 100644 index 0000000..e69de29 diff --git a/test2.ipynb b/test2.ipynb new file mode 100644 index 0000000..e69de29 From ac8b8ae138a33a2c26ac13d4f6e4d1c501e93514 Mon Sep 17 00:00:00 2001 From: naveeng Date: Mon, 4 Sep 2023 15:45:40 -0400 Subject: [PATCH 48/53] practice --- .../if_else_Condition-checkpoint.py | 8 + .ipynb_checkpoints/test-checkpoint.ipynb | 1634 +++++++++++++++++ .../test_ml-checkpoint.ipynb | 6 + ML/test_ml.ipynb | 409 +++++ 4 files changed, 2057 insertions(+) create mode 100644 .ipynb_checkpoints/if_else_Condition-checkpoint.py create mode 100644 .ipynb_checkpoints/test-checkpoint.ipynb create mode 100644 ML/.ipynb_checkpoints/test_ml-checkpoint.ipynb create mode 100644 ML/test_ml.ipynb diff --git a/.ipynb_checkpoints/if_else_Condition-checkpoint.py b/.ipynb_checkpoints/if_else_Condition-checkpoint.py new file mode 100644 index 0000000..8d55000 --- /dev/null +++ b/.ipynb_checkpoints/if_else_Condition-checkpoint.py @@ -0,0 +1,8 @@ +x = int(input("enter a number")) + +if x % 2 == 0: + print("Even number") +else: + print("Odd number") + +print("If else condition example ") \ No newline at end of file diff --git a/.ipynb_checkpoints/test-checkpoint.ipynb b/.ipynb_checkpoints/test-checkpoint.ipynb new file mode 100644 index 0000000..1dce5e5 --- /dev/null +++ b/.ipynb_checkpoints/test-checkpoint.ipynb @@ -0,0 +1,1634 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [], + "source": [ + "ml = [1,2,3,2,3,4,5,6]" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "5" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nl = []\n", + "for i in ml:\n", + " if i not in nl:\n", + " nl.append(i)\n", + "\n", + "nl.sort()\n", + "nl[-2]" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "def rn(li):\n", + " nl=[]\n", + " for i in li:\n", + " if i not in nl:\n", + " nl.append(i)\n", + " \n", + " nl.sort()\n", + " return nl[-2]" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[3]\n" + ] + } + ], + "source": [ + "if __name__ == '__main__':\n", + " n = int(input())\n", + " arr = map(int, input().split())\n", + " lst = list(arr)\n", + " score = list(lst)\n", + " print(score)\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": {}, + "outputs": [], + "source": [ + "list(set(ml)).sort()" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (2420166799.py, line 7)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m Cell \u001b[0;32mIn[34], line 7\u001b[0;36m\u001b[0m\n\u001b[0;31m score =\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + ] + } + ], + "source": [ + "if __name__ == '__main__':\n", + " num = []\n", + " arr = []\n", + " ls = int(input())\n", + " for _ in range(ls):\n", + " name = input()\n", + " score = " + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Not weired\n" + ] + } + ], + "source": [ + "if __name__ == '__main__':\n", + " n = int(input(\"Enter a number\").strip())\n", + " if n % 2 != 0:\n", + " print(\"Weired\")\n", + " elif n in range(2,6):\n", + " print(\"Not weired\")\n", + " elif n in range (6,21):\n", + " print(\"weired\")\n", + " else:\n", + " print(\"Not weired\")" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "ename": "IndexError", + "evalue": "list index out of range", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[41], line 12\u001b[0m\n\u001b[1;32m 10\u001b[0m first_multiple_input \u001b[39m=\u001b[39m \u001b[39minput\u001b[39m()\u001b[39m.\u001b[39mrstrip()\u001b[39m.\u001b[39msplit()\n\u001b[1;32m 11\u001b[0m a \u001b[39m=\u001b[39m \u001b[39mint\u001b[39m(first_multiple_input[\u001b[39m0\u001b[39m])\n\u001b[0;32m---> 12\u001b[0m b \u001b[39m=\u001b[39m \u001b[39mint\u001b[39m(first_multiple_input[\u001b[39m1\u001b[39;49m])\n\u001b[1;32m 13\u001b[0m x \u001b[39m=\u001b[39m \u001b[39mint\u001b[39m(first_multiple_input[\u001b[39m2\u001b[39m])\n\u001b[1;32m 14\u001b[0m y \u001b[39m=\u001b[39m \u001b[39mint\u001b[39m(first_multiple_input[\u001b[39m3\u001b[39m])\n", + "\u001b[0;31mIndexError\u001b[0m: list index out of range" + ] + } + ], + "source": [ + "def solve(a,b,x,y):\n", + " if math.gcd(a,b) == math.gcd(x,y):\n", + " return \"YES\"\n", + " return \"NO\"\n", + "\n", + "if __name__ == '__main__':\n", + " t = int(input().strip())\n", + "\n", + " for _ in range (int(input())):\n", + " first_multiple_input = input().rstrip().split()\n", + " a = int(first_multiple_input[0])\n", + " b = int(first_multiple_input[1])\n", + " x = int(first_multiple_input[2])\n", + " y = int(first_multiple_input[3])\n", + "\n", + " result = solve(a,b,x,y)" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "invalid literal for int() with base 10: ''", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[43], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39m__name__\u001b[39m \u001b[39m==\u001b[39m \u001b[39m'\u001b[39m\u001b[39m__main__\u001b[39m\u001b[39m'\u001b[39m:\n\u001b[0;32m----> 2\u001b[0m x \u001b[39m=\u001b[39m \u001b[39mint\u001b[39;49m(\u001b[39minput\u001b[39;49m())\n\u001b[1;32m 3\u001b[0m y \u001b[39m=\u001b[39m \u001b[39mint\u001b[39m(\u001b[39minput\u001b[39m())\n\u001b[1;32m 4\u001b[0m z \u001b[39m=\u001b[39m \u001b[39mint\u001b[39m(\u001b[39minput\u001b[39m())\n", + "\u001b[0;31mValueError\u001b[0m: invalid literal for int() with base 10: ''" + ] + } + ], + "source": [ + "if __name__ == '__main__':\n", + " x = int(input())\n", + " y = int(input())\n", + " z = int(input())\n", + " n = int(input())\n", + " l =[]\n", + " for i in range(x+1):\n", + " for j in range(y+1):\n", + " for k in range(z+1):\n", + " if i + j + k == n:\n", + " continue\n", + " l.append([i,j,k])\n", + " \n", + " print(l)" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [], + "source": [ + "def my_function():\n", + " print(\"Hello from a function\")" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello from a function\n" + ] + } + ], + "source": [ + "my_function()" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [], + "source": [ + "def my_fun_par(fname):\n", + " print(fname + \" Refsnes\")" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Naveen Refsnes\n" + ] + } + ], + "source": [ + "my_fun_par(\"Naveen\")" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reddy Refsnes\n" + ] + } + ], + "source": [ + "my_fun_par(\"Reddy\")" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [], + "source": [ + "def my_fun(fn,ln):\n", + " ft = fn + ln\n", + " print(ft)\n", + "\n", + " # return fn" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "my_fun(\"Naveen\",\"Reddy\")" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [], + "source": [ + "def fnf(**kid):\n", + " print(\"his last name is \" + kid[\"lname\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "his last name is Ganta\n" + ] + } + ], + "source": [ + "fnf(fname= \"Tobiad\", lname=\"Ganta\")" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [], + "source": [ + "def myf(food):\n", + " for x in food:\n", + " print(x)" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "apple\n", + "banana\n", + "cherry\n" + ] + } + ], + "source": [ + "fr = ['apple','banana','cherry']\n", + "myf(fr)" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [], + "source": [ + "s = 'AABCAAADA'\n", + "k = 3" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [], + "source": [ + "n = len(s)/3" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3.0" + ] + }, + "execution_count": 67, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "n" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [], + "source": [ + "word = s[0:k]" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'AAB'" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "word" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": {}, + "outputs": [], + "source": [ + "string = s[k:]" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'CAAADA'" + ] + }, + "execution_count": 71, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "string" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": {}, + "outputs": [], + "source": [ + "while s:\n", + " word = s[0:k]\n", + " s= s[k:]\n", + "\n", + " print(''.join(help(word)))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": {}, + "outputs": [], + "source": [ + "def merge_tl(s,k):\n", + " n = len(s)\n", + "\n", + " def help(items):\n", + " seen = set()\n", + " for i in items:\n", + " if i not in seen:\n", + " yield i\n", + " seen.add(i)\n", + " while s:\n", + " word = s[0:k]\n", + " s= s[k:]\n", + "\n", + " print(''.join(help(word)))\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "None\n" + ] + } + ], + "source": [ + "print(merge_tl(s,k))" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "None\n" + ] + } + ], + "source": [ + "def merge_the_tools(string, k):\n", + " n = len(string)\n", + "\n", + " def help_fun(items):\n", + " seen = set()\n", + " for i in items:\n", + " if i not in seen:\n", + " yield i\n", + " seen.add(i)\n", + "\n", + " while string:\n", + " word = string[0:k]\n", + " string = string[k:]\n", + " \n", + " print (''.join(help_fun(word)))\n", + "\n", + "\n", + "if __name__ == '__main__':\n", + " string, k = s,k\n", + " merge_the_tools(string, k)" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "abcd\n", + "efgh\n", + "ijkl\n", + "mn\n" + ] + } + ], + "source": [ + "def wrap(st,n):\n", + " con = list(st)\n", + "\n", + " ls=[]\n", + " l=\"\"\n", + " for i in con:\n", + " if len(l) < n:\n", + " l+=i\n", + " \n", + " else:\n", + " ls.append(l)\n", + " l = i\n", + "\n", + " ls.append(l)\n", + "\n", + " return \"\\n\".join(ls)\n", + "\n", + "\n", + "\n", + "if __name__ == '__main__':\n", + " st, n = input(),int(input())\n", + " rs = wrap(st,n)\n", + " print(rs)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'g'" + ] + }, + "execution_count": 91, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "min('stringsjhs')" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "metadata": {}, + "outputs": [], + "source": [ + "import re\n", + "t = \"The rain 59 in Spain\"\n", + "x = re.search(\"^The.*Spains$\",t)" + ] + }, + { + "cell_type": "code", + "execution_count": 98, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "None\n" + ] + } + ], + "source": [ + "print(x)" + ] + }, + { + "cell_type": "code", + "execution_count": 100, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['i', 'i', 'i']\n" + ] + } + ], + "source": [ + "v = re.findall(\"[i]\",t)\n", + "print(v)" + ] + }, + { + "cell_type": "code", + "execution_count": 102, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['5', '9']\n" + ] + } + ], + "source": [ + "n= re.findall(\"\\d\",t)\n", + "print(n)" + ] + }, + { + "cell_type": "code", + "execution_count": 103, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['rain']" + ] + }, + "execution_count": 103, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "re.findall(\"r..n\",t)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "def swapList(newList):\n", + " n = len(newList)\n", + "\n", + " temp = newList[0]\n", + " newList[0] = newList[n-1]\n", + " newList[n-1] = temp\n", + "\n", + " return newList" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 3, 4, 1]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l =[1,2,3,4,5]\n", + "swapList(l)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "def swapPosition(list,pos1,pos2):\n", + "\n", + " list[pos1],list[pos2] = list[pos2],list[pos1]\n", + " \n", + " return list" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 4, 3, 1]" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "swapPosition(l,2,3)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "def swapEle(list,e1,e2):\n", + "\n", + " \n", + " for sub in list:\n", + " temp = '-'\n", + " sub.replace(e1,temp).replace(e2,e1).replace(temp,e2)\n", + "\n", + " return sub\n" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Geeks'" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl = ['Gfg', 'is', 'best', 'for', 'Geeks']\n", + "swapEle(sl,'e','G')" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "ls = \", \".join(sl)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gfg, is, best, for, Geeks\n" + ] + } + ], + "source": [ + "print(ls)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['efg', 'is', 'bGst', 'for', 'eGGks']\n" + ] + } + ], + "source": [ + "res = ls.replace('G','-').replace('e','G').replace('-','e').split(', ')\n", + "print(res)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [], + "source": [ + "def max(a,b):\n", + " if a>b:\n", + " return a\n", + " else:\n", + " return (\"maximum of numbers is \" + str(b))" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'maximum of numbers is 4'" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(2,4)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "min(3,1)" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 4, 3, 1]" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "def elemList(l,n):\n", + " if n in l:\n", + " return \"exist\"\n", + " else:\n", + " return \"not present\"" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'exist'" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "elemList(l,5)" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 4, 3, 1]" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [], + "source": [ + "def reveseL(l):\n", + " nl = []\n", + " ln = len(l)-1\n", + " for i in l:\n", + " nl.insert(0,i)\n", + "\n", + " return nl" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[5, 2, 4, 3, 1]\n", + "[1, 3, 4, 2, 5]\n" + ] + } + ], + "source": [ + "print(l)\n", + "print(reveseL(l))" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [], + "source": [ + "l\n", + "m = l[:]" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 4, 3, 1]" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [], + "source": [ + "def counl(l,e):\n", + " c = 0\n", + " for i in l:\n", + " if i == e:\n", + " c += 1\n", + " return c" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 74, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ls = [1,2,3,2,1,3,5,3,4,2,1,2]\n", + "counl(ls,2)" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [], + "source": [ + "def sumav(l):\n", + " sc = 0\n", + " for i in l:\n", + " sc += 1\n", + "\n", + " sm = sum(l)\n", + " avg = sm/len(l)\n", + "\n", + " return sm,avg" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'sumav' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[3], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m ll \u001b[39m=\u001b[39m [\u001b[39m1\u001b[39m,\u001b[39m2\u001b[39m,\u001b[39m3\u001b[39m]\n\u001b[0;32m----> 2\u001b[0m sumav(ll)\n", + "\u001b[0;31mNameError\u001b[0m: name 'sumav' is not defined" + ] + } + ], + "source": [ + "ll = [1,2,3]\n", + "sumav(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "metadata": {}, + "outputs": [], + "source": [ + "def sumnu(l):\n", + " res = []\n", + " for i in l:\n", + " sum = 0\n", + " for d in str(i):\n", + " sum += int(d)\n", + " res.append(sum)\n", + " \n", + " return res" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[3, 13, 17, 7]" + ] + }, + "execution_count": 85, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sn = [12,67,98,34]\n", + "sumnu(sn)" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "metadata": {}, + "outputs": [], + "source": [ + "def mulp(l):\n", + " rs = 1\n", + " for i in l:\n", + " rs *= i\n", + " \n", + " return rs" + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "execution_count": 89, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mulp(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 96, + "metadata": {}, + "outputs": [], + "source": [ + "def smaln(l):\n", + " sm = l[0]\n", + " for i in range(len(l)):\n", + " if l[i] < sm:\n", + " sm = l[i]\n", + " \n", + " return sm" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 97, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "smaln(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "def larg(l):\n", + " sm = l[0]\n", + " for i in range(len(l)):\n", + " if l[i]> sm:\n", + " sm = l[i]\n", + "\n", + " return sm" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "larg(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "def secondLar(l):\n", + " larg = l[0]\n", + " secondlarge = 0\n", + " for i in range(len(l)):\n", + " if l[i] > l[0]:\n", + " larg = l[i]\n", + " else:\n", + " secondlarge = max(secondlarge,l[i])\n", + " \n", + " return secondlarge" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# print(ll)\n", + "secondLar(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [], + "source": [ + "def evenl(l):\n", + " result = []\n", + " for n in l:\n", + " if n % 2 ==0 :\n", + " return n" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "evenl(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [], + "source": [ + "def oddl(l):\n", + " result = []\n", + " for i in l:\n", + " if i % 2 != 0:\n", + " result.append(i)\n", + "\n", + " return result" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 3]" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "oddl(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [], + "source": [ + "def evelr(l):\n", + " for i in range(l):\n", + " if i % 2 == 0:\n", + " print(i)\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "2\n", + "4\n" + ] + } + ], + "source": [ + "evelr(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [], + "source": [ + "def eoc(l):\n", + " ec = 0\n", + " oc = 0\n", + " for i in l:\n", + " if i % 2== 0:\n", + " ec += 1\n", + " else:\n", + " oc += 1\n", + " \n", + " return ec,oc" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(1, 2)" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eoc(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [], + "source": [ + "def longest_Common_Prefix(str1):\n", + " \n", + " if not str1:\n", + " return \"\"\n", + "\n", + " short_str = min(str1,key=len)\n", + "\n", + " for i, char in enumerate(short_str):\n", + " for other in str1:\n", + " if other[i] != char:\n", + " return short_str[:i]\n", + "\n", + " return short_str " + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'abcdefgh'" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "la = [\"abcdefgh\",\"abcefgh\"]\n", + "min(la)\n", + "# print(longest_Common_Prefix([\"abcdefgh\",\"abcefgh\"]))\n", + "# print(longest_Common_Prefix([\"w3r\",\"w3resource\"]))\n", + "# print(longest_Common_Prefix([\"Python\",\"PHP\", \"Perl\"]))\n", + "# print(longest_Common_Prefix([\"Python\",\"PHP\", \"Java\"]))" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": {}, + "outputs": [], + "source": [ + "def longpre(a):\n", + " le = len(a)\n", + "\n", + " if le == 0 :\n", + " return \"\"\n", + " \n", + " if le == 1:\n", + " return a[0]\n", + " \n", + "\n", + " min_str = min(len(a[0]),len(a[le - 1]))\n", + " i = 0\n", + " while (i < min_str and a[0][i] == a[le - 1][i]):\n", + " i += 1\n", + "\n", + " pre = a[0][0:i]\n", + " return pre" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'abc'" + ] + }, + "execution_count": 76, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "longpre(la)" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "1\n", + "2\n", + "3\n", + "4\n", + "5\n", + "6\n", + "7\n", + "8\n", + "9\n" + ] + } + ], + "source": [ + "i = 0\n", + "while i < 10:\n", + " print(i)\n", + " i +=1" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "metadata": {}, + "outputs": [], + "source": [ + "def twoSUm(l,tg):\n", + " for i in range(len(l)):\n", + " for j in range(i+1,len(l)):\n", + " if l[j] == tg - l[i]:\n", + " return [i,j]" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[0, 3]" + ] + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l = [1,2,3,4,5]\n", + "tg = 5\n", + "twoSUm(l,tg)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.1" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/ML/.ipynb_checkpoints/test_ml-checkpoint.ipynb b/ML/.ipynb_checkpoints/test_ml-checkpoint.ipynb new file mode 100644 index 0000000..363fcab --- /dev/null +++ b/ML/.ipynb_checkpoints/test_ml-checkpoint.ipynb @@ -0,0 +1,6 @@ +{ + "cells": [], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/ML/test_ml.ipynb b/ML/test_ml.ipynb new file mode 100644 index 0000000..8d1aa48 --- /dev/null +++ b/ML/test_ml.ipynb @@ -0,0 +1,409 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 2, + "id": "39c424d4-81d2-4da6-8a23-04715b9dfe73", + "metadata": {}, + "outputs": [], + "source": [ + "speed = [99,86,87,88,111,86,103,87,94,78,77,85,86]" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "d5240e04-e8bf-4fc3-9c41-97ec78acafa6", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mean of the speed is 89.76923076923077\n" + ] + } + ], + "source": [ + "import numpy as np\n", + "\n", + "x = np.mean(speed)\n", + "\n", + "print(\"Mean of the speed is\", x)\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "09e6a59a-4911-4b0d-a8d2-e9fd83f0077b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Median of the speed is 87.0\n" + ] + } + ], + "source": [ + "#Median\n", + "\n", + "y = np.median(speed)\n", + "\n", + "print(\"Median of the speed is\", y)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "3b4a4739-d20a-450c-b1ce-2ad90933b174", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mode of the numbers is ModeResult(mode=array([86]), count=array([3]))\n" + ] + } + ], + "source": [ + "# mode\n", + "# the values that are appears more number of times\n", + "from scipy import stats\n", + "\n", + "\n", + "z = stats.mode(speed)\n", + "\n", + "print(\"mode of the numbers is\", z)" + ] + }, + { + "cell_type": "markdown", + "id": "2b0953e1-3d09-4198-abb9-4b5f310670fe", + "metadata": {}, + "source": [ + "Standard deviation\n", + "\n", + "sd is a number that describes how spread out the values are.\n", + "\n", + "A low standard deviation means that th most of the numbers are close to the mean (avg) value\n", + "\n", + "A high standard deviation means that the valuess are spread out over a wide range" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "eb93ef79-f730-4679-940b-f747a4f54df1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "standard deviation of speed of cars is 9.258292301032677\n" + ] + } + ], + "source": [ + "speed\n", + "\n", + "sd = np.std(speed)\n", + "print(\"standard deviation of speed of cars is\", sd)" + ] + }, + { + "cell_type": "markdown", + "id": "14d1f53f-e80e-4d73-85a3-b340f2bc0f90", + "metadata": {}, + "source": [ + "Variance\n", + "\n", + "Variance is another number that indicates how spread out the values are.\n", + "\n", + "In fact, if you take the square root of the variance, you gte the standard deviation!\n", + "Or the other way around\n", + "if. you multiply the standard deviation by itself, you get the variance!\n", + "\n", + "to calculate the variance you have to do as follows" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "8cdd60df-2157-438a-994e-09e1bb3ba0c4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "variance of speed of cars is 85.71597633136093\n" + ] + } + ], + "source": [ + "x = np.var(speed)\n", + "\n", + "print(\"variance of speed of cars is\", x)" + ] + }, + { + "cell_type": "markdown", + "id": "6c05c2ea-793d-4689-ad3f-c7d991363918", + "metadata": {}, + "source": [ + "Percentile\n", + "\n", + "Percentiles are used in statistics to give you the number that scribes\n", + "the values that a given percent of the values are lower than" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "361d8891-bbe8-4873-8c5e-c84bda358eb1", + "metadata": {}, + "outputs": [], + "source": [ + "ages = [5,31,43,48,50,41,7,11,15,39,80,82,32,2,8,6,25,36,27,61,31]" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "c50b841e-93bf-4c83-8798-842783e794cf", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "75th percentaile of ages is 43.0\n" + ] + } + ], + "source": [ + "ages\n", + "x = np.percentile(ages,75)\n", + "print(\"75th percentaile of ages is\", x)" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "4614238e-a138-4b06-be48-a56d97109315", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0.25693562 1.88360614 3.74815805 0.22441519 2.89721867 2.42257601\n", + " 1.4027281 3.82776686 4.25485369 1.06743161 0.14639262 2.36409342\n", + " 2.83416846 0.02718292 3.38988053 0.68776825 2.4835643 1.41616999\n", + " 0.02148168 0.35378003 0.69718049 4.15257817 4.00580517 2.52152922\n", + " 2.93299295 1.41059357 3.76081024 2.37743421 2.7946524 1.62413627\n", + " 4.05801073 0.08926419 2.25662045 2.96487237 0.92865141 0.48107178\n", + " 4.59349052 1.84182245 3.84028347 0.42913201 1.5800562 2.71431086\n", + " 1.22547108 2.04302336 0.80201508 3.92707369 0.28856735 2.87023194\n", + " 1.59515045 1.77958231 0.57015682 4.33221093 4.69750411 3.46863655\n", + " 4.43493923 3.36606561 0.11580425 1.67814825 3.55991927 1.30133378\n", + " 3.70322249 4.47495169 0.41239236 1.49337976 4.26594765 3.38202161\n", + " 1.3075207 3.66487056 3.00481039 3.40482158 2.00226627 3.02806605\n", + " 2.62558626 3.55292547 1.82225588 2.42019146 0.3853975 1.07263847\n", + " 2.64872425 3.92925846 4.9787802 2.36777345 2.82083545 1.60746263\n", + " 0.46815085 2.40806441 1.07730951 4.73650698 0.54841932 4.83190234\n", + " 0.42987996 3.93867397 2.38551031 0.82865684 1.01755132 3.54138935\n", + " 3.50990853 3.68598844 2.59704735 4.60626891 3.91532135 0.95524025\n", + " 3.55621246 4.87604455 4.35070753 4.51226109 1.99629578 4.43290052\n", + " 1.15738153 2.58744178 4.08985829 3.88737161 1.35128586 2.3825869\n", + " 3.65439788 3.0722588 0.88991502 0.3409112 2.71598243 0.01457549\n", + " 2.85932507 2.33121488 4.63243229 0.63812945 4.25561007 1.88884002\n", + " 2.19456333 2.35292761 3.03252524 2.77813655 2.48736144 2.84135383\n", + " 3.77376049 1.61142825 3.59470526 3.03245026 0.27406066 0.03549873\n", + " 4.92893987 0.3529784 0.06393865 1.65432306 4.93506046 0.21509757\n", + " 0.83665759 4.50984465 1.38566549 1.35407243 1.35916265 3.26671944\n", + " 4.02119226 3.48240485 2.18327052 1.54097476 0.60139707 0.45838235\n", + " 4.98260637 4.71192262 1.07581568 1.26916685 0.13099547 0.94480837\n", + " 3.8186142 2.30353368 0.9603667 1.22707574 3.2884331 2.1125411\n", + " 3.40173672 3.16598903 2.07885429 3.35522175 3.14803512 0.9977724\n", + " 0.41425514 2.14441058 2.26315456 4.56935716 1.05898582 4.71078522\n", + " 2.61414637 2.06725573 0.67629288 4.89308458 3.94747402 4.58943237\n", + " 2.49123307 0.57808394 4.6685098 2.50821825 4.58770777 2.1361246\n", + " 0.24280593 4.30831691 2.81473736 2.92336348 0.26217991 1.97964061\n", + " 1.73689896 0.99571151 4.51285376 1.12824434 1.45268417 4.00483688\n", + " 1.16084921 3.73783488 1.1997375 1.44413612 1.51934621 1.3630307\n", + " 4.33244623 0.72965204 1.25309971 2.48291799 3.77840877 1.16822768\n", + " 3.76226992 3.19884543 4.94994101 0.09357882 2.41213801 4.94187177\n", + " 2.76052769 2.05021711 2.95199524 1.213877 4.73592522 1.49020893\n", + " 0.27535151 4.52418955 4.33308499 4.87217207 0.2034202 1.12901273\n", + " 2.33577346 3.43608049 3.07705389 0.08720636 2.76259113 4.31134249\n", + " 3.65980865 3.7322099 2.29509227 2.71721541 3.93435657 3.78013367\n", + " 1.07277338 1.30062459 3.67410008 1.91655967]\n" + ] + } + ], + "source": [ + "x = np.random.uniform(0.0,5.0,250)\n", + "print(x)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "10db940e-ac32-4588-b1b5-afdeb4b252dd", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAL6ElEQVR4nO3dX4hehZnH8e9vo4vFtlRxEoZGd/YilJVCdRncQmBhay1ulSY3LhVaciHkpguWFkq6d73L3pTe7E1oZWdpt13BikGh25AqRXDVidVWG7spJeuKwZnaLTU3u2ifvZgTSOOk82bm/TNP5vuB4fyZ989z0Hw5nHnPTKoKSVI/fzLrASRJm2PAJakpAy5JTRlwSWrKgEtSU9dM881uuummWlhYmOZbSlJ7p06d+nVVzV26f6oBX1hYYHl5eZpvKUntJfmv9fZ7CUWSmjLgktSUAZekpgy4JDVlwCWpKQMuSU0ZcElqyoBLUlMGXJKamuqdmNJGFo48Mes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NVnauqF4b1t4HTrN3pe1WrNeeHzWuHr+17RjUmSfYC9wDfnPUs3W33gK93u/5V/w97J0uyANwOPDvjUaZiuJTwIrACnKiqnXDc3wC+Avx+xnNMUwE/THJq+PUiY7HdAz7S7fq6OiR5P/AI8MWq+t2s55mGqnq3qm5j7U7mO5Jc1ZfNktwLrFTVqVnPMmX7q+ovWfvtrV8YLpVu2XYPuLfr7xDDNeBHgO9U1fdnPc+0VdVvgaeAu2c7ycTtBz4zXBP+HvCJJN+e7UiTV1VvDMsV4FHWLg9v2XYPuLfr7wDDD/O+BZyuqq/Pep5pSTKX5EPD+vuATwKvznSoCauqr1bV3qpaYO3f84+q6nMzHmuiklw//HCeJNcDnwLG8imzbR3wqnoHuHC7/mng4Qnerr8tJPku8AzwkSSvJ3lg1jNNwX7g86ydjb04fH161kNNwTzwZJKfsnaycqKqdsTH6naYPcDTSV4CngOeqKofjOOFt/XHCCVJl7etz8AlSZdnwCWpKQMuSU0ZcElqyoBLUlMGXJKaMuCS1NT/A0ufxQ2C4vN2AAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "plt.hist(x,5)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "id": "3f678310-7289-4f90-bb0e-2007ad6f59ef", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD4CAYAAADsKpHdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAVO0lEQVR4nO3df4xd5X3n8fdnccrSJKYEJsi1zZoGJxJYralHXiSUiF3a4qZRTCrYGmkD1VpygoiUKJU20P0j2ZUshd1NWLG7ceXUCEgTwAtBWFto40JaFMlAx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+l86lrt8FbqiqF/rasVmU5EPAz4F7q2pVv/szF5IsAZZU1bNJ3g3sBq49U3/PSQK8s6p+nuQdwHeAT1fVU33u2qxL8llgEFhcVR/pd39mW5JXgMGqmpUP4i20I4QF9xUZVfUk8Hq/+zGXqupgVT3b5g8D++l8Gv6MVB0/b0/f0aYz/p1ekmXAHwB/3u++nCkWWiD0+oqMM/YPhSDJCuBy4Ok+d2VWtaGTPcAhYGdVndH72/wX4N8Cv+xzP+ZSAd9Ksrt9lc+MWmiBcFJfkaEzQ5J3AQ8Bn6mqn/W7P7Opqo5V1Wo6n/Jfm+SMHh5M8hHgUFXt7ndf5tiVVfXbdL4Z+pY2JDxjFlog+BUZC0QbS38I+HpVfbPf/ZkrVfW/gb8F1vW3J7PuSuCjbUz9fuBfJvmL/nZp9lXVgfZ4CHiYzjD4jFlogeBXZCwA7STrNmB/VX253/2ZbUkGkvxamz8H+B3gB33t1CyrqtuqallVraDz//iJqvrXfe7WrEryznaRBEneCfweMKNXDy6oQKiqo8DYV2TsB7bP8ldk9F2S+4BdwAeSjCTZ2O8+zYErgY/Tede4p00f7nenZtES4NtJnqPzpmdnVS2IyzAXmAuB7yT5PvAM8JdV9Vcz+QIL6rJTSdKJLagjBEnSiRkIkiTAQJAkNQaCJAkwECRJjYEgSQIMBElS8/8A8p+i9RaLzjMAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "y = np.random.uniform(0.0,5.0,1000000)\n", + "plt.hist(y,50)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "id": "8811b5d4-b8de-466b-af88-d8af9813c607", + "metadata": {}, + "source": [ + "Scatterplot" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "4e49bc4d-f143-46ec-a6c8-4eff145bb3b1", + "metadata": {}, + "outputs": [], + "source": [ + "x = [5,7,8,7,2,17,2,9,4,11,12,9,6]\n", + "\n", + "y = [99,86,87,88,111,86,103,87,94,78,77,85,86]" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "id": "95136001-5b9d-4747-9e83-7720ecc3d6bd", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAThklEQVR4nO3df2zc933f8edrktbQ6QrZMe1ZsjM5gcMmcRor4Iw0RowsTsHAC2LFgAEXSyCgRt0ObvNjmzYLBeZiQBd1cpf9KJZOTTxrW+bAsFXZWLAorlwkQLEkoC0nkuNxTudUEaVZbF2m20K4kvLeHzwZFHW0RN5R37svnw+AuLvP93vHFyTei8fP53NkqgpJUrv8taYDSJL6z3KXpBay3CWphSx3SWohy12SWmh90wEArrzyytqyZUvTMSRpqDzzzDN/VlWj3Y4NRLlv2bKFycnJpmNI0lBJ8qdLHXNaRpJayHKXpBay3CWphSx3SWohy12SWmggdsus1P5D0+w+MMXx2Tk2bRxhx8QY27ZubjqWJDVuaMt9/6Fpdu47zNypMwBMz86xc99hAAte0po3tNMyuw9MvVbsZ82dOsPuA1MNJZKkwTG05X58dm5Z45K0lgxtuW/aOLKscUlaS4a23HdMjDGyYd05YyMb1rFjYqyhRJI0OC5Y7kkeSnIyyZEFY3cleT7JT5KMLzp/Z5LvJ5lKMrEaoWF+0fSzd76LzRtHCLB54wifvfNdLqZKEhe3W+Zh4HeB/7hg7AhwJ/DvF56Y5B3A3cA7gU3AHyZ5W1Wdu/LZJ9u2brbMJamLC75yr6pvAK8sGnuhqrptS7kD+HJVvVpVLwHfB27uS1JJ0kXr95z7ZuCHC24f64ydJ8m9SSaTTM7MzPQ5hiStbf0u93QZq24nVtWeqhqvqvHR0a6/a16StEL9LvdjwHULbl8LHO/z55AkXUC/y/1J4O4kP5Xke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alvJzkGoDO5cD9yJ5kO/AR4O/V4L3J5a3MfxP/Tud5cy3wbJK/2Wiqcx0D9tW8bzP/U3lji76vZ2jLvfPd8ovAC1X1L5vOs1hV7ayqa6tqC/MLgE9X1UC94qyq/w38MMlYZ+g24HsNRurmKPDeJJd1/s9vY8AWfRd4Etjeub4deKLBLOdJ8mHgnwAfraofN51nsao6XFVXVdWWzvPmGPCeztfpoNgPfBAgyduAv87g/IbIcwxtuTP/yvgTzL8ifq7zcXvToYbQrwNfSvJd4Cbgnzcb51ydnyoeA54FDjP/Ndv427+TPAL8d2AsybEk9wC7gF9I8iLzuz12DVi+3wX+BvBU5/nye03le52MA2OJfA8Bb+lsj/wysH0AfwIC/PUDktRKw/zKXZK0BMtdklrIcpekFrLcJamFLHdJaiHLXZJayHKXpBb6/3N3iKIwQ7c2AAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "import matplotlib.pyplot as plt\n", + "\n", + "plt.scatter(x,y)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "id": "6c43d696-3f17-43f1-8b6a-432a4e665137", + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAABCH0lEQVR4nO2df5Bc1XXnv6d7nqQe2VaP4nECY4QwSaQylqWBSSxHtdkIb8AJmEzxwwoF2WzWG/ZXZY2WnaxIXCClqEW1ioO2KlXZIrFjb6EQgYQnYHkDrkDWu9jClhgJWba0XgJINCTIloYYTQu1Zs7+0XNbt1/fe9+970f3ez33U2VLtLrfu/36vXPPPfec7yFmhsfj8XiKR6nXA/B4PB5PPLwB93g8noLiDbjH4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At5n5mSzO1ZcGnIjeA2AvgLuZ+R97PR5XmHmWmdcB+CCAnyeij/R4SNbYNrvOORuY+WoAvwLg3xPRL/Z6QA4MALgawJ8w8yiAswC29HZI8ZgP/9wE4PFej8UFIhoC8GsArgBwKYClRJRJu8m+M+DzceO9AHYx8xO9Hk8S5pe+fwvgk70diROFb3bNzG/M//kWgK8A+PnejsiJ1wG8Lq3a9qBp0IvIrwB4kZn/odcDceSfAXiFmU8xcwPAEwB+IYsT9ZUBn98A/AKA7zPzH/V6PHEgomEiqs7/vYLmzXCsp4NyoOjNrolo6fwGOOZDD9cB+G5vR2UPM/89gJNEJNrPfwJAYTbxQ9yOgoVP5jkBYD0RDc7bpE+guR+XOv3W1HgDgN8AcGQ+hgwAv8fMX+vdkJy5BMCX53ffSwAeY+bCpeIVmJ8E8JXmc4cBAH/BzH/d2yE58zsAds2HIP4OwG/1eDzOENEggF8G8K97PRZXmPkFItoD4EUAFwBMIaOy+r5KI/R4PJ6FRF+FUDwej2ch4Q24x+PxFBRvwD0ej6egeAPu8Xg8BcUbcI/H4yko3oB7PB5PQfEG3OPxeArK/we3s3hjneRAWwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "x = np.random.normal(5.0, 1.0, 1000)\n", + "y = np.random.normal(10.0, 2.0, 1000)\n", + "\n", + "plt.scatter(x, y)\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "182d4fda-1df8-4bbd-b5e5-ee96af7e85ff", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.12" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From ca38e531769c5957ed3c37a8e5d16ca0391d4a93 Mon Sep 17 00:00:00 2001 From: naveeng Date: Mon, 4 Sep 2023 15:45:53 -0400 Subject: [PATCH 49/53] test practice --- test.ipynb | 1639 +++++++++++++++++++++++++++++++++++++++++++++++++++ test2.ipynb | 207 +++++++ 2 files changed, 1846 insertions(+) diff --git a/test.ipynb b/test.ipynb index e69de29..12b8c93 100644 --- a/test.ipynb +++ b/test.ipynb @@ -0,0 +1,1639 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "ml = [1,2,3,2,3,4,5,6]" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "5" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nl = []\n", + "for i in ml:\n", + " if i not in nl:\n", + " nl.append(i)\n", + "\n", + "nl.sort()\n", + "nl[-2]" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "def rn(li):\n", + " nl=[]\n", + " for i in li:\n", + " if i not in nl:\n", + " nl.append(i)\n", + " \n", + " nl.sort()\n", + " return nl[-2]" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "jp-MarkdownHeadingCollapsed": true, + "tags": [] + }, + "source": [ + "if __name__ == '__main__':\n", + " n = int(input())\n", + " arr = map(int, input().split())\n", + " lst = list(arr)\n", + " score = list(lst)\n", + " print(score)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "list(set(ml)).sort()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "ename": "SyntaxError", + "evalue": "invalid syntax (2420166799.py, line 7)", + "output_type": "error", + "traceback": [ + "\u001b[0;36m Input \u001b[0;32mIn [8]\u001b[0;36m\u001b[0m\n\u001b[0;31m score =\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n" + ] + } + ], + "source": [ + "if __name__ == '__main__':\n", + " num = []\n", + " arr = []\n", + " ls = int(input())\n", + " for _ in range(ls):\n", + " name = input()\n", + " score = " + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter a number 44\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Not weired\n" + ] + } + ], + "source": [ + "if __name__ == '__main__':\n", + " n = int(input(\"Enter a number\").strip())\n", + " if n % 2 != 0:\n", + " print(\"Weired\")\n", + " elif n in range(2,6):\n", + " print(\"Not weired\")\n", + " elif n in range (6,21):\n", + " print(\"weired\")\n", + " else:\n", + " print(\"Not weired\")" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " 3,4,5\n" + ] + }, + { + "ename": "ValueError", + "evalue": "invalid literal for int() with base 10: '3,4,5'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "Input \u001b[0;32mIn [10]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNO\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;18m__name__\u001b[39m \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m__main__\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[0;32m----> 7\u001b[0m t \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mint\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstrip\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m _ \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m (\u001b[38;5;28mint\u001b[39m(\u001b[38;5;28minput\u001b[39m())):\n\u001b[1;32m 10\u001b[0m first_multiple_input \u001b[38;5;241m=\u001b[39m \u001b[38;5;28minput\u001b[39m()\u001b[38;5;241m.\u001b[39mrstrip()\u001b[38;5;241m.\u001b[39msplit()\n", + "\u001b[0;31mValueError\u001b[0m: invalid literal for int() with base 10: '3,4,5'" + ] + } + ], + "source": [ + "def solve(a,b,x,y):\n", + " if math.gcd(a,b) == math.gcd(x,y):\n", + " return \"YES\"\n", + " return \"NO\"\n", + "\n", + "if __name__ == '__main__':\n", + " t = int(input().strip())\n", + "\n", + " for _ in range (int(input())):\n", + " first_multiple_input = input().rstrip().split()\n", + " a = int(first_multiple_input[0])\n", + " b = int(first_multiple_input[1])\n", + " x = int(first_multiple_input[2])\n", + " y = int(first_multiple_input[3])\n", + "\n", + " result = solve(a,b,x,y)" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "invalid literal for int() with base 10: ''", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[43], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39m__name__\u001b[39m \u001b[39m==\u001b[39m \u001b[39m'\u001b[39m\u001b[39m__main__\u001b[39m\u001b[39m'\u001b[39m:\n\u001b[0;32m----> 2\u001b[0m x \u001b[39m=\u001b[39m \u001b[39mint\u001b[39;49m(\u001b[39minput\u001b[39;49m())\n\u001b[1;32m 3\u001b[0m y \u001b[39m=\u001b[39m \u001b[39mint\u001b[39m(\u001b[39minput\u001b[39m())\n\u001b[1;32m 4\u001b[0m z \u001b[39m=\u001b[39m \u001b[39mint\u001b[39m(\u001b[39minput\u001b[39m())\n", + "\u001b[0;31mValueError\u001b[0m: invalid literal for int() with base 10: ''" + ] + } + ], + "source": [ + "if __name__ == '__main__':\n", + " x = int(input())\n", + " y = int(input())\n", + " z = int(input())\n", + " n = int(input())\n", + " l =[]\n", + " for i in range(x+1):\n", + " for j in range(y+1):\n", + " for k in range(z+1):\n", + " if i + j + k == n:\n", + " continue\n", + " l.append([i,j,k])\n", + " \n", + " print(l)" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [], + "source": [ + "def my_function():\n", + " print(\"Hello from a function\")" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello from a function\n" + ] + } + ], + "source": [ + "my_function()" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": {}, + "outputs": [], + "source": [ + "def my_fun_par(fname):\n", + " print(fname + \" Refsnes\")" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Naveen Refsnes\n" + ] + } + ], + "source": [ + "my_fun_par(\"Naveen\")" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reddy Refsnes\n" + ] + } + ], + "source": [ + "my_fun_par(\"Reddy\")" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [], + "source": [ + "def my_fun(fn,ln):\n", + " ft = fn + ln\n", + " print(ft)\n", + "\n", + " # return fn" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "my_fun(\"Naveen\",\"Reddy\")" + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": {}, + "outputs": [], + "source": [ + "def fnf(**kid):\n", + " print(\"his last name is \" + kid[\"lname\"])" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "his last name is Ganta\n" + ] + } + ], + "source": [ + "fnf(fname= \"Tobiad\", lname=\"Ganta\")" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [], + "source": [ + "def myf(food):\n", + " for x in food:\n", + " print(x)" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "apple\n", + "banana\n", + "cherry\n" + ] + } + ], + "source": [ + "fr = ['apple','banana','cherry']\n", + "myf(fr)" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [], + "source": [ + "s = 'AABCAAADA'\n", + "k = 3" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [], + "source": [ + "n = len(s)/3" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3.0" + ] + }, + "execution_count": 67, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "n" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "metadata": {}, + "outputs": [], + "source": [ + "word = s[0:k]" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'AAB'" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "word" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": {}, + "outputs": [], + "source": [ + "string = s[k:]" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'CAAADA'" + ] + }, + "execution_count": 71, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "string" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": {}, + "outputs": [], + "source": [ + "while s:\n", + " word = s[0:k]\n", + " s= s[k:]\n", + "\n", + " print(''.join(help(word)))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": {}, + "outputs": [], + "source": [ + "def merge_tl(s,k):\n", + " n = len(s)\n", + "\n", + " def help(items):\n", + " seen = set()\n", + " for i in items:\n", + " if i not in seen:\n", + " yield i\n", + " seen.add(i)\n", + " while s:\n", + " word = s[0:k]\n", + " s= s[k:]\n", + "\n", + " print(''.join(help(word)))\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "None\n" + ] + } + ], + "source": [ + "print(merge_tl(s,k))" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "None\n" + ] + } + ], + "source": [ + "def merge_the_tools(string, k):\n", + " n = len(string)\n", + "\n", + " def help_fun(items):\n", + " seen = set()\n", + " for i in items:\n", + " if i not in seen:\n", + " yield i\n", + " seen.add(i)\n", + "\n", + " while string:\n", + " word = string[0:k]\n", + " string = string[k:]\n", + " \n", + " print (''.join(help_fun(word)))\n", + "\n", + "\n", + "if __name__ == '__main__':\n", + " string, k = s,k\n", + " merge_the_tools(string, k)" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "abcd\n", + "efgh\n", + "ijkl\n", + "mn\n" + ] + } + ], + "source": [ + "def wrap(st,n):\n", + " con = list(st)\n", + "\n", + " ls=[]\n", + " l=\"\"\n", + " for i in con:\n", + " if len(l) < n:\n", + " l+=i\n", + " \n", + " else:\n", + " ls.append(l)\n", + " l = i\n", + "\n", + " ls.append(l)\n", + "\n", + " return \"\\n\".join(ls)\n", + "\n", + "\n", + "\n", + "if __name__ == '__main__':\n", + " st, n = input(),int(input())\n", + " rs = wrap(st,n)\n", + " print(rs)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'g'" + ] + }, + "execution_count": 91, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "min('stringsjhs')" + ] + }, + { + "cell_type": "code", + "execution_count": 101, + "metadata": {}, + "outputs": [], + "source": [ + "import re\n", + "t = \"The rain 59 in Spain\"\n", + "x = re.search(\"^The.*Spains$\",t)" + ] + }, + { + "cell_type": "code", + "execution_count": 98, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "None\n" + ] + } + ], + "source": [ + "print(x)" + ] + }, + { + "cell_type": "code", + "execution_count": 100, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['i', 'i', 'i']\n" + ] + } + ], + "source": [ + "v = re.findall(\"[i]\",t)\n", + "print(v)" + ] + }, + { + "cell_type": "code", + "execution_count": 102, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['5', '9']\n" + ] + } + ], + "source": [ + "n= re.findall(\"\\d\",t)\n", + "print(n)" + ] + }, + { + "cell_type": "code", + "execution_count": 103, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['rain']" + ] + }, + "execution_count": 103, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "re.findall(\"r..n\",t)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "def swapList(newList):\n", + " n = len(newList)\n", + "\n", + " temp = newList[0]\n", + " newList[0] = newList[n-1]\n", + " newList[n-1] = temp\n", + "\n", + " return newList" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 3, 4, 1]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l =[1,2,3,4,5]\n", + "swapList(l)" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "def swapPosition(list,pos1,pos2):\n", + "\n", + " list[pos1],list[pos2] = list[pos2],list[pos1]\n", + " \n", + " return list" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 4, 3, 1]" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "swapPosition(l,2,3)" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "def swapEle(list,e1,e2):\n", + "\n", + " \n", + " for sub in list:\n", + " temp = '-'\n", + " sub.replace(e1,temp).replace(e2,e1).replace(temp,e2)\n", + "\n", + " return sub\n" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Geeks'" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sl = ['Gfg', 'is', 'best', 'for', 'Geeks']\n", + "swapEle(sl,'e','G')" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "ls = \", \".join(sl)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Gfg, is, best, for, Geeks\n" + ] + } + ], + "source": [ + "print(ls)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['efg', 'is', 'bGst', 'for', 'eGGks']\n" + ] + } + ], + "source": [ + "res = ls.replace('G','-').replace('e','G').replace('-','e').split(', ')\n", + "print(res)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": {}, + "outputs": [], + "source": [ + "def max(a,b):\n", + " if a>b:\n", + " return a\n", + " else:\n", + " return (\"maximum of numbers is \" + str(b))" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'maximum of numbers is 4'" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "max(2,4)" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "min(3,1)" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 4, 3, 1]" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": {}, + "outputs": [], + "source": [ + "def elemList(l,n):\n", + " if n in l:\n", + " return \"exist\"\n", + " else:\n", + " return \"not present\"" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'exist'" + ] + }, + "execution_count": 40, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "elemList(l,5)" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 4, 3, 1]" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l" + ] + }, + { + "cell_type": "code", + "execution_count": 61, + "metadata": {}, + "outputs": [], + "source": [ + "def reveseL(l):\n", + " nl = []\n", + " ln = len(l)-1\n", + " for i in l:\n", + " nl.insert(0,i)\n", + "\n", + " return nl" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[5, 2, 4, 3, 1]\n", + "[1, 3, 4, 2, 5]\n" + ] + } + ], + "source": [ + "print(l)\n", + "print(reveseL(l))" + ] + }, + { + "cell_type": "code", + "execution_count": 67, + "metadata": {}, + "outputs": [], + "source": [ + "l\n", + "m = l[:]" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[5, 2, 4, 3, 1]" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "m" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": {}, + "outputs": [], + "source": [ + "def counl(l,e):\n", + " c = 0\n", + " for i in l:\n", + " if i == e:\n", + " c += 1\n", + " return c" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 74, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ls = [1,2,3,2,1,3,5,3,4,2,1,2]\n", + "counl(ls,2)" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [], + "source": [ + "def sumav(l):\n", + " sc = 0\n", + " for i in l:\n", + " sc += 1\n", + "\n", + " sm = sum(l)\n", + " avg = sm/len(l)\n", + "\n", + " return sm,avg" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'sumav' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[3], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m ll \u001b[39m=\u001b[39m [\u001b[39m1\u001b[39m,\u001b[39m2\u001b[39m,\u001b[39m3\u001b[39m]\n\u001b[0;32m----> 2\u001b[0m sumav(ll)\n", + "\u001b[0;31mNameError\u001b[0m: name 'sumav' is not defined" + ] + } + ], + "source": [ + "ll = [1,2,3]\n", + "sumav(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "metadata": {}, + "outputs": [], + "source": [ + "def sumnu(l):\n", + " res = []\n", + " for i in l:\n", + " sum = 0\n", + " for d in str(i):\n", + " sum += int(d)\n", + " res.append(sum)\n", + " \n", + " return res" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[3, 13, 17, 7]" + ] + }, + "execution_count": 85, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "sn = [12,67,98,34]\n", + "sumnu(sn)" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "metadata": {}, + "outputs": [], + "source": [ + "def mulp(l):\n", + " rs = 1\n", + " for i in l:\n", + " rs *= i\n", + " \n", + " return rs" + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "6" + ] + }, + "execution_count": 89, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mulp(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 96, + "metadata": {}, + "outputs": [], + "source": [ + "def smaln(l):\n", + " sm = l[0]\n", + " for i in range(len(l)):\n", + " if l[i] < sm:\n", + " sm = l[i]\n", + " \n", + " return sm" + ] + }, + { + "cell_type": "code", + "execution_count": 97, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 97, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "smaln(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "def larg(l):\n", + " sm = l[0]\n", + " for i in range(len(l)):\n", + " if l[i]> sm:\n", + " sm = l[i]\n", + "\n", + " return sm" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "larg(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "def secondLar(l):\n", + " larg = l[0]\n", + " secondlarge = 0\n", + " for i in range(len(l)):\n", + " if l[i] > l[0]:\n", + " larg = l[i]\n", + " else:\n", + " secondlarge = max(secondlarge,l[i])\n", + " \n", + " return secondlarge" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# print(ll)\n", + "secondLar(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [], + "source": [ + "def evenl(l):\n", + " result = []\n", + " for n in l:\n", + " if n % 2 ==0 :\n", + " return n" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "evenl(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": {}, + "outputs": [], + "source": [ + "def oddl(l):\n", + " result = []\n", + " for i in l:\n", + " if i % 2 != 0:\n", + " result.append(i)\n", + "\n", + " return result" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[1, 3]" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "oddl(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [], + "source": [ + "def evelr(l):\n", + " for i in range(l):\n", + " if i % 2 == 0:\n", + " print(i)\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "2\n", + "4\n" + ] + } + ], + "source": [ + "evelr(5)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": {}, + "outputs": [], + "source": [ + "def eoc(l):\n", + " ec = 0\n", + " oc = 0\n", + " for i in l:\n", + " if i % 2== 0:\n", + " ec += 1\n", + " else:\n", + " oc += 1\n", + " \n", + " return ec,oc" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(1, 2)" + ] + }, + "execution_count": 47, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eoc(ll)" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": {}, + "outputs": [], + "source": [ + "def longest_Common_Prefix(str1):\n", + " \n", + " if not str1:\n", + " return \"\"\n", + "\n", + " short_str = min(str1,key=len)\n", + "\n", + " for i, char in enumerate(short_str):\n", + " for other in str1:\n", + " if other[i] != char:\n", + " return short_str[:i]\n", + "\n", + " return short_str " + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'abcdefgh'" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "la = [\"abcdefgh\",\"abcefgh\"]\n", + "min(la)\n", + "# print(longest_Common_Prefix([\"abcdefgh\",\"abcefgh\"]))\n", + "# print(longest_Common_Prefix([\"w3r\",\"w3resource\"]))\n", + "# print(longest_Common_Prefix([\"Python\",\"PHP\", \"Perl\"]))\n", + "# print(longest_Common_Prefix([\"Python\",\"PHP\", \"Java\"]))" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": {}, + "outputs": [], + "source": [ + "def longpre(a):\n", + " le = len(a)\n", + "\n", + " if le == 0 :\n", + " return \"\"\n", + " \n", + " if le == 1:\n", + " return a[0]\n", + " \n", + "\n", + " min_str = min(len(a[0]),len(a[le - 1]))\n", + " i = 0\n", + " while (i < min_str and a[0][i] == a[le - 1][i]):\n", + " i += 1\n", + "\n", + " pre = a[0][0:i]\n", + " return pre" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'abc'" + ] + }, + "execution_count": 76, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "longpre(la)" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "0\n", + "1\n", + "2\n", + "3\n", + "4\n", + "5\n", + "6\n", + "7\n", + "8\n", + "9\n" + ] + } + ], + "source": [ + "i = 0\n", + "while i < 10:\n", + " print(i)\n", + " i +=1" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "metadata": {}, + "outputs": [], + "source": [ + "def twoSUm(l,tg):\n", + " for i in range(len(l)):\n", + " for j in range(i+1,len(l)):\n", + " if l[j] == tg - l[i]:\n", + " return [i,j]" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[0, 3]" + ] + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "l = [1,2,3,4,5]\n", + "tg = 5\n", + "twoSUm(l,tg)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.4" + }, + "vscode": { + "interpreter": { + "hash": "949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/test2.ipynb b/test2.ipynb index e69de29..375a6eb 100644 --- a/test2.ipynb +++ b/test2.ipynb @@ -0,0 +1,207 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello\n" + ] + } + ], + "source": [ + "print(\"Hello\")" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "def greet():\n", + " print(\"Hello World\")" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello World\n" + ] + } + ], + "source": [ + "greet()" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "def add(x,y):\n", + " z = x+y\n", + " return z" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "result = add(2,3)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "5\n" + ] + } + ], + "source": [ + "print(result)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "class Test:\n", + "\n", + " def config(self):\n", + " print(\"i5\",\"16GB\",\"1TB\")" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "i5 16GB 1TB\n" + ] + } + ], + "source": [ + "com1 = Test()\n", + "\n", + "\n", + "com1.config()" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "class Computer:\n", + "\n", + " def __init__(self, cpu=\"I7\", ram=\"16GB\") -> None:\n", + " self.cpu = cpu\n", + " self.ram = ram\n", + " \n", + " def config(self):\n", + " print(\"Configuration is \", self.cpu, self.ram)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "com1 = Computer(\"I5\", \"12GB\")" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Configuration is I5 12GB\n" + ] + } + ], + "source": [ + "com1.config()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.1" + }, + "orig_nbformat": 4, + "vscode": { + "interpreter": { + "hash": "949777d72b0d2535278d3dc13498b2535136f6dfe0678499012e853ee9abcab1" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 7bbdf8a42cd62e26b111dfa3a79f4271ec29a6f8 Mon Sep 17 00:00:00 2001 From: naveeng Date: Mon, 11 Sep 2023 23:32:58 -0400 Subject: [PATCH 50/53] list doc --- EvenOddNumber.py => practise/EvenOddNumber.py | 0 FactorialNum.py => practise/FactorialNum.py | 0 HelloWorld.py => practise/HelloWorld.py | 0 InputExample.py => practise/InputExample.py | 0 .../commandLineArgExample.py | 0 .../commandLineArgExample2.py | 0 .../commandLineArgExampleSum.py | 0 .../delKeywordExample.py | 0 evalexample.py => practise/evalexample.py | 0 findsqrt.py => practise/findsqrt.py | 0 .../flowControlLoopExample.py | 0 .../flowControlTransferExample.py | 0 .../flowControlconditionExample.py | 0 for_loop.py => practise/for_loop.py | 0 hackerrank.py => practise/hackerrank.py | 0 .../if_else_Condition.py | 0 inputMul.py => practise/inputMul.py | 0 .../inputMultiplevalues.py | 0 inputoutstmt.py => practise/inputoutstmt.py | 0 .../largestOfThreeNumbers.py | 0 module.py => practise/module.py | 0 outputExample.py => practise/outputExample.py | 0 .../positiveNegativeNumber.py | 0 primeNumber.py => practise/primeNumber.py | 0 printTest.py => practise/printTest.py | 0 .../sumOfTwoNumbers.py | 0 swapVariables.py => practise/swapVariables.py | 0 test2.ipynb | 113 ++++++++++++++++-- 28 files changed, 106 insertions(+), 7 deletions(-) rename EvenOddNumber.py => practise/EvenOddNumber.py (100%) rename FactorialNum.py => practise/FactorialNum.py (100%) rename HelloWorld.py => practise/HelloWorld.py (100%) rename InputExample.py => practise/InputExample.py (100%) rename commandLineArgExample.py => practise/commandLineArgExample.py (100%) rename commandLineArgExample2.py => practise/commandLineArgExample2.py (100%) rename commandLineArgExampleSum.py => practise/commandLineArgExampleSum.py (100%) rename delKeywordExample.py => practise/delKeywordExample.py (100%) rename evalexample.py => practise/evalexample.py (100%) rename findsqrt.py => practise/findsqrt.py (100%) rename flowControlLoopExample.py => practise/flowControlLoopExample.py (100%) rename flowControlTransferExample.py => practise/flowControlTransferExample.py (100%) rename flowControlconditionExample.py => practise/flowControlconditionExample.py (100%) rename for_loop.py => practise/for_loop.py (100%) rename hackerrank.py => practise/hackerrank.py (100%) rename if_else_Condition.py => practise/if_else_Condition.py (100%) rename inputMul.py => practise/inputMul.py (100%) rename inputMultiplevalues.py => practise/inputMultiplevalues.py (100%) rename inputoutstmt.py => practise/inputoutstmt.py (100%) rename largestOfThreeNumbers.py => practise/largestOfThreeNumbers.py (100%) rename module.py => practise/module.py (100%) rename outputExample.py => practise/outputExample.py (100%) rename positiveNegativeNumber.py => practise/positiveNegativeNumber.py (100%) rename primeNumber.py => practise/primeNumber.py (100%) rename printTest.py => practise/printTest.py (100%) rename sumOfTwoNumbers.py => practise/sumOfTwoNumbers.py (100%) rename swapVariables.py => practise/swapVariables.py (100%) diff --git a/EvenOddNumber.py b/practise/EvenOddNumber.py similarity index 100% rename from EvenOddNumber.py rename to practise/EvenOddNumber.py diff --git a/FactorialNum.py b/practise/FactorialNum.py similarity index 100% rename from FactorialNum.py rename to practise/FactorialNum.py diff --git a/HelloWorld.py b/practise/HelloWorld.py similarity index 100% rename from HelloWorld.py rename to practise/HelloWorld.py diff --git a/InputExample.py b/practise/InputExample.py similarity index 100% rename from InputExample.py rename to practise/InputExample.py diff --git a/commandLineArgExample.py b/practise/commandLineArgExample.py similarity index 100% rename from commandLineArgExample.py rename to practise/commandLineArgExample.py diff --git a/commandLineArgExample2.py b/practise/commandLineArgExample2.py similarity index 100% rename from commandLineArgExample2.py rename to practise/commandLineArgExample2.py diff --git a/commandLineArgExampleSum.py b/practise/commandLineArgExampleSum.py similarity index 100% rename from commandLineArgExampleSum.py rename to practise/commandLineArgExampleSum.py diff --git a/delKeywordExample.py b/practise/delKeywordExample.py similarity index 100% rename from delKeywordExample.py rename to practise/delKeywordExample.py diff --git a/evalexample.py b/practise/evalexample.py similarity index 100% rename from evalexample.py rename to practise/evalexample.py diff --git a/findsqrt.py b/practise/findsqrt.py similarity index 100% rename from findsqrt.py rename to practise/findsqrt.py diff --git a/flowControlLoopExample.py b/practise/flowControlLoopExample.py similarity index 100% rename from flowControlLoopExample.py rename to practise/flowControlLoopExample.py diff --git a/flowControlTransferExample.py b/practise/flowControlTransferExample.py similarity index 100% rename from flowControlTransferExample.py rename to practise/flowControlTransferExample.py diff --git a/flowControlconditionExample.py b/practise/flowControlconditionExample.py similarity index 100% rename from flowControlconditionExample.py rename to practise/flowControlconditionExample.py diff --git a/for_loop.py b/practise/for_loop.py similarity index 100% rename from for_loop.py rename to practise/for_loop.py diff --git a/hackerrank.py b/practise/hackerrank.py similarity index 100% rename from hackerrank.py rename to practise/hackerrank.py diff --git a/if_else_Condition.py b/practise/if_else_Condition.py similarity index 100% rename from if_else_Condition.py rename to practise/if_else_Condition.py diff --git a/inputMul.py b/practise/inputMul.py similarity index 100% rename from inputMul.py rename to practise/inputMul.py diff --git a/inputMultiplevalues.py b/practise/inputMultiplevalues.py similarity index 100% rename from inputMultiplevalues.py rename to practise/inputMultiplevalues.py diff --git a/inputoutstmt.py b/practise/inputoutstmt.py similarity index 100% rename from inputoutstmt.py rename to practise/inputoutstmt.py diff --git a/largestOfThreeNumbers.py b/practise/largestOfThreeNumbers.py similarity index 100% rename from largestOfThreeNumbers.py rename to practise/largestOfThreeNumbers.py diff --git a/module.py b/practise/module.py similarity index 100% rename from module.py rename to practise/module.py diff --git a/outputExample.py b/practise/outputExample.py similarity index 100% rename from outputExample.py rename to practise/outputExample.py diff --git a/positiveNegativeNumber.py b/practise/positiveNegativeNumber.py similarity index 100% rename from positiveNegativeNumber.py rename to practise/positiveNegativeNumber.py diff --git a/primeNumber.py b/practise/primeNumber.py similarity index 100% rename from primeNumber.py rename to practise/primeNumber.py diff --git a/printTest.py b/practise/printTest.py similarity index 100% rename from printTest.py rename to practise/printTest.py diff --git a/sumOfTwoNumbers.py b/practise/sumOfTwoNumbers.py similarity index 100% rename from sumOfTwoNumbers.py rename to practise/sumOfTwoNumbers.py diff --git a/swapVariables.py b/practise/swapVariables.py similarity index 100% rename from swapVariables.py rename to practise/swapVariables.py diff --git a/test2.ipynb b/test2.ipynb index 375a6eb..bf9380b 100644 --- a/test2.ipynb +++ b/test2.ipynb @@ -157,24 +157,123 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello world\n" + ] + } + ], + "source": [ + "print(\"Hello world\")" + ] + }, + { + "cell_type": "code", + "execution_count": 2, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "def larg(lst):\n", + " if not lst:\n", + " return None\n", + " max_element = lst[0]\n", + " for i in lst:\n", + " if i > max_element:\n", + " max_element = i\n", + " return max_element\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "43\n" + ] + } + ], + "source": [ + "ml = [1,20,1,2,43]\n", + "print(larg(ml))" + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "def rem_dup(lst):\n", + " ul = []\n", + " for i in lst:\n", + " if i not in ul:\n", + " ul.append(i)\n", + " return ul" + ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 3, 33, 14]\n" + ] + } + ], + "source": [ + "ml = [1,3,3,33,14]\n", + "print(rem_dup(ml))" + ] + }, + { + "cell_type": "code", + "execution_count": 16, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "def rev_lst(lst):\n", + " rlst = []\n", + " for i in lst:\n", + " rlst = [i] + rlst\n", + " return lst\n" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "'>' not supported between instances of 'int' and 'list'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[17], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m ml \u001b[39m=\u001b[39m [\u001b[39m1\u001b[39m]\n\u001b[0;32m----> 2\u001b[0m \u001b[39mprint\u001b[39m(rev_lst(ml))\n", + "Cell \u001b[0;32mIn[16], line 4\u001b[0m, in \u001b[0;36mrev_lst\u001b[0;34m(lst)\u001b[0m\n\u001b[1;32m 2\u001b[0m lst \u001b[39m=\u001b[39m []\n\u001b[1;32m 3\u001b[0m i \u001b[39m=\u001b[39m \u001b[39m0\u001b[39m\n\u001b[0;32m----> 4\u001b[0m \u001b[39mwhile\u001b[39;00m i \u001b[39m>\u001b[39;49m lst:\n\u001b[1;32m 5\u001b[0m lst\u001b[39m.\u001b[39mappend(i)\n\u001b[1;32m 6\u001b[0m i \u001b[39m=\u001b[39m i \u001b[39m-\u001b[39m\u001b[39m1\u001b[39m\n", + "\u001b[0;31mTypeError\u001b[0m: '>' not supported between instances of 'int' and 'list'" + ] + } + ], + "source": [ + "ml = [1]\n", + "print(rev_lst(ml))" + ] } ], "metadata": { @@ -193,7 +292,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.1" + "version": "3.11.4" }, "orig_nbformat": 4, "vscode": { From 79c35f3410156bbba5a51ad1188a8e1d0acf6ed5 Mon Sep 17 00:00:00 2001 From: naveeng Date: Mon, 11 Sep 2023 23:33:30 -0400 Subject: [PATCH 51/53] list doc --- {practise => practice}/EvenOddNumber.py | 0 {practise => practice}/FactorialNum.py | 0 {practise => practice}/HelloWorld.py | 0 {practise => practice}/InputExample.py | 0 {practise => practice}/commandLineArgExample.py | 0 {practise => practice}/commandLineArgExample2.py | 0 {practise => practice}/commandLineArgExampleSum.py | 0 {practise => practice}/delKeywordExample.py | 0 {practise => practice}/evalexample.py | 0 {practise => practice}/findsqrt.py | 0 {practise => practice}/flowControlLoopExample.py | 0 {practise => practice}/flowControlTransferExample.py | 0 {practise => practice}/flowControlconditionExample.py | 0 {practise => practice}/for_loop.py | 0 {practise => practice}/hackerrank.py | 0 {practise => practice}/if_else_Condition.py | 0 {practise => practice}/inputMul.py | 0 {practise => practice}/inputMultiplevalues.py | 0 {practise => practice}/inputoutstmt.py | 0 {practise => practice}/largestOfThreeNumbers.py | 0 {practise => practice}/module.py | 0 {practise => practice}/outputExample.py | 0 {practise => practice}/positiveNegativeNumber.py | 0 {practise => practice}/primeNumber.py | 0 {practise => practice}/printTest.py | 0 {practise => practice}/sumOfTwoNumbers.py | 0 {practise => practice}/swapVariables.py | 0 27 files changed, 0 insertions(+), 0 deletions(-) rename {practise => practice}/EvenOddNumber.py (100%) rename {practise => practice}/FactorialNum.py (100%) rename {practise => practice}/HelloWorld.py (100%) rename {practise => practice}/InputExample.py (100%) rename {practise => practice}/commandLineArgExample.py (100%) rename {practise => practice}/commandLineArgExample2.py (100%) rename {practise => practice}/commandLineArgExampleSum.py (100%) rename {practise => practice}/delKeywordExample.py (100%) rename {practise => practice}/evalexample.py (100%) rename {practise => practice}/findsqrt.py (100%) rename {practise => practice}/flowControlLoopExample.py (100%) rename {practise => practice}/flowControlTransferExample.py (100%) rename {practise => practice}/flowControlconditionExample.py (100%) rename {practise => practice}/for_loop.py (100%) rename {practise => practice}/hackerrank.py (100%) rename {practise => practice}/if_else_Condition.py (100%) rename {practise => practice}/inputMul.py (100%) rename {practise => practice}/inputMultiplevalues.py (100%) rename {practise => practice}/inputoutstmt.py (100%) rename {practise => practice}/largestOfThreeNumbers.py (100%) rename {practise => practice}/module.py (100%) rename {practise => practice}/outputExample.py (100%) rename {practise => practice}/positiveNegativeNumber.py (100%) rename {practise => practice}/primeNumber.py (100%) rename {practise => practice}/printTest.py (100%) rename {practise => practice}/sumOfTwoNumbers.py (100%) rename {practise => practice}/swapVariables.py (100%) diff --git a/practise/EvenOddNumber.py b/practice/EvenOddNumber.py similarity index 100% rename from practise/EvenOddNumber.py rename to practice/EvenOddNumber.py diff --git a/practise/FactorialNum.py b/practice/FactorialNum.py similarity index 100% rename from practise/FactorialNum.py rename to practice/FactorialNum.py diff --git a/practise/HelloWorld.py b/practice/HelloWorld.py similarity index 100% rename from practise/HelloWorld.py rename to practice/HelloWorld.py diff --git a/practise/InputExample.py b/practice/InputExample.py similarity index 100% rename from practise/InputExample.py rename to practice/InputExample.py diff --git a/practise/commandLineArgExample.py b/practice/commandLineArgExample.py similarity index 100% rename from practise/commandLineArgExample.py rename to practice/commandLineArgExample.py diff --git a/practise/commandLineArgExample2.py b/practice/commandLineArgExample2.py similarity index 100% rename from practise/commandLineArgExample2.py rename to practice/commandLineArgExample2.py diff --git a/practise/commandLineArgExampleSum.py b/practice/commandLineArgExampleSum.py similarity index 100% rename from practise/commandLineArgExampleSum.py rename to practice/commandLineArgExampleSum.py diff --git a/practise/delKeywordExample.py b/practice/delKeywordExample.py similarity index 100% rename from practise/delKeywordExample.py rename to practice/delKeywordExample.py diff --git a/practise/evalexample.py b/practice/evalexample.py similarity index 100% rename from practise/evalexample.py rename to practice/evalexample.py diff --git a/practise/findsqrt.py b/practice/findsqrt.py similarity index 100% rename from practise/findsqrt.py rename to practice/findsqrt.py diff --git a/practise/flowControlLoopExample.py b/practice/flowControlLoopExample.py similarity index 100% rename from practise/flowControlLoopExample.py rename to practice/flowControlLoopExample.py diff --git a/practise/flowControlTransferExample.py b/practice/flowControlTransferExample.py similarity index 100% rename from practise/flowControlTransferExample.py rename to practice/flowControlTransferExample.py diff --git a/practise/flowControlconditionExample.py b/practice/flowControlconditionExample.py similarity index 100% rename from practise/flowControlconditionExample.py rename to practice/flowControlconditionExample.py diff --git a/practise/for_loop.py b/practice/for_loop.py similarity index 100% rename from practise/for_loop.py rename to practice/for_loop.py diff --git a/practise/hackerrank.py b/practice/hackerrank.py similarity index 100% rename from practise/hackerrank.py rename to practice/hackerrank.py diff --git a/practise/if_else_Condition.py b/practice/if_else_Condition.py similarity index 100% rename from practise/if_else_Condition.py rename to practice/if_else_Condition.py diff --git a/practise/inputMul.py b/practice/inputMul.py similarity index 100% rename from practise/inputMul.py rename to practice/inputMul.py diff --git a/practise/inputMultiplevalues.py b/practice/inputMultiplevalues.py similarity index 100% rename from practise/inputMultiplevalues.py rename to practice/inputMultiplevalues.py diff --git a/practise/inputoutstmt.py b/practice/inputoutstmt.py similarity index 100% rename from practise/inputoutstmt.py rename to practice/inputoutstmt.py diff --git a/practise/largestOfThreeNumbers.py b/practice/largestOfThreeNumbers.py similarity index 100% rename from practise/largestOfThreeNumbers.py rename to practice/largestOfThreeNumbers.py diff --git a/practise/module.py b/practice/module.py similarity index 100% rename from practise/module.py rename to practice/module.py diff --git a/practise/outputExample.py b/practice/outputExample.py similarity index 100% rename from practise/outputExample.py rename to practice/outputExample.py diff --git a/practise/positiveNegativeNumber.py b/practice/positiveNegativeNumber.py similarity index 100% rename from practise/positiveNegativeNumber.py rename to practice/positiveNegativeNumber.py diff --git a/practise/primeNumber.py b/practice/primeNumber.py similarity index 100% rename from practise/primeNumber.py rename to practice/primeNumber.py diff --git a/practise/printTest.py b/practice/printTest.py similarity index 100% rename from practise/printTest.py rename to practice/printTest.py diff --git a/practise/sumOfTwoNumbers.py b/practice/sumOfTwoNumbers.py similarity index 100% rename from practise/sumOfTwoNumbers.py rename to practice/sumOfTwoNumbers.py diff --git a/practise/swapVariables.py b/practice/swapVariables.py similarity index 100% rename from practise/swapVariables.py rename to practice/swapVariables.py From 00e5a2cd98874fce6388977482fbe0a9e005d95e Mon Sep 17 00:00:00 2001 From: naveeng Date: Mon, 11 Sep 2023 23:41:22 -0400 Subject: [PATCH 52/53] Day 1 of #100DaysOfCode --- 100Days_of_Python/Day1/main.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 100Days_of_Python/Day1/main.py diff --git a/100Days_of_Python/Day1/main.py b/100Days_of_Python/Day1/main.py new file mode 100644 index 0000000..47797e6 --- /dev/null +++ b/100Days_of_Python/Day1/main.py @@ -0,0 +1,17 @@ +# To print the data we can use the print function +print("hello world!") + + +# To make manipulate the code of the string we can use the "+" to add different strings together +print("Hello " + "world!") +print("Hello"+" "+"world!") + + +# To take the input from the user we use the input function +print("Hello" + input("what is your name?")) + +# we can use the variables to store the data and use these variables for our reference +name = input("what is your name?") +print("Hello " + name) + + From f967189dbf01dcda4db357f6ff6eb0a43b7562c5 Mon Sep 17 00:00:00 2001 From: naveeng Date: Mon, 11 Sep 2023 23:48:14 -0400 Subject: [PATCH 53/53] Day 1 of #100DaysOfCode --- 100Days_of_Python/Day1/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/100Days_of_Python/Day1/main.py b/100Days_of_Python/Day1/main.py index 47797e6..33a7ce2 100644 --- a/100Days_of_Python/Day1/main.py +++ b/100Days_of_Python/Day1/main.py @@ -14,4 +14,9 @@ name = input("what is your name?") print("Hello " + name) +# Project : Read different values from the user and merge it in to a string to create as a band +print("welcome to Band!") +city = input("what is the city are you from?") +pet = input("what pet do you have?") +print("Hello am from "+ city + " and my pet is" + pet)