Python Forum

Full Version: [split] No Error, and No Output
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Guys I am a beginner with Python, I am trying to execute a code, it says no error. But I am not getting the expected output. Can someone please help with it ?
students = []


def get_students_titlecas():
    for student in students:
        get_student_titlecase = student.title()
        return get_student_titlecase


def print_student_title_case():
    student_titlecase = get_students_titlecas()
    print(student_titlecase)


def add_student(name, student_id=332):
    student = {"name": name, "student_id": student_id}
    students.append(student)

    student_list = get_students_titlecas()

    student_name = input("Enter the student name ")
    student_id = input("Enter the student ID ")

    add_student(student_name, student_id)

    print_student_title_case()
1) Don't hijack someone else's thread. Especially if your question is completely unrelated to theirs.
2) You've got some functions, but never call them. A function that ran without being called would be worthless.