00TD02B_Python - itnett/FTD02H-N GitHub Wiki
[python]
Her er en oversikt over koden som dekker temaene i emnet "00TD02B Yrkesrettet kommunikasjon" med eksempler på hvordan man kan bruke Python for å illustrere og automatisere enkelte oppgaver knyttet til studieteknikk, kommunikasjon og prosjektarbeid.
Studieteknikk
Automatisk generering av møteinnkalling
def generate_meeting_invitation(meeting_date="2024-09-01", meeting_time="10:00", meeting_place="Room 101"):
"""
Generate a meeting invitation.
Parameters:
meeting_date (str): Date of the meeting.
meeting_time (str): Time of the meeting.
meeting_place (str): Place of the meeting.
Returns:
str: Meeting invitation.
"""
invitation = (
f"Meeting Invitation\n"
f"Date: {meeting_date}\n"
f"Time: {meeting_time}\n"
f"Place: {meeting_place}\n\n"
f"Agenda:\n"
f"1. Opening and welcome\n"
f"2. Approval of the agenda\n"
f"3. Approval of the previous meeting minutes\n"
f"4. Discussion points\n"
f"5. Any other business\n"
f"6. Conclusion and next meeting\n\n"
f"Please confirm your attendance.\n"
)
print(invitation)
return invitation
# Example usage
generate_meeting_invitation()
Generering av CV
def generate_cv(name="John Doe", contact_info="[email protected]", experience=["Software Engineer at XYZ", "Intern at ABC"], education=["B.Sc. in Computer Science", "High School Diploma"]):
"""
Generate a CV.
Parameters:
name (str): Name of the person.
contact_info (str): Contact information.
experience (list): List of work experiences.
education (list): List of educational qualifications.
Returns:
str: Curriculum Vitae (CV).
"""
cv = (
f"Curriculum Vitae\n\n"
f"Name: {name}\n"
f"Contact Information: {contact_info}\n\n"
f"Experience:\n"
)
for exp in experience:
cv += f"- {exp}\n"
cv += "\nEducation:\n"
for edu in education:
cv += f"- {edu}\n"
print(cv)
return cv
# Example usage
generate_cv()
Prosjektarbeid
Planlegge og gjennomføre et prosjekt
import matplotlib.pyplot as plt
def plot_project_timeline(tasks={"Start project": "2024-09-01", "Mid-term review": "2024-10-15", "Final presentation": "2024-12-01"}):
"""
Plot a project timeline.
Parameters:
tasks (dict): Dictionary with task names as keys and dates as values.
Returns:
None
"""
dates = list(tasks.values())
task_names = list(tasks.keys())
plt.figure(figsize=(10, 2))
plt.plot(dates, [1]*len(dates), "ro-")
for i, (task, date) in enumerate(tasks.items()):
plt.text(date, 1.02, f"{task} ({date})", rotation=45, ha="right")
plt.yticks([])
plt.xlabel("Dates")
plt.title("Project Timeline")
plt.grid(True)
plt.show()
# Example usage
plot_project_timeline()
Etiske refleksjoner knyttet til yrkesutøvelsen
Simulering av etisk beslutningstaking
def ethical_decision_simulation(scenarios=["Data privacy concern", "Conflict of interest"], decisions=["Report to supervisor", "Address privately"]):
"""
Simulate ethical decision-making.
Parameters:
scenarios (list): List of ethical scenarios.
decisions (list): List of potential decisions.
Returns:
None
"""
for scenario in scenarios:
print(f"Scenario: {scenario}")
for i, decision in enumerate(decisions, 1):
print(f"{i}. {decision}")
print()
# Example usage
ethical_decision_simulation()
Engelsk
Produksjon av egne tekster og forståelse av tekster
def write_technical_report(title="Technical Report on AI", author="Jane Smith", content="This report discusses the applications of AI in various fields."):
"""
Write a technical report.
Parameters:
title (str): Title of the report.
author (str): Author of the report.
content (str): Content of the report.
Returns:
str: Technical report.
"""
report = (
f"Title: {title}\n"
f"Author: {author}\n\n"
f"Abstract:\n"
f"{content[:150]}...\n\n"
f"Content:\n"
f"{content}\n"
)
print(report)
return report
# Example usage
write_technical_report()
Disse kodene dekker flere av de sentrale temaene i emnet "Yrkesrettet kommunikasjon". De gir eksempler på hvordan man kan bruke Python for å automatisere og illustrere oppgaver innen kommunikasjon, prosjektarbeid, og etisk refleksjon. Du kan tilpasse kodene ytterligere basert på spesifikke behov og krav.