News
Entertainment
Science & Technology
Life
Culture & Art
Hobbies
News
Entertainment
Science & Technology
Culture & Art
Hobbies
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 #Program for Pickle Serialization and Deserialization import pickle,os,student # Program for Serialization # try: # f=open("d://mydata/studentdata.txt","wb") # if(f.writable()): # rn=int(input("Enter...
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 # Program for tell() and seek() import os try: if(os.path.isfile("d://indore/student1.txt")): f=open("d://indore/student1.txt","r") # print(f.tell()) # print(f.read(5)) # print(f.tell()) f.seek(2,0) print(f.tell()) print(f.read(5))...
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 import csv try: filename=input("Enter a file name for create: ") f=open("d://mydata/"+filename+".csv","w",newline='') if(f.writable()): obj=csv.writer(f) obj.writerow(['eno','ename','salary','department']) while True: en=int(input("Enter Employee Number: "))...
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 # Program for PDBC import MySQLdb try: con=MySQLdb.connect(host='localhost',user='root',password='root',database='DataFlair') print("Data Base connected") eno=int(input("Enter Employee No:")) name=input("Enter Employee Name:") mobile=int(input("Enter Mobile No:"))...
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 # Program for vowel count import os try: if(os.path.isfile("d://filedata/student.txt")): f=open("d://filedata/student.txt","r") count=0 while True: ch=f.read(1) if not ch: break print(ch,end="") ch=ch.upper()...
Get Certified in C Programming and Take Your Skills to the Next Level Program 1 #include<stdio.h> #include<conio.h> int main() { int a=10,b=5,c; printf("Enter two number"); scanf("%d%d",&a,&b); //scanf("%d",&a); // scanf("%d",&b); c=a+b; printf("nAddition of %d and...
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 import time from threading import * class MyThread: def display(self,n): print(current_thread().getName()) for i in range(1,n+1): print(i) time.sleep(1) # Main Thread...
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 # Program for File in python try: f=open("d://filedata/student.txt","w") if(f.writable()): mystr=input("Enter a String: ") f.write(mystr) print("File Created......") except FileExistsError as obj:...
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 class Bank: mylist=[] #static variable def __init__(self,accno,name,amount): self.accno=accno self.name=name self.amount=amount @staticmethod def withdAmount(): ano=int(input("Enter Account Number: ")) flag=False for i...
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 # Program for isA and HasA Relation class Employee: def setEId(self,eid): self.eid=eid def setEName(self,ename): self.ename=ename def setESalary(self,esalary): self.esalary=esalary def setEDept(self,edept):...