diff options
| author | Rishi-k-s <rishikrishna.sr@gmail.com> | 2023-02-22 19:42:40 +0530 |
|---|---|---|
| committer | Rishi-k-s <rishikrishna.sr@gmail.com> | 2023-02-22 19:42:40 +0530 |
| commit | da9adf64f4c7a1d5f6fff559c47d62ede6d3255c (patch) | |
| tree | 001942a7e9f25cc858d754bc39a792760696653a | |
| parent | c42431b53b76c871e43da08bd1479c1249f68b65 (diff) | |
few edits
| -rw-r--r-- | .vscode/launch.json | 16 | ||||
| -rw-r--r-- | BoardPracticals/numbers.dat | bin | 0 -> 26 bytes | |||
| -rw-r--r-- | BoardPracticals/primeFromRange.py | 131 | ||||
| -rw-r--r-- | BoardPracticals/q6readbyline.py | 30 | ||||
| -rw-r--r-- | BoardPracticals/textfile.txt | 5 | ||||
| -rw-r--r-- | BoardPracticals/tf.txt | 3 | ||||
| -rw-r--r-- | numbers.dat | bin | 0 -> 22 bytes | |||
| -rw-r--r-- | one.csv | 2 | ||||
| -rw-r--r-- | prajunsirkailial.py | 0 |
9 files changed, 187 insertions, 0 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..948a236 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Python: Current File",
+ "type": "python",
+ "request": "launch",
+ "program": "${file}",
+ "console": "integratedTerminal",
+ "justMyCode": true
+ }
+ ]
+}
\ No newline at end of file diff --git a/BoardPracticals/numbers.dat b/BoardPracticals/numbers.dat Binary files differnew file mode 100644 index 0000000..53a2df9 --- /dev/null +++ b/BoardPracticals/numbers.dat diff --git a/BoardPracticals/primeFromRange.py b/BoardPracticals/primeFromRange.py new file mode 100644 index 0000000..975064e --- /dev/null +++ b/BoardPracticals/primeFromRange.py @@ -0,0 +1,131 @@ +# Write a program in python using function to print all the prime numbers within a range
+# (including upper and lower limit).
+
+
+def primeNos():
+ getRangeFront = int(input("Enter First number : "))
+ getRangeLast = int(input("Enter second number: "))
+ for getNum in range(getRangeFront,getRangeLast+1):
+ isPrime = True
+ for eachDigit in range(2,int(getNum)//2+1):
+ if (getNum % eachDigit == 0):
+ isPrime = False
+ break
+ if (isPrime == True):
+ print("{} is prime".format(getNum))
+
+# Write a python program to read an integer number from the user and to find the sum of
+# digits and reverse of a number using function.
+# getNum = int(input("Enter a number: "))
+# revNum = 0
+# sum1 = 0
+# while getNum > 0:
+# lastNum = getNum%10
+# sum1 = sum1 + lastNum
+# revNum = lastNum + revNum * 10
+# getNum = getNum // 10
+# print(revNum,sum1)
+
+#impliment stack using list
+
+# def pushOn(book):
+# mainStack.append(book)
+# def Pop():
+# if(bool(mainStack) == False):
+# print("There is no element to remove")
+# else:
+# print("{} is removed".format(mainStack.pop()))
+# mainStack = []
+
+# while True:
+# print("[1] Add book \n[2]Remove book")
+# getSelection = int(input("-->"))
+# if(getSelection == 1):
+# book = input("Enter book to add: ")
+# pushOn(book)
+# elif(getSelection == 2):
+# Pop()
+
+
+# getNum = int(input("Enter a number: "))
+# sum1 = 0
+# reverse = 0
+# while getNum > 0:
+# lastDig = getNum%10
+# reverse = lastDig + reverse * 10
+# sum1 = sum1 + lastDig
+# getNum //= 10
+# print("sum: ",sum1)
+# print("rev:" , reverse)
+
+# uppNum = int(input("Enter upper limit: "))
+# lowNum = int(input("Enter lower limit: "))
+# for p in range (uppNum,lowNum+1):
+# isPrime = True
+# for i in range (2,p//2+1):
+# if(p%i == 0):
+# isPrime = False
+# break
+# if(isPrime):
+# print(p,"is prime")
+# else:
+# print(p,"is not prime")
+
+# CREATE TABLE product (
+# PCode varchar(255),
+# Pname varchar (255),
+# Weight int,
+# Price int,
+# Qty int,
+# );
+
+# SELECT * FROm employees
+
+
+# import pickle
+
+# file_handlr_w = open("numbers.dat","wb")
+
+# getTimes = int(input("Enter number of times: "))
+# mainList = []
+# for i in range(getTimes):
+# getNum = int(input("Enter number: "))
+# mainList.append(getNum)
+# pickle.dump(mainList,file_handlr_w)
+# file_handlr_w.close()
+
+# file_handlr_r = open("numbers.dat","rb")
+# lines = pickle.load(file_handlr_r)
+# print(lines)
+# for eachList in lines:
+# print(eachList)
+
+
+
+import csv
+
+# file_handlr_w = open("one.csv","w",newline= "\n")
+# header = ["Roll No","Name","Marks"]
+# csvWriter = csv.writer(file_handlr_w)
+# csvWriter.writerow(header)
+# mainList = []
+# getTimes = int(input("Enter the number of times: "))
+
+# for i in range(getTimes):
+# getRool = int(input("ENter roll: "))
+# getName = input("Enter name: ")
+# getMarks = int(input("Enetr mrks: "))
+# userList = [getRool,getName,getMarks]
+# mainList.append(userList)
+# csvWriter.writerows(mainList)
+# file_handlr_w.close()
+# file_handlr_w = open("one.csv","r")
+# csvReader = csv.reader(file_handlr_w)
+# for i in csvReader:
+# for p in i:
+# print(p,end="\t")
+# print()
+
+l1 = [1,2,3,4,5]
+
+print(l1[:])
diff --git a/BoardPracticals/q6readbyline.py b/BoardPracticals/q6readbyline.py new file mode 100644 index 0000000..7a0ccb2 --- /dev/null +++ b/BoardPracticals/q6readbyline.py @@ -0,0 +1,30 @@ +file_handlr = open(r"D:\Dev\python\Testing_School\BoardPracticals\textfile.txt","r",newline="\n")
+getLines = file_handlr.readlines()
+LineWithA = []
+vov,coson,upp,low = 0,0,0,0
+vovels = "AEIOUaeiou"
+for eachLine in getLines:
+ wordList =eachLine.split()
+ for eachWord in wordList:
+ for eachLetter in wordList:
+ if eachLetter in vovels:
+ vov+=1
+ else:
+ coson+=1
+ if(eachLetter.isupper()):
+ upp+=1
+ elif(eachLetter.islower()):
+ low+=1
+print("vov: {} consosnts: {} upp: {} low: {}".format(vov,coson,upp,low))
+
+
+
+
+# import csv
+# file_handlr = open(r"D:\Dev\python\Testing_School\BoardPracticals\one.csv","w")
+# header = ["rollno","name","marks"]
+# lines = []
+# csvWriter = csv.writer()
+# getTimes = int(input("Enter the no. of times:"))
+# for i in range(getTimes):
+# roll_no =
diff --git a/BoardPracticals/textfile.txt b/BoardPracticals/textfile.txt new file mode 100644 index 0000000..065f0f4 --- /dev/null +++ b/BoardPracticals/textfile.txt @@ -0,0 +1,5 @@ +I am a Human Being
+I eat a lot of food
+i like food
+sreejesh is nice
+but abinesh is adipoli
\ No newline at end of file diff --git a/BoardPracticals/tf.txt b/BoardPracticals/tf.txt new file mode 100644 index 0000000..6bdd2af --- /dev/null +++ b/BoardPracticals/tf.txt @@ -0,0 +1,3 @@ +I am a Human Being
+I eat a lot of food
+but abinesh is adipoli
\ No newline at end of file diff --git a/numbers.dat b/numbers.dat Binary files differnew file mode 100644 index 0000000..1c6c4cc --- /dev/null +++ b/numbers.dat @@ -0,0 +1,2 @@ +Roll No,Name,Marks
+1,dfg,5
diff --git a/prajunsirkailial.py b/prajunsirkailial.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/prajunsirkailial.py |
