rizitis |
12-30-2023 02:06 PM |
:jawa:
Code:
star_code_point = 0x2605
cross_pattern = [
[" ", " ", "*", " ", " "],
[" ", " ", "*", " ", " "],
["*", "*", "*", "*", "*"],
[" ", " ", "*", " ", " "],
[" ", " ", "*", " ", " "],
]
for row in cross_pattern:
print("".join(chr(star_code_point) if x == "*" else x for x in row))
Code:
import tkinter as tk
from tkinter import messagebox
def show_popup():
messagebox.showinfo("Holiday Greetings", "Merry Christmas and a Happy New Year!", icon="info")
root.quit()
cross_code_point = '\u2627'
camel_code_point = '\U0001F42A'
cross_pattern = [
[" ", cross_code_point, " "],
[cross_code_point, cross_code_point, cross_code_point],
[" ", cross_code_point, " "],
]
camel_pattern = [
[" ", " ", camel_code_point, camel_code_point, camel_code_point, " "],
]
for row in cross_pattern:
print("".join(str(x) for x in row))
for row in camel_pattern:
print("".join(str(x) for x in row))
root = tk.Tk()
root.after(1000, show_popup)
root.withdraw()
root.mainloop()
python3
|