CSIT 100 Exam Questions with Correct Answers
Which string method can be used to return a string that is the concatenation of the strings in the sequence? - Answer-join If the variable data refers to the string "No way!", then what does the expression len(data) evaluate to ? - Answer-7 Which file method is used to read the entire contents of a file in a single operation? - Answer-read If the variable data refers to the string "No way!", then what does the expression data[1] evaluate to? - Answer-'o' The simplest way to read data from an input file is to use which of the following? - Answer-read method If the variable data refers to the string "No way!", then what does the expression data[-1] evaluate to? - Answer-'!' Which method will input a line of text and return it as a string, including the newline? - Aine() Using encryption, a sender can encrypt a message by translating it to which of the following? - Answer-cipher text What function can be used in Python to convert the values of most data types to strings? - Answer-str If the variable data refers to the string "No way!", then what does the expression data[3:6] evaluate to? - Answer-'way' Data can be output to a text file using which of the following? - Answer-'file object' The integer expression in brackets indicates the position of a particular character in the string to inspect. What is another name for the integer expression? - Answer-index
Información del documento
- Subido en
- 28 de marzo de 2024
- Número de páginas
- 6
- Escrito en
- 2023/2024
- Tipo
- Examen
- Contiene
- Preguntas y respuestas