Posts

Check out my following posts

 import pickle # Please make below file 'REPORT_CARD.dat' manually file = 'REPORT_CARD.dat' PT1 = {} Half_Yearly = {} PT2 = {} Finals = {} strm = '' grade = '' # All the basic details of student --> name, admno. dob, gender, stream def FormerDetails():             global strm     nme = input("Enter student name: ")     Adm = int(input("Enter adm no.: "))     dob = input("Enter dob: ")     gen = input("Enter gender: ")     strm = input("Enter stream(Hindi(H)/CS(C) ~ Maths(M)/Bio(B): ")     d = {}     all = [nme, Adm, dob, gen, strm]     headers = ['Name', 'AdmNo.', "DOB", "Gender", "Stream"]     for i in range(len(headers)):         d[headers[i]] = all[i]     with open(file, 'ab') as bf:         pickle.dump(d, bf) # Taking input from user of marks of a particular exam according to the exam(pt1, pt2, etc) passed to func.  def MarksInput(examname, exam

Displaying Total sales amount, discount amount and net sales amount by using if~elif statements

 # Displaying Total sales amount,discount amount and net sales amount qan=int(input("Enter total quantity: "))            rate=int(input("Enter the rate: ")) tot=qan*rate                    #Using if-elif statements if tot<=10000:     dis=tot*(5/100)     net=tot-dis     print(f"Total units:{qan}")     print(f"Rate:{rate}Rs")     print(f"Total sales amount:{tot}Rs")     print(f"Your discount:{dis}Rs")     print(f"Net sales amount:{net}Rs") elif tot<=50000:     dis=tot*(10/100)     net=tot-dis     print(f"Total units: ",qan)     print(f"Rate:{rate}Rs")     print(f"Total sales amount:{tot}Rs")     print(f"Your discount:{dis}Rs")     print(f"Net sales amount:{net}Rs") elif tot<=100000:     dis=tot*(15/100)     net=tot-dis     print(f"Total units:{qan}")     print(f"Rate:{rate}Rs")     print(f"Total sales amount:{tot}Rs")     print(f&

Program on Gender changing and some Pattern guessing questions using lists and if/else in Python.

 User_name=input('Enter your name,User:')                                                                       #Welcoming Statement print("Welcome dear "+User_name+"\n\n1.Please guess the following patterns and check their answers below.") Question_1=['_','25','125','625']       #Question1                                                        #Question1 print(Question_1) ans1=input("Enter your answer: ") Question_1.remove("_") Question_1.insert(0,ans1) print(Question_1)                    #Answer of Question1 entered by User if Question_1==['5','25','125','625'] :  #If/else statement on User's answer     print("It's true.") else:     print("Your answer is False.") print("Correct answer is: ['5','25','125','625']")     #Correct Answer printed print(input("Press Enter\n")) Question_2=['7',

Program on a shopping website using Dictionary.

name=input("Enter your name: ") print("Welcome "+name+" to our shopping website, Salecart") print("Please input the name of groceries below that you want to order.") groceries={"Sugar":"Uttam sugar & Madhur Sugar",        "Oil":"Fortune oil, Dhara Kachi Ghani oil & Freedom refined oil",        "Dryfruits":"Farmely Premium",        "Wheat":"Desi Choice & Ashirvaad Atta"} print(groceries.keys())  a=(input("Enter grocery name that you are looking for from above list:\n")) if (a=="Sugar"):     print("Uttam sugar:1kg\n\t Rs 60\n\t Cheap\n\n"           "Madhur sugar:1kg\n\t Rs50\n\t Cheap\n\n") elif (a=="Oil"):     print("Fortune oil: \nMustard oil\n 1L\n Rs200\n Moderate\n"          "Dhara Kachi Ghani oil: \nMustard oil\n 1L\n Rs200\n Moderate\n"          "Freedom Refined oil: \nSunflowe

Rushi's Project

  print("This is a program  to find classmate's name according to their roll no.") name=input("Enter your name:\n")         #User's name print("Hello "+name+", Welcome to this program.\n\n") classmates={"1":"Aliza\n Female \n CS~Bio",       #Dictionary             "2":"Haney\n Female\n CS~Bio",             "3":"Om\n Gender ERROR\n Subject ERROR",             "4":"Diraq\n Male\n CS~Maths",             "5":"Dhruv\n Male\n CS~Bio",             "6":"Rushi\n Male\n CS~Maths",             "7":"Rutva\n Female\n CS~Maths",             "8":"Dweep\n Male\n CS~Maths",             "9":"Tanisha\n Female\n CS~Bio",             "10":"Taniya\n Female\n CS~Bio",             "20":"Agasti\n Female\n Hindi~Bio",             "22":&qu