Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # A Simple 20 Second Countdown Created With Python Scripting.
- # Original script can be found here: https://pastebin.com/4TVk3Bx3
- __file_name__ = '20to0.py'
- __author__ = 'Dan Evans'
- __copyright__ = 'Copyright 2016©, Coding With Py'
- __credits__ = 'Dan Evans'
- __dct_url__ = 'http://purl.org/dc/terms/'
- __license__ = 'Creative Commons'
- __rel_url__ = 'http://creativecommons.org/licenses/by-nc/4.0/'
- __version__ = 'CC-by-nc/4.0/'
- __maintainer__ = 'Dan(Python253)Evans'
- __email__ = 'Python253@gmail.com'
- __last_update__ = '03/03/24'
- """
- 20to0.py - A Simple 20 Second Countdown
- This Python script, '20to0.py', authored by Dan Evans, creates a playful 20-second countdown experience.
- The script utilizes a 'while' loop to decrement the countdown timer and display the remaining seconds.
- To enhance the user experience, a one-second delay is introduced between each countdown step using the 'time' module, providing a real-time countdown sensation.
- Feel free to use, modify, and share this script under the terms of the Creative Commons Attribution-NonCommercial 4.0 International License.
- """
- print('\n', '20to0.py is licensed under',
- '\n', 'The Creative Commons Attribution-NonCommercial',
- '\n', '4.0 International License',
- '\n' * 2, 'File Name: ' + __file_name__, '\n', 'Author: ' + __author__,
- '\n', 'Copyright: ' + __copyright__, '\n', 'Credits: ' + __credits__,
- '\n', 'DCT URL: ', '\n', __dct_url__, '\n', 'License: ' + __license__,
- '\n', 'Release URL: ', '\n', __rel_url__, '\n', 'Version: ' + __version__,
- '\n', 'Maintainer: ' + __maintainer__, '\n', 'Email: ' + __email__,
- '\n', 'Last Update: ' + __last_update__, '\n')
- import time
- # This Script Counts Down From 20 to 0 Seconds.
- i = 20 # Edit this value for timer length in seconds
- print("\n\nCountdown Started...\n\n")
- while i > 0:
- print(i)
- time.sleep(1) # Introduce a 1-second delay
- i -= 1
- print('\nCountdown Complete!\n')
- # End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement