100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

IBM Python For Data Science Questions And Correct Answers

Rating
-
Sold
-
Pages
13
Grade
A+
Uploaded on
18-01-2025
Written in
2024/2025

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

Institution
IBM Python For Data Science
Course
IBM Python For Data Science









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
IBM Python For Data Science
Course
IBM Python For Data Science

Document information

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

Subjects

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')

Get to know the seller

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 West Virgina University
View profile
Follow You need to be logged in order to follow users or courses
Sold
501
Member since
2 year
Number of followers
221
Documents
21855
Last sold
4 days ago

3.9

111 reviews

5
53
4
21
3
21
2
7
1
9

Recently viewed by you

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

Frequently asked questions