GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • w3resource
  • Front End
  • HTML
  • CSS
  • JavaScript
  • HTML5
  • Schema.org
  • php.js
  • Twitter Bootstrap
  • Responsive Web Design tutorial
  • Zurb Foundation 3 tutorials
  • Pure CSS
  • HTML5 Canvas
  • JavaScript Course

This view

  • Original page
  • New address

GeezerVison is showing www.w3resource.com — Python: Display a sample examination schedule - w3resource

Python: Display a sample examination schedule

Last update on May 17 2025 05:44:01 (UTC/GMT +8 hours)


Exam Schedule Formatter

Write a Python program to display the examination schedule. (extract the date from exam_st_date).

exam_st_date = (11, 12, 2014)
Sample Output: The examination will start from : 11 / 12 / 2014

Pictorial Presentation:

Display a sample examination schedule


Sample Solution:

Python Code:

# Define a tuple called 'exam_st_date' containing the exam start date in the format (day, month, year)
exam_st_date = (11, 12, 2014)

# Print the exam start date using string formatting
# The '%i' placeholders are filled with the values from the 'exam_st_date' tuple
print("The examination will start from : %i / %i / %i" % exam_st_date)

Sample Output:

The examination will start from : 11 / 12 / 2014

Explanation:

The said code creates a tuple called "exam_st_date" containing three integers: 11, 12, and 2014. It then uses string formatting to print a string that states "The examination will start from :" followed by the integers in the tuple in the order they appear, formatted as day/month/year. The placeholders %i are used to format the integers.

The output would be: "The examination will start from : 11 / 12 / 2014".

Flowchart:

Flowchart: Display a sample examination schedule


For more Practice: Solve these Related Problems:

  • Write a Python program that takes a tuple of exam dates and prints them in "Month Day, Year" format.
  • Write a Python script that calculates how many days remain until an exam.
  • Write a Python program that extracts and prints only the year from an exam schedule tuple.
  • Write a script that takes multiple exam dates as input and prints the earliest one.

Go to:

  • Python Basic Exercises Home ↩
  • Python Exercises Home ↩

Previous: Write a Python program to display the first and last colors from the following list.
Next: Write a Python program that accepts an integer (n) and computes the value of n+nn+nnn.

Python Code Editor:

 

What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.



Follow us on Facebook and Twitter for latest update.


  • Daily Coding Challenges & Projects
  • Weekly Trends and Language Statistics



You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.