ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 231107 ~ 08 파이썬 공부(계속)
    패스트캠퍼스 부트캠프 학습일지 2023. 11. 8. 10:04

    온라인 직강으로는 여전히 배울것이 없다. 하하하. 전에 재미있게 파이썬 공부했던게 지금은 좀 도움이 되는건가,, 그래도 열심히 해야지. 내 인생에 마지막 파이썬 복습이라고 생각하자..

     

    오히려 인터넷 강의가 속도감도 있고, 전체적인 머신러닝까지 이어지는 경로를 전부 배울 수 있어서 좋았던 것 같다. 조금 더 강의도 빠르게 진행되는 느낌이어서, 편하게 공부하고 있다.

     

    sql을 같이 배울 수 있는 커리여서, 특히 마음에 든다. 이번 패스트캠퍼스에서 지원하는 커리에 sql 강의가 많이 있어서, 제대로 다 수강할 수만 있다면,, 꽤나 많은것들을 제대로 배울 수 있을 것 같다.

     

    하루종일 if랑 for만 배우게 될까바 걱정인데, 복습한다는 느낌으로 하자.. 화이팅이다!

     

    몇일전에 한 숙제를 첨부한다.

    # 1
    list_num = [i for i in range(1, 11)]
    print(list_num)
    list_num_2 = [i for i in range(1, 11, 2)]
    print(list_num_2)
    
    # 2
    point1 = (2, 3)
    point2 = (5, 7)
    
    distance = ((point1[0] - point2[0]) ** 2 + (point2[1] - point1[1]) ** 2) ** 0.5
    print(distance)
    
    # 3
    my_list = [1, 3, 5, 7, 9]
    if 5 in my_list:
        print("숫자가 리스트에 있습니다.")
    else:
        print("숫자가 리스트에 없습니다.")
    
    # 4
    student1 = ("Alice", 95)
    student2 = ("Bob", 87)
    student3 = ("Charlie", 91)
    
    print(f"학생 이름은 {student1[0]}이고, 점수는 {student1[1]} 입니다.")
    print(f"학생 이름은 {student2[0]}이고, 점수는 {student2[1]} 입니다.")
    print(f"학생 이름은 {student3[0]}이고, 점수는 {student3[1]} 입니다.")
    
    # 5
    text = "Python is a versatile programming language"
    list_str = text.split()
    print(list_str)
    
    # 6
    text = "Python is a popular programming language."
    word1 = "Python"
    word2 = "Java"
    
    if word1 in text:
        print(f"{word1}이 text에 있습니다.")
    else:
        print(f"{word1}이 text에 없습니다.")
    
    if word2 in text:
        print(f"{word2}이 text에 있습니다.")
    else:
        print(f"{word2}이 text에 없습니다.")
    
    # 7
    days_of_week = ["월요일", "화요일", "수요일", "목요일", "금요일", "토요일", "일요일"]
    # start_index = int(input("시작 인덱스를 입력하세요: "))
    # end_index = int(input("끝 인덱스를 입력하세요: "))
    # print(days_of_week[start_index:end_index + 1])
    
    # 8
    fruit_dict = dict(zip(["apple", "banana", "cherry", "date", "fig"], ["사과", "바나나", "체리", "데이트", "무화과"]))
    print(fruit_dict)
    # key = input("한글 뜻이 보고 싶은 단어를 입력하세요: ")
    # print(f'영문: {key}, 한글: {fruit_dict[key]}')
    
    # 9
    sentence = "파이썬 프로그래밍 언어는 강력하고 다재다능합니다."
    start_index = sentence.index("프")
    print(start_index)
    end_index = sentence.index("밍")
    print(end_index)
    print(sentence[start_index:end_index + 1])
    
    # 10
    # 도시별 날씨 정보 딕셔너리
    weather_info = {
        "서울": {
            "월요일": "맑음",
            "화요일": "흐림",
            "수요일": "비",
            "목요일": "맑음",
            "금요일": "맑음"
        },
        "대구": {
            "월요일": "흐림",
            "화요일": "맑음",
            "수요일": "비",
            "목요일": "맑음",
            "금요일": "흐림"
        }
    }
    
    # 출력할 도시와 요일(서울, 수요일)
    city = "대구"
    day = "수요일"
    if city in weather_info and day in weather_info[city]:
        print(f'{city}의 {day} 날씨는 {weather_info[city][day]}입니다.')
    
Designed by Tistory.