Bytes to kilobytes in Python

Python program to get bytes b from user and find kilobytes kb

Sample Input 1:

2048

Sample Output 1:

2

Sample Input 2:

1024

Sample Output 2:

1

Try your Solution

Strongly recommended to Solve it on your own, Don't directly go to the solution given below.

#write your code here

Program or Solution

				
			
					
b=int(input("Enter Bytes:"))
kb=b/1024
print("{} Kilo Bytes".format(kb))

			
				
			

Program Explanation

get bytes using input() method.

Calculate kilobyte = byte/1024 (1 kilo byte = 1024 bytes)

Comments