From 65d2db46bf8e01b57352c81e3d50d75a7a753fe1 Mon Sep 17 00:00:00 2001 From: Wesley-nfj Date: Tue, 12 Aug 2025 15:38:32 +0100 Subject: [PATCH 1/2] upload a todo app that enables users to list items/actions to be completed. Simple and easy to use. Built using streamlit --- Python/todo_app.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Python/todo_app.py 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) + + From 895d0ea0a9ca3c232f7d49f366ac27d796d02aee Mon Sep 17 00:00:00 2001 From: Wesley-nfj Date: Tue, 12 Aug 2025 16:49:30 +0100 Subject: [PATCH 2/2] Uploaded a python project that simulates a Dice rolling game --- Python/Dice_Rolling_sim.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Python/Dice_Rolling_sim.py 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