8 kyu
Byte me!
5,301Captain Quack
Loading description...
Puzzles
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Memory size, not byte size.
'Hello':
Byte size (size of the string in UTF-8 encoding): 5 bytes
Memory size (total memory occupied by the string in Python): 54 bytes
Nice!
The instructions read as if it is going to give me an object to test the size of, it does not. How am I suppose to solve this without the objects or input of the objects. I wrote a script that will give you the bytes of any object. I tried converting all the example objects into bytes. Tried putting the bytes as an input, Where do i get the objects it says it will provide?
Hi Terranovafel, Welcome to Codewars!
Looking at your attempted solution, you basically have the right approach.
However, note that the input object is passed as an argument to a function (named
total_bytes
in this kata) and you should return the result from there.You can also read here on how to write a solution: https://docs.codewars.com/training/training-example#writing-a-solution
Initial setup:
This comment has been hidden.
👍
This comment has been hidden.
This sentence is wrong: "This might be useful for sending something over a network, where you need to represent the memory size the item takes up." Amount of memory a python object takes in a running program, and amount of memory this data would take in an HTTP request, for example, are completely different things.
it
blocks of Python should be displayed usingrepr
fixed in new fork
This was a great kata. Also liked how they explained how you'd apply it in the real world. Wish all the katas did this!
python new test framework + python 3.11v. updated in this fork
Thanks!
(approved)
Well explained and a practical problem
thanks
This comment has been hidden.
The pass keyword is added so you can run the tests with an empty function without an error.
This comment has been hidden.
Irl programming includes a lot of searching the web for answers, this kata is supposed to test those skills.
This comment has been hidden.
how can i leave my answer?
This comment has been hidden.
Sorry for not including all of that...
Should I change the solution to the equation? Maybe add something in the the description to excude the garbage collecting?
I'll change what needs to be changed, but I can't delete this now that it's out.
You don't need to worry about the status of this kata. If at some point, CW decides it's a duplicate, it will go through a process to determine its fate.
hello
nice one, for this example i google and get some skills abouy IMPORT.
Hi,
It would make a good addition to the description to add a concrete usecase of this, if you can.
Cheers
added an irl example.
You might have also meant examples for the kata itself....
Welp, I added both.
no, it was "real life" example I was talking about. But kata example is a good take as well. :+1:
Optional kata title:
Byte Me
.:)