Program to convert US Dollars to Indian rupees. Get link Facebook X Pinterest Email Other Apps August 04, 2020 Code: print("USD to INR Converter:") dollars = float(input("Please enter dollars: ")) rupees = dollars * 64 print(rupees, " Rupees") Output: Get link Facebook X Pinterest Email Other Apps Comments
Python program to generate a random float where the value is between 5 and 50 using Python math module. August 04, 2020 Code: import random print("Float values between 5 to 50") for x in range(5): print('{:04.3f}'.format(random.uniform(5, 50)), end='\n') Output: Read more
Python program to create a user-defined module that will ask your college name and display the name of the college. August 04, 2020 College.py: def col(): name = input("Enter your college name: ") print("Your college name is:", name) Code: import College College.col() Output: Read more
Create a class Employee with data members: name, department and salary. Create suitable methods for reading and printing employee information. ((MSBTE Pratical Question)) August 04, 2020 Code: class Employee: name = "" department = "" salary = 0 def getdata(self): self.name = input("Enter your name: ") self.department = input("Enter your department: ") self.salary = input("Enter your salary: ") def putdata(self): print("Employee name:",self.name) print("Department name:",self.department) print("Salary:",self.salary) e1 = Employee() e1.getdata() e1.putdata() Output: Read more
Comments
Post a Comment