|
|
|
import streamlit as st |
|
import pandas as pd |
|
|
|
|
|
courses = [ |
|
{ |
|
"title": "Python for Data Science", |
|
"description": "Learn Python programming fundamentals for data science applications", |
|
"level": "Beginner" |
|
}, |
|
{ |
|
"title": "Machine Learning Basics", |
|
"description": "Understanding machine learning concepts and algorithms", |
|
"level": "Intermediate" |
|
}, |
|
] |
|
|
|
|
|
st.set_page_config( |
|
page_title="Course Search", |
|
page_icon="π" |
|
) |
|
|
|
|
|
st.title("π Course Search") |
|
st.write("Search through available courses") |
|
|
|
|
|
search_query = st.text_input("Enter keywords to search:", "") |
|
|
|
|
|
if search_query: |
|
found_courses = False |
|
|
|
search_query = search_query.lower() |
|
|
|
|
|
for course in courses: |
|
|
|
if (search_query in course["title"].lower() or |
|
search_query in course["description"].lower()): |
|
|
|
|
|
st.success("Match found!") |
|
with st.container(): |
|
st.markdown(f"### {course['title']}") |
|
st.write(f"π Description: {course['description']}") |
|
st.write(f"π Level: {course['level']}") |
|
st.divider() |
|
found_courses = True |
|
|
|
if not found_courses: |
|
st.warning("No courses found matching your search.") |
|
|
|
|
|
|
|
|