1) Which of the following statements contain valid Python string literals? Select all that are correct: a) string = 'We're #1!' b) string = Hello, world. c) string = "1234" d) string = 'Hello, world.' e) string = 1234 f) string = "We're #1!" 2) Joining two strings with the + operator is called… a) A string method b) String concatenation c) String slicing d) String indexing 3) String methods change the original string. a) True b) False 4) What’s the value of x after this code snippet executes? x = 1234 + 5 a) '1239' b) 1239 c) 12345 d) '12345' 5) What’s the value of x after this code snippet executes? x = "1234" + 5 a) Trick question—this fails with a TypeError b) 12345 c) '12345' d) '1239' 6) What is the output of print(10 - 4 * 2) a) 2 b) 12 7) What is the output of the expression print(18 // 4) a) -4 b) 4 c) -5 d) 5 8) a = [10, 20, 30, 40, 50] Which output is different from the others? a) print(a[::]) b) print(a[0:4]) c) print(a[0:5]) d) print(a[0:len(a)]) 9) What is the output of print(2 ** 3 ** 2) Caution: the exponent operator works from right to left. a) 64 b) 512 10) What is the output of the following code print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j)) a) True True False True b) False True True True c) True True False False d) False True False True 11) Select which is true for Python tuple. Select all that are correct: a) A tuple maintains the order of items b) A tuple is unordered c) We cannot change the tuple once created d) We can change the tuple once created
0%
Python Exercises (print,operators,list,string)
공유
공유
공유
만든이
Berkkeskin0707
콘텐츠 편집
인쇄
퍼가기
더보기
할당
순위표
더 보기
접기
이 순위표는 현재 비공개입니다.
공유
를 클릭하여 공개할 수 있습니다.
자료 소유자가 이 순위표를 비활성화했습니다.
옵션이 자료 소유자와 다르기 때문에 이 순위표가 비활성화됩니다.
옵션 되돌리기
퀴즈
(은)는 개방형 템플릿입니다. 순위표에 올라가는 점수를 산출하지 않습니다.
로그인이 필요합니다
비주얼 스타일
글꼴
구독 필요
옵션
템플릿 전환하기
모두 표시
액티비티를 플레이할 때 더 많은 포맷이 나타납니다.
결과 열기
링크 복사
QR 코드
삭제
자동 저장된
게임을 복구할까요?