Write a program to create a string variable and print the amount of memory it consumes


Topic: Write a program to create a string variable and print the amount of memory it consumes

Solution

import sys
string_var = 'string variable'
print(sys.getsizeof(string_var))



List all Python Programs