-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaincode.py
52 lines (38 loc) · 2.35 KB
/
maincode.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import streamlit as st
from PIL import Image
import random
st.set_page_config(page_title="Megamagica", page_icon=":crystal_ball:")
# Define a function to find the maximum of three numbers
def find_maximum(num1, num2, num3):
return max(num1, num2, num3)
# Define the title and introduction text
st.title("Welcome to the Megamagica")
st.subheader("🧙♀️ What do you seek to find, my dear?")
st.write("I know you seek the greatest of all? **Haha!** Fear not, simply provide me with three numbers and I shall reveal the future!")
# Define the input fields for the three numbers
num1 = st.number_input("Enter the first number :", value=0.0, step=None, format='%f', key='num1')
num2 = st.number_input("Enter the second number :", value=0.0, step=None, format='%f', key='num2')
num3 = st.number_input("Enter the third number :", value=0.0, step=None, format='%f', key='num3')
# Define a button to trigger the maximum calculation
if st.button("Cast Spell :crystal_ball:"):
# Call the function to find the maximum value
maximum = find_maximum(num1, num2, num3)
# Load the GIF image
image = Image.open("robin-hood-fortune-teller.gif")
# Resize the image to fit alongside the output
image_width = int(image.width * 0.7)
image_height = int(image.height * 0.7)
image = image.resize((image_width, image_height))
# Display the GIF image next to the output
st.image(image, use_column_width=False, width=300)
# Define a list of answers for the soothsayer to randomly choose from
answers = ["It is certain", "Without a doubt", "You may rely on it", "Yes, definitely", "It is decidedly so",
"As I see it, yes", "Most likely", "Yes", "Signs point to"]
# Randomly choose an answer from the list
answer = random.choice(answers)
# Display the answer and maximum value
st.write(f"Calling spirits Toll free......{answer}!.......🔮🧙♀️✨")
#st.write("<h1 style='text-align:center; color:#008080;'>The largest number is:</h1>", unsafe_allow_html=True)
# display the largest number in a big font size
st.markdown("<h1 style='text-align:center; color:#008080;'>The spirits have revealed that the greatest of all is :</h1>", unsafe_allow_html=True)
st.markdown("<h1 style='text-align:center; color:#008080; font-size: 96px;'>{}</h1>".format(maximum), unsafe_allow_html=True)