Program to print half-pyramid using stars. Get link Facebook X Pinterest Email Other Apps August 04, 2020 Code: n = 4 for i in range(0, n): for j in range(0, i+1): print("*",end="") print("\r") Output: Get link Facebook X Pinterest Email Other Apps Comments
Program to convert bits to Megabyte, Gigabyte and Terabyte. August 04, 2020 Code: bits = int(input("Please enter bits: ")) kb = bits / 8000; mb = kb / 1000; gb = mb / 1000; tb = gb / 1000; print(kb, " KiloBytes") print(mb, " MegaBytes") print(gb, " GiGaBytes") print(tb, " TeraBytes") 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
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
Comments
Post a Comment