Part of the series

Several example codes

~1 min read • Updated Sep 27, 2025

Program Overview

This Python program receives two inputs from the user: a name and a logical reason.
It then displays both pieces of information clearly on the screen.
This structure is useful for feedback forms, surveys, or simple data collection.


Python Code:


# Receive name and reason from user
name = input("Enter your name: ")
reason = input("Enter a logical reason: ")

# Display the collected information
print("\n--- Displaying Information ---")
print("Name:", name)
print("Reason:", reason)

Sample Output:


Enter your name: Shahin  
Enter a logical reason: To improve the system  
--- Displaying Information ---  
Name: Shahin  
Reason: To improve the system

Explanation:

- The program uses input() to collect two strings from the user
- It stores the name and reason in variables name and reason
- The information is printed with clear labels for readability
- This can be extended to include validation, formatting, or saving to a file


Written & researched by Dr. Shahin Siami