Docsity

MIS 315 Final Python Strings, Object-Oriented Programming, DataFrames, and Tokenization, Exams of Nursing

Toggle sidebar
bg1
MIS 315 Final Python Strings, Object-Oriented
Programming, DataFrames, and Tokenization Practice
Exam LATEST ALL VERSIONS ACTUAL EXAM COMPLETE
QUESTIONS AND CORRECT DETAILED ANSWERS
(VERIFIED ANSWERS) | ALREADY GRADED A+ 2026/2027
WITH FREE PRACTICE TEST SETS.
Section 1: Original Questions Improved
#
Question
A
B
C
D
Ratio
nale
O
1
Python
provides a
wide variety
of tools and
programmin
g techniques
that you can
use to __
and __
strings.
examine;
manipula
te
delete;
compile
import
; print
index;
tokenize
Python
include
s many
string
method
s for
examini
ng and
manipul
ating
text.
O
2
Strings use
___ to
access
individual
characters.
slicing
indexing
concat
enatio
n
tokeniza
tion
Indexin
g uses
bracket
notatio
n to
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b

Partial preview of the text

Download MIS 315 Final Python Strings, Object-Oriented Programming, DataFrames, and Tokenization and more Exams Nursing in PDF only on Docsity!

MIS 315 Final Python Strings, Object-Oriented

Programming, DataFrames, and Tokenization Practice

Exam LATEST ALL VERSIONS ACTUAL EXAM COMPLETE

QUESTIONS AND CORRECT DETAILED ANSWERS

(VERIFIED ANSWERS) | ALREADY GRADED A+ 2026/

WITH FREE PRACTICE TEST SETS.

Section 1: Original Questions Improved

Question A B C D

Cor rec t Ratio nale O 1 Python provides a wide variety of tools and programmin g techniques that you can use to __ and __ strings. examine; manipula te delete; compile import ; print index; tokenize

A

Python include s many string method s for examini ng and manipul ating text. O 2 Strings use ___ to access individual characters. slicing indexing concat enatio n tokeniza tion

B

Indexin g uses bracket notatio n to

Question A B C D

rec t Ratio nale access a charact er by position . O 3 In Python strings are __ meaning that the first character has index __, the second has index __, and so on. one- indexed; 1; 2 zero- indexed; 0; 1 negativ e- indexe d; - 1; 0 mutable ; 0; 1

B

Python sequen ces are zero- indexed . O 4 When iterating through a string with a while loop in Python, the loop continues until ___. a sentinel value is found the end of the string is reached the index equals 1 the string become s mutable

B

The loop stops when the index reaches the length of the string.

Question A B C D

rec t Ratio nale d in place. O 8 String slices are called ___. substring s indexes tokens method s

A

A

substrin g is a contigu ous slice of a string. O 9 The expression string[start:e nd] includes characters with ___, not including the ending indexing position. the starting indexing position up to the ending indexing position only the ending position all positio ns except the start negative position s only

A

Slicing include s the start index and exclude s the end index. O 1 0 You can test to see if one string is contained in another string with in is == + A in returns True if a substrin g exists inside

Question A B C D

rec t Ratio nale the ___ operator. another string. O 1 1 The string testing method ___ returns true if the string contains only numeric digits and is at least one character in length. isalpha() isdigit() isspace () isalnum ()

B

isdigit() checks whethe r all charact ers are digits. O 1 2 By default, the split method uses the ___ character as the delimiter. comma whitespa ce period tab only B str.split( ) splits on any whitesp ace by default. O 1 3

___

programs concentrate on creating objects which are Procedur al Object- oriented Functi onal Modula r

B

Object- oriente d progra mming centers

Question A B C D

rec t Ratio nale only exposing what is necessary. object state. O 1 7 A(n) ___ is not a stand- alone program; it is used by programs that need its services. object operatin g system compil er spreads heet

A

Objects are used by progra ms and are not standal one applicat ions. O 1 8 A ___ is code that specifies the data attributes and methods for a particular object. class string list datafra me

A

A class is a bluepri nt for objects.

Question A B C D

rec t Ratio nale O 1 9 Each object that is created from a class is called an ___ of the ___. instance; class class; instance metho d; object attribut e; method

A

An object is an instanc e of a class. O 2 0 A blueprint or template for creating objects, but it does not provide the main body of the program’s execution, is a ___. class function modul e loop A A class defines structur e but is not the progra m entry point. O 2 1 T/F: Class names must start with a capital letter. True False Only in Python 2 Only for built-in classes

B

Capitali zing class names is a convent ion, not a

Question A B C D

rec t Ratio nale indexin g. O 2 5 Checking passwords is an example of ___ testing. String testing Class testing DataFr ame testing Loop testing

A

Passwor d validati on checks string content and format. O 2 6 How does a for loop know to stop? When the sequenc e is exhauste d When a sentinel blank always appears When the index equals 1 When the string become s mutable

A

A for loop stops after all items in the sequen ce are process ed. O 2 7 You must use ___ when iterating a len split join upper A len() gives the stoppin g

Question A B C D

rec t Ratio nale string with a while loop. conditio n for the index. O 2 8 You (can/can’t) edit a string. can can’t only with appen d only with replace in place

B

Strings are immuta ble, so they have no append method . O 2 9 How do you edit a string? Delete the old string and replace it with a new string Use append Chang e a charac ter by index Use pop A Becaus e strings are immuta ble, editing creates a new string.

Question A B C D

rec t Ratio nale O 3 3 T/F: You can’t string split on characters other than spaces. True False Only on tabs Only on newline s

B

You can pass a delimite r such as split("," ). O 3 4 You must convert string data into __ or __ to calculate. int/float list/tuple class/o bject bool/str A Numeri c convers ion allows arithme tic operati ons. O 3 5 Which string testing method tells you if input contains letters and/or numbers only, not .isalnum( ) .isalpha( ) .isdigit( ) .isspace ()

A

.isalnu m() is true for letters and digits only.

Question A B C D

rec t Ratio nale even spaces? O 3 6 Which string testing method tells you if input contains just letters? .isalnum( ) .isalpha( ) .isdigit( ) .isspace ()

B

.isalpha () checks alphabe tic charact ers only. O 3 7 Which string testing method tells you if input contains just spaces? .isalnum( ) .isalpha( ) .isdigit( ) .isspace ()

D

.isspace () checks whitesp ace- only strings. O 3 8 Which string testing method tells you if input contains just numbers? .isalnum( ) .isalpha( ) .isdigit( ) .isspace ()

C

.isdigit() checks digit- only strings.

Question A B C D

rec t Ratio nale O 4 3

T/F:

.startswith and .endswith are case sensitive. True False Only startsw ith Only endswit h

A

Case matters unless the string is normali zed. O 4 4 T/F: When you do a replace, it will replace just the first instance. True False Only if count= 1 Only strings

B

str.repla ce() replace s all occurre nces by default. O 4 5 Making each sentence a list element is called ___. Sentence tokenizat ion Word tokenizat ion Data framin g Indexing A Sentenc e tokeniz ation splits text into sentenc es.

Question A B C D

rec t Ratio nale O 4 6 Each word is a list element in ___. Word tokenizat ion Sentenc e tokenizat ion Slicing Data hiding

A

Word tokeniz ation splits text into words. O 4 7 A two- dimensional data structure like rows and columns, like a spreadsheet, is a ___. data frame string tuple class A

A

DataFra me has rows and column s. O 4 8 To read a spreadsheet file, we have to do what? Import pandas Import string Import rando m Import math

A

pandas provide s functio ns such as read_ex cel() and

Question A B C D

rec t Ratio nale position beyond the end of the string, what will Python use instead? length as the effectiv e end. O 5 3 T/F: Indexing of a string starts at 1, so the index of the first character is 1, the index of the second character is 2, and so forth. True False Only in Python 2 Only for lists

B

Python indexin g starts at 0. O 5 4 Which method would you use to determine whether a certain substring is find(subs tring) append( substrin g) pop(su bstring ) delete(s ubstring )

A

find() returns the position or - 1 if not found.

Question A B C D

rec t Ratio nale present in a string? O 5 5 What will be the value of the variable string after this code executes? string = 'abcd'; string = string.upper( ) 'Abcd' 'ABCD' 'abcd' Nothing ; this code is invalid

B

.upper() returns a new upperca se string. Section 2: Additional 100 Questions

Question A B C D

Cor rect Ratio nale A What does len("MIS315") return? 5 6 7 Error B len() counts all characte rs, includin g digits.