Python output don't show in CMD

Question:

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")
Asked By: kd00m

||

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")
Answered By: Daniel Ben-Shabtay
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.