Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions Python/Dice_Rolling_sim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import random
from collections import defaultdict

def roll_dice():
return random.randint(1,6)

#Stores how many times a face appears
face_count= defaultdict(int)

total_roll =0

#Ask user for input
while True:
user_input= input("\n Roll a dice? (yes or no):\n")

if user_input== "yes":
result= roll_dice()
face_count[result] += 1 #Adds 1 to the count of your result (face)
total_roll +=1
print(f"You rolled a {result}")

elif user_input== "no":
#provides the game summary
print("\n🎯 Roll Summary:")
print(f"Total rolls: {total_roll}")

#Shows how many times each face came up
for face in range(1, 7):
count = face_count[face]
print(f"Face {face}: {count}")
print("BYE!")
break

else:
print("Enter yes or no")
continue
38 changes: 38 additions & 0 deletions Python/todo_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import streamlit as st

st.markdown(
"""
<style>
.stApp{
background-color: #ff0015;
}

</style>
""",
unsafe_allow_html=True
)


st.title("TO-DO LIST app ")
task= st.text_input("Enter your task",)

if "tasks" not in st.session_state:
st.session_state.tasks =[]

if st.button("Add task"):
if task:
st.session_state.tasks.append(task)

else:
st.warning("Please Add a task")

completed_task=[]
for i, task in enumerate(st.session_state.tasks):
col1, col2 =st.columns([0.7, 0.3])
with col1:
st.checkbox(task, key= f"task{i}")
with col2:
if st.button('X', key=f"delet_{i}"):
st.session_state.tasks.pop(i)