fork download
  1. # Input section (safe if no stdin provided)
  2. try:
  3. id = int(input("Enter ID: "))
  4. name = input("Enter Full Name: ")
  5. grade = float(input("Enter Average Grade: "))
  6. except EOFError:
  7. # defaults when running non-interactively (e.g., on Ideone without stdin)
  8. id = 123
  9. name = "Juan Dela Cruz"
  10. grade = 89.5
  11.  
  12. # Output
  13. print("\n{:<10} {:<20} {:<10}".format("ID", "Name", "Average"))
  14. print("{:<10} {:<20} {:.2f}".format(id, name, grade))
Success #stdin #stdout 0.03s 9264KB
stdin
Standard input is empty
stdout
Enter ID: 
ID         Name                 Average   
123        Juan Dela Cruz       89.50