"Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values)." Code Answer's
You're definitely familiar with the best coding language TypeScript that developers use to develop their projects and they get all their queries like "Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values)." answered properly. Developers are finding an appropriate answer about Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values). related to the TypeScript coding language. By visiting this online portal developers get answers concerning TypeScript codes question like Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values).. Enter your desired code related query in the search bar and get every piece of information about TypeScript code related question on Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values)..
Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values).
##Write a Python program to create a file of elements of any data type (mixed data type, i.e. some elements maybe of type int, some elements of type float and some elements of type string). Split this file into three file containing elements of same data type (i.e. 1st file of integers only, 2nd file of float only and 3rd file of strings only). Take input from the user to create the file.
f = open('MixedFile.txt','w')
while True :
user = input("Enter Any Data Type Element :: ")
if user == 'end':
print('!!!!!!!! EXIT !!!!!!!!!!!!')
break
else :
f.write(user + '\n')
f.close()
f = open('MixedFile.txt')
a = []
a = f.read().split()
f.close()
fs = open ('StringFile.txt','w')
ff = open ('FloatFile.txt','w')
fn = open ('NumberFile.txt','w')
for i in a :
try:
int(i)
fn.write(i + '\n')
except:
try:
float(i)
ff.write(i + '\n')
except:
fs.write(i + '\n')
f.close()
fs.close()
fn.close()
ff.close()
print("reading................")
fs = open ('StringFile.txt','r')
ff = open ('FloatFile.txt','r')
fn = open ('NumberFile.txt','r')
print(fs.read())
print(fn.read())
print(ff.read())
Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values).
##Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values). e.g. records of students: 1, [45, 40, 35], 2, [41, 38, 39], 3, [35, 30, 37] (each line of the file containing record of only 1 student). Prepare mark list in the following format:
##Roll No. Mark-1 Mark-2 Mark-3 Total
## 1 45 40 35 120
stud = {}
mrk = []
print("ENTER ZERO NUMBER FOR EXIT !!!!!!!!!!!!")
print("ENTER STUDENT INFORMATION ------------------------ ")
while True :
rno = int(input("enter roll no.. :: -- "))
if rno == 0 :
break
else:
for i in range(3):
print("enter marks ",i+1," :: -- ",end = " ")
n = int(input())
mrk.append(n)
stud[rno] = mrk
mrk = []
print("Records are ------ ",stud)
f = open ('studFile.txt','w')
print("\nRollNo\t Mark1\t Mark2\t Mark3\t Total")
f.write("RollNo\t Mark1\t Mark2\t Mark3\t Total \n")
tot = 0
for r in stud:
print(r,"\t",end=" ")
f.write(str(r) + "\t" )
for m in stud[r] :
tot = tot + m
print(m,"\t",end=" ")
f.write(str(m) + "\t" )
print(tot)
f.write(str(tot) + '\n')
tot = 0
f = open ('studFile.txt')
print(f.read())
Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values).
##Write a Python program to create a file of strings by taking input from the user and then create a dictionary containing each string along with their frequencies. (e.g. if the file contains ‘apple’, ‘banana’, ‘fig’, ‘apple’, ‘fig’, ‘banana’, ‘grapes’, ‘fig’, ‘grapes’, ‘apple’ then the output should be {'apple': 3, 'banana': 2, 'fig': 3, 'grapes': 2}.
lst = []
d = dict()
print("ENTER ZERO NUMBER FOR EXIT !!!!!!!!!!!!")
while True:
user = input('enter string element :: -- ')
if user == "0":
break
else:
lst.append(user)
print("LIST ELEMENR ARE :: ",lst)
l = len(lst)
for i in range(l) :
c = 0
for j in range(l) :
if lst[i] == lst[j ]:
c += 1
d[lst[i]] = c
print("dictionary is :: ",d)
f = open('FrequencyDictFile.txt','w')
f.write(str(d))
f.close()
f = open('FrequencyDictFile.txt')
print(f.read())
All those coders who are working on the TypeScript based application and are stuck on Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values). can get a collection of related answers to their query. Programmers need to enter their query on Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values). related to TypeScript code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values). for the programmers working on TypeScript code while coding their module. Coders are also allowed to rectify already present answers of Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values). while working on the TypeScript language code. Developers can add up suggestions if they deem fit any other answer relating to "Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values).". Visit this developer's friendly online web community, CodeProZone, and get your queries like Write a Python program to create a file containing student records where each record contain rollno and marks in 3 subjects separated by a comma (marks to be considered as list of 3 values). resolved professionally and stay updated to the latest TypeScript updates.