• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 13 pages
Exam (elaborations)

IBM Python For Data Science Questions And Correct Answers

Document preview thumbnail
Preview 2 out of 13 pages

IBM Python For Data Science Questions And Correct Answers...

Content preview

IBM Python For Data Science Questions And
Correct Answers


what's the diff btwn / and // in python? ANSWER the single one always result in float
while double slash result in integer



run code in Jupyter ANSWER Shift + enter



import sys

print(sys.version) ANSWER Find which version of python u are using in jupyter



sys is a module which includes lots of system specific parameters and functions
including Python version being used. Before using it. - ANSWER we must explicitly
import it.



In python to write comments use the. symbol - ANSWER hash



The. message in tells you: 1. where the error occurred (more useful in large notebook
cells or scripts), and 2. what kind of error it was (NameError) - ANSWER
error.message in python



Python is what is called an,,,,,,,,,,,,,language. Compiled languages examine your entire
program at compile time, and are able to warn you about a whole class of errors prior to
execution. Instead, Python reads your script line by line when it runs your program.
Python will then terminate the execution of the whole program in case of finding an error
this is, if that error is an unexpected one - and hence, not handled - by the programmer,
something that we'll consider in more advanced detail later on during the course. -
ANSWER interpreted language



Object-oriented Python language

, There are many different types of objects in Python.such as - ANSWER strings,
integers and floats.



strings, integers and floats. float(x) does what - ANSWER cast x to flot



Convert string to integer - ANSWER int('1')



String, we can index string using numbers Musa[1] - ANSWER indexing



Replicate String = 3* Names - ANSWER NamesNamesNames



Names.Find('isa').find substring. - ANSWER the method finds starting index of a
substring



Find number of character : len("Michael Jackson") - ANSWER find length of charcter



Slicing : We can get more than one characters in a string by slicing. NAME = "TIJJANI"

○ - ANSWER NAME[0:4] = TIJJ



Concatenate String IN PYTHON - ANSWER Statement = Name + "is the best"



replace the old substring with the new target substring is the segment has been found in
the string

A = "Michael Jackson is the best"

B = A.replace('Michael', 'Janet') - ANSWER Replace method:



find the first index of the sub-string - ANSWER G.find('snow')

Document information

Uploaded on
January 18, 2025
Number of pages
13
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$14.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Easton
3.9
(124)
Sold
606
Followers
221
Items
28026
Last sold
1 week ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions