1 / 10

Python study

Python study. 2 nd day Indexing and Slicing. Homework check!. Indexing. For choosing elements of list and string. Indexing. Slicing. For choosing the range of list and string. Slicing. Slicing. Expanded slicing. Slicing list. List1 = List2 vs. List1 = List2[:]. Homework.

Download Presentation

Python study

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Python study 2nd day Indexing and Slicing

  2. Homework check!

  3. Indexing • For choosing elements of list and string

  4. Indexing

  5. Slicing • For choosing the range of list and string

  6. Slicing

  7. Slicing

  8. Expanded slicing

  9. Slicing list • List1 = List2vs. List1 = List2[:]

  10. Homework • 구구단을 출력하는 프로그램을 작성하시오. (1단부터 9단까지) 예) 구할 단? 5 5 * 1 = 5 5 * 2 = 10 5 * 3 = 15 5 * 4 = 20 5 * 5 = 25 5 * 6 = 30 5 * 7 = 35 5 * 8 = 40 5 * 9 = 45  • 문자열을 standard input으로 입력받고문자 갯수를 출력해주는 프로그램을 완성하시오. 예) 문자열을 입력하시오 : Hi Tom, Nice to meet you. 문자의 개수는 25입니다.  • 문자열과 숫자를 각각 standard input으로 입력받고입력 받은 문자열을 숫자만큼 출력하는 예제를 만드시오. 예) 문자열을 입력하세요 : I am rambo반복할 숫자를 입력하세요 : 3 I am rambo I am rambo I am rambo • Standard input으로 문자열 s1과 s2를 입력받고, s1과 s2가 다르면 두 문자열을 연결하고 그렇지 않으면 “두 문자열이 같다”를 출력해주는 프로그램을 완성하시오.  • 두 문자열 s1과 s2를 standard input으로 입력 받아, s2의 길이가 s1보다 더 길고, s1의 길이가 홀수인 경우에 s1에 s2를 연결하고 그렇지 않으면 s2에 s1을 연결하여 출력하는 프로그램을 완성하시오.  • 문자열을 입력 받고, 문자열을 역순으로 출력하는 프로그램을 작성하시오. 예) 문자열을 입력하시오 : I am rambo. 역순은: .obmar ma I  • Standard input으로 codon과 아미노산 쌍 데이타를입력받아서table을 만든다. (XXX를 입력하면 종료). 다시 3-base codon을 입력받아서 해당되는 아미노산을 출력한다. (테이블에 속하는 codon에 대한 아미노산만을 출력한다.) 

More Related