Program to convert KiloBytes to Bytes and Bits | Function to calculates the bits ; calculates Bits 1 kilobytes ( s ) = 8192 bits ; Function to calculates the bytes ; calculates Bytes 1 KB = 1024 bytes ; Driver code
def Bits ( kilobytes ) : NEW_LINE INDENT Bits = kilobytes * 8192 NEW_LINE return Bits NEW_LINE DEDENT def Bytes ( kilobytes ) : NEW_LINE INDENT Bytes = kilobytes * 1024 NEW_LINE return Bytes NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT kilobytes = 1 NEW_LINE print ( kilobytes , " Kilobytes ▁ = " , Bytes ( kilobytes ) , " Bytes ▁ and " , Bits ( kilobytes ) , " Bits " ) NEW_LINE DEDENT