Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
My python code works in VSCode. On Codewars I get an Exit Code: 137, Max Buffer Size Reached (1.5 MiB). Removing the print() used for debug did the trick.
Thank you benjaminzwhite,
i'm wondering why
greet(Paul)
does work on codewars.This kata troubles me.
If you are typing
greet(Paul)
then, here,Paul
is the name of a variable and, if you haven't defined a variable namedPaul
in your computer/notebook then you will get aNameError
.If you write somewhere earlier in your notebook:
Paul = "test 123"
then your function will return"Hello, test 123..."
and no longer get theNameError
since now you have defined a variable namedPaul
.Whereas when you type
greet("Paul")
you are passing the string"Paul"
as an argument, so the function executes as you would expect, using"Paul"
wherevername
appears in the function body.why does the answer work on codewars but not on my computer (i'm using VSC with python 3.10.9 and jupyter Notebook) ?
For example:
greet(Paul)
gives me an error:
NameError Traceback (most recent call last)
Cell In [10], line 1
----> 1 greet(Paul)
NameError: name 'Paul' is not defined
But: greet('Paul') works well