Python for Data Science, AI & Development | Coursera IBM |
Kickstart your Python learning journey with this self-paced, beginner-friendly course led by an expert. Python is a leading language in programming and data science, and the demand for those proficient in it is at an all-time high.
This introductory Python course will take you from a complete beginner to a competent programmer within hours—no prior programming experience needed! You will cover Python fundamentals, various data types, and familiarize yourself with data structures like lists and tuples. Additionally, you will explore logical concepts such as conditions and branching, and utilize Python libraries including Pandas, Numpy, and Beautiful Soup. You will also learn to perform tasks such as data collection and web scraping using APIs.
Hands-on labs using Jupyter Notebooks will allow you to practice and apply what you've learned. By the end of the course, you’ll be confident in creating basic programs, handling data, and automating real-world tasks with Python. This course is ideal for those interested in Data Science, Data Analytics, Software Development, Data Engineering, AI, DevOps, and numerous other job roles.
Notice!
Always refer to the module on your course for the most accurate and up-to-date information.
Attention!
If you have any questions that are not covered in this post, please feel free to leave them in the comments section below. Thank you for your engagement.
Module 1 Graded Quiz
x=2x=x+2
- 4
- 2
- 7
- 12
- 8
- float
- string
- 1
- 0
- error
- 3
- '3'
- '12'
- 'HELLO'
- 'Hello'
- 'hello'
- '11'
- 2
- 'ab3'
- '123ab'
- float
- int
Module 2 Graded Quiz
- [4]
- [2,3]
- 1
- 21
- 11
- 12
- True
- False
- [10,1.2]
- ["hard rock",10,1.2]
- ["hard rock",10]
- B=A
- B=A[:]
- 2
- 6
- 5
- "1977"
- "1992"
- "The Bodyguard"
- "Saturday Night Fever"
- retrieve the keys of the dictionary
- retrieves, the values of the dictionary
- {'1','2','3'}
- {'1','2'}
- {1,2,3}
- True
- False
Module 3 Graded Quiz
x="Go"
if(x=="Go"):
print('Go ')
else:
print('Stop')
print('Mike')
- Go Mike
- Mike
- Stop Mike
x=1 x>5
- True
- False
x=5 while(x!=2): print(x) x=x-1
- 5 4 3
- 5 4 3 2
- the program will never leave the loop
class Points(object): def __init__(self,x,y): self.x=x self.y=y def print_point(self): print('x=',self.x,' y=',self.y) p1=Points("A","B") p1.print_point()
- x= A
- y= B
- x= A y= B
for i,x in enumerate(['A','B','C']): print(i,2*x)
- 0 AA 1 BB 2 CC
- 0 A 1 B 2 C
- 0 A 2 B 4 C
class Points(object): def __init__(self,x,y): self.x=x self.y=y def print_point(self): print('x=',self.x,' y=',self.y) p2=Points(1,2) p2.x='A' p2.print_point()
- x= 1 y=2
- x= A y=2
- x=A, y=B
def delta(x): if x==0: y=1 else: y=0 return(y)
- When the input is anything but 0
- When the input is 1
- Never
- When the input is 0
a=1 def do(x): return(x+a) print(do(1))
- 2
- 1
- NameError: name 'a' is not defined
def add(a,b): return(a+b)
- Ensure the error is caught so the program will terminate
- In order to know what type of error was thrown and the
- location within the program
- To skip over certain blocks of code during execution
- It is not necessary to label errors
Module 4 Graded Quiz
a=np.array([0,1]) b=np.array([1,0]) np.dot(a,b)
- 0
- 1
- array([1,1])
- array([[1,1],[1,1]])
- array([[1,0],[0,1]])
- array([[0,1],[1,1]])
X=np.array([[1,0,1],[2,2,2]]) out=X[0:2,2] out
- array([1,0])
- array([1,2])
- array([1,1])
X=np.array([[1,0],[0,1]]) Y=np.array([[2,1],[1,2]]) Z=np.dot(X,Y)
- array([[2,1],[1,2] ])
- array([[2,0],[1,0]])
- array([[3,1],[1,3] ])
with open("Example1.txt","r") as file1: FileContent=file1.read() print(FileContent)
- This is line 1 This is line 2 This is line 3
- This is line 1
- This
with open("Example1.txt","r") as file1: FileContent=file1.readlines() print(FileContent)
- Read the file "Example1.txt"
- Write to the file “Example1.txt”
- Append the file "Example1.txt"
with open("Example.txt","w") as writefile: writefile.write("This is line A\n") writefile.write("This is line B\n")
- Read the file "Example.txt"
- Write to the file “Example.txt”
- Append the file "Example.txt"
- Print out the content of Example2.txt.
- Copy the text from Example2.txt to Example3.txt.
- Check the mode of the open function for each file object.
- df.iloc[1,0]
- df.iloc[2,1]
- df.iloc[0,1]
- pd.read_csv
- pd.read_excel
Module 5 Graded Quiz
- Bookmarks, history, and security
- HTTP headers, blank line, and body
- Encoding, body, and cache
- Start or status line, header, and body
- It will find all of the data within the table marked with a tag “p”
- It will find all of the data within the table marked with a tag “tr”
- It will find all of the data within the table marked with a tag “h1”
- It will find all of the data within the table marked with a tag “a”
- Nested Lists
- JSON
- Lists
- Tuples
- PyCoinGecko
- Plotly
- Pandas
- MatPlotLib
Final Exam
- Li
- Lizz
- L
- It specifies the step of the slicing
- It specifies the position to start the slice
- It specifies the position to end the slice
- 1
- 0
- 2
- float
- int
- str
- An error will occur
- It will remove decimal point
- Nothing happens
- 1/2
- 1//2
- 1/2
- 2//3
- Duplicate
- Unique
- Not changeable
- A collection that is ordered and changeable
- A collection that is unordered and changeable
- A collection that is ordered and unchangeable
- '1234'
- ['1','2','3','4']
- '1','2','3','4'
- ('1','2','3','4')
- Unordered
- Mutable
- Not mutable
- Not indexed
- a.set()
- a=A.dict()
- a=set(A)
if(x!=1):print('Hi')else:print('Hello')print('Mike')
-
Hi
Mike - Hello
Mike - Mike
- If
- Finally
- While
- For
- def add(x): return(x+x) add(1)
- def add(x): return(x+x+x) add('1')
- def add(x): return(x+x) add('1')
- only same Case strings
- only numeric values
- concatenated strings
- strings and numeric values
- 888888888888
555555555555
222222222222 - 8
5
2 -
4
7
10
-
1
3
4 - 1
2
3
4 - 2
class Rectangle(object):def __init__(self,width=2,height =3,color='r'):self.height=heightself.width=widthself.color=colordef drawRectangle(self):import matplotlib.pyplot as pltplt.gca().add_patch(plt.Rectangle((0, 0),self.width, self.height ,fc=self.color))plt.axis('scaled')plt.show()
- 0
- 2
- 3
- a=np.array([0,1,0,1,0]) b=np.array([1,0,1,0,1]) a*b
- a=np.array([0,1,0,1,0]) b=np.array([1,0,1,0,1]) a-b
- a=np.array([0,1,0,1,0]) b=np.array([1,0,1,0,1]) a+b
- a=np.array([1,1,1,1,1]) a+10
- a=np.array([1,1,1,1,1]) 11-a
- a=np.array([1,2,1,1,1]) a+10
- y=df[['Artist','Length','Genre']]
- y=df['Artist','Length','Genre']
- y=df[['Artist'],['Length'],['Genre']]
- It would output the entire text file
- It would output 2 characters from the text file
- It would output the first 2 lines from the text file
- Read “r”
- Write “w”
- Append “a”
- URL
- Error message
- Text file