728x90 반응형 python2 [Python] 성적 처리 - 조건문 순서도 1. 성적을 입력한다. 2. 성적에 따른 학점을 정의한다. 점수 학점 100 - 90 A 89 - 80 B 79 - 70 C 69 - 60 D 59 - 0 F 3. 학점을 출력한다. 2단계에서 어떻게 하면 정해놓은 성적 범위에 따라 학점을 다르게 출력할 수 있을까? 한글로는 "100에서 90일 때 A, 89에서 80일 때 B, .... , 59에서 0일 때 F" 라고 표현한다. 여기서 (조건) 일 때가 반복된다. 영어로 하면 if (condition). Python에서도 이와 비슷하게 적용된다. if (condition) : statement next statement 위와 같이 작성하면 condition을 만족하는 경우에만 statement가 실행되는 것이다. 이것을 조건문 if 라고 한다. i.. 2019. 8. 17. [Python]Lesson 1 We can display character for "print()" There are "string" and "integer" in character's type. print string type character : print('WELCOME') -> WELCOME print('23*3') -> 23*3 print integer type character : print(69) -> 69 print(23*3) -> 69 str(integer type) -> string type int(string type) -> integer type print character through value : name = 'John' print(name) x = 23*3 print(x) ->John 69 2019. 7. 7. 이전 1 다음 어딨냥? 빨리 오라개! 우리집 댕냥이 팔불출력 자랑하기 이벤트상담 신청하기» 728x90 반응형 SMALL