Python output don't show in CMD

Viewed 25

If I run this script in CMD (or Git Bash - doesn't matter) using python name.py, output will show only hello and not the return value. Why is that? I tried to reinstall python, add PATH, uninstall Anaconda and install only python from official website. Code is working fine in jupyter notebook.

def to_jaden_case(string):
    return ' '.join(word.capitalize() for word in string.split())

to_jaden_case("How can mirrors be real if our eyes aren't real")

print("hello")
1 Answers

You need to print the return value

def to_jaden_case(string):
    return ' '.join(word.capitalize() for word in string.split())

print(to_jaden_case("How can mirrors be real if our eyes aren't real"))

print("hello")
Related