diff --git a/Python/Dice_Rolling_sim.py b/Python/Dice_Rolling_sim.py new file mode 100644 index 0000000..0c3e73d --- /dev/null +++ b/Python/Dice_Rolling_sim.py @@ -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 \ No newline at end of file diff --git a/Python/todo_app.py b/Python/todo_app.py new file mode 100644 index 0000000..bbbeb15 --- /dev/null +++ b/Python/todo_app.py @@ -0,0 +1,38 @@ +import streamlit as st + +st.markdown( + """ + + """, +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) + +