From 982be94cdb066bff33f2976324bf87b4a329fe2e Mon Sep 17 00:00:00 2001 From: Shivakumar Mazhuvan <54847304+smazhuvan@users.noreply.github.com> Date: Sun, 6 Oct 2024 02:31:21 +0530 Subject: [PATCH] Creative way to print Hello World MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This script does the following: 1. Prints β€œHello, World!” with an ASCII art style. 2. Uses a typing effect to display the text gradually, simulating someone typing the message. 3. Displays your basic information (name, age, and hobby) with emojis to make it more fun! Just replace "Your Name", 25, and "Coding" with your actual information! --- ASCII_Art_Style.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ASCII_Art_Style.py diff --git a/ASCII_Art_Style.py b/ASCII_Art_Style.py new file mode 100644 index 0000000..2ab0946 --- /dev/null +++ b/ASCII_Art_Style.py @@ -0,0 +1,40 @@ +import time +import random + +# Fun 'typing' effect function +def typing_effect(text): + for char in text: + print(char, end='', flush=True) + time.sleep(random.uniform(0.03, 0.1)) # Random typing speed + print() + +# Creative "Hello, World!" with ASCII art +def hello_world_art(): + art = """ + _ _ _ _ __ __ _ _ + | | | | | | | \ \ / / | | | | + | |_| | ___| | | ___ \ \ /\ / /__ _ _| |__ | | + | _ |/ _ \ | |/ _ \ \ V V / _ \| | | | '_ \| | + | | | | __/ | | (_) | \_/\_/ (_) | |_| | |_) |_| + |_| |_|\___|_|_|\___( ) (_) \__,_|_.__/(_) + |/ + """ + typing_effect(art) + +# Fun function to display basic info +def display_info(): + name = "Your Name" + age = 25 # Example age + hobby = "Coding" + + info = f""" + πŸ‘‹ Hello, World! + My name is {name} 🌍 + I'm {age} years old πŸŽ‚ + I love {hobby} πŸ’» + """ + typing_effect(info) + +# Call functions +hello_world_art() +display_info() \ No newline at end of file