Exam PCAP All QuestionsBrowse all questions from this exam
Question 85

Which of the following expressions evaluate to True? (Choose two.)

    Correct Answer: B, C

    The expression chr(ord('A') + 1) == 'B' evaluates to True because adding 1 to the ASCII value of 'A' results in the ASCII value of 'B', and chr() converts it back to 'B'. The expression len('"') == 1 evaluates to True because the length of a single character string, even if it is a special character like a backslash, is indeed 1.

Discussion
Miguel_AOptions: BC

Answer:B&C €ג is always = " So the options are: print(ord("Z")-ord("z")==ord("0")) print(chr(ord('A')+1) == 'B') print(len('\'') == 1) print(len(""" """)==0) False True True False

wacha1978Options: BD

print(ord('Z') - ord('z') == ord('0')) print(chr(ord('A') +1) == 'B' ) print(len('\~') == 1 ) print(len('') == 0 ) I assume this is this , so B and D

macxszOptions: BD

answer is BD: chr(ord('A') +1) == 'B' len('') == 0

andr3Options: BC

this should be B,C

Dlugi_ZurawOptions: BC

chr(ord('A') + 1) == 'B' True len('\'') == 1 True

halyOptions: BC

A is false

MTLEOptions: BD

It is BD

TEC65Options: BC

B,C , D is incorrect as print(len(""" """)==1 note that there are three qoutes and an empty string whcih means it includes a new line chracter andwhich counts as one chracter

dcrossOptions: BC

85 Which of the following expressions evaluate to True? (Choose two.) respuestas ok la B Y LA C A. print (ord("Z") - ord("z") == ord("0")) False B. print (chr(ord('A') +1) == 'B') True C. print (len('\'') == 1) True D. print (len(""" """) == 0) False

mplopezOptions: BD

Answer: B and D

jaimebbOptions: BC

B and C

manugarcimaOption: B

print(ord("Z")-ord("z")==ord("0")) print(chr(ord('A')+1) == 'B') print(len('\'') == 1) print(len(""" """)==0) False True True False

QuanteoOptions: BD

Must be B and D

rocky48Options: BD

Answer: B and D

lukakiOptions: BD

Answer: B and D print(ord('Z') - ord('z') == ord('0')) print(chr(ord('A') +1) == 'B' ) print(len('\~') == 1 ) print(len('') == 0 ) Output: False True False True