Excel formulas
Python Basics
functions & classes
numpy & matplot
xlsx & pandas
100

This formula dynamically adjusts when copied, but a dollar sign ($) prevents part of it from changing—this is called:

Absolute referencing

100

What is the difference between lists and dictionaries?

Lists are a list of items, wheras disc

100

To prevent data loss or resource leaks, you should always call this method on a file object once you are finished with it.

.close()

100

True or False: The plt.show() function must be called after every plotting command to display the graph. 

False!

100

This pandas function displays the first 5 rows of a DataFrame.

.head()

200

What is the primary difference between an IF statement and an IFS statement?

IF handles one condition, while IFS can handle multiple ordered conditions in a single function.

200

This method adds an element to the end of a list.

append()

200

To make a parameter optional, you can assign it one of these in the function header, allowing the function to run even if that argument is omitted.

Default value

200

What is the output of this code?

import numpy as np
a = np.array([1, 2, 3])
print(a * 2)

[2, 4, 6]

200

What is the difference between data.loc[] and data.iloc[]? 

data.loc[] is label-based, you can select rows and columns by their named index. data.iloc[] is integer-based, selecting data on its numerical position, regardless of the label.

300

The WEEKDAY function in Excel returns:

Returns a number representing the day of the week for a given date. (1-7)

300

What will this print

for i in range(3):
    print(i)

0,1,2

300

In the function header 

def make_pizza(pepperoni, pineapple, olives)

these three toppings are called what in the syntax of a function? 

Parameters.

300

This NumPy function creates an array of evenly spaced values between two numbers.

np.linspace()

300

True or false: While the Pandas library allows you to read an Excel file into a dataframe, you need to use the xlsxwriter library to write dataframes to Excel.

False! While Pandas requires an engine like xlsxwriter to be installed to handle the file construction, you actually execute the write operation using the native Pandas .to_excel() method. 

400

What is the main difference between Goal Seek and Solver

Solver can change multiple cells and handle constraints, while Goal Seek changes one cell for one target.

400

What is the output of the following code?

x = [10, 20, 30, 40, 50]
print(x[1:4])

[20, 30, 40]

400

What is the difference between an attribute and a method in a class?

An attribute is a variable that belongs to an instance, a method is a function that belongs to a class

400

What does this code do?

with pd.ExcelWriter("file.xlsx") as writer:
    df.to_excel(writer, sheet_name="Sheet1")

It writes a DataFrame to an Excel file using a specified sheet name

400

If an Excel workbook contains multiple tabs, you use this parameter within pd.read_excel() to specify which one to import.

Sheet_name = 

500

You want to maximize profit by adjusting multiple decision variables with constraints; this Excel tool is used.

Solver

500

What is the output of the following code?

count = 0
while count < 3:
    print(count)
    count += 1

0 1 2

500

Write a Python class called Car that:

  • Has attributes make and year (set using a constructor)
  • Includes a method called get_info() that returns a string in the format:
    "Make: Toyota, Year: 2020"

class Car:

    def __init__(self, make, year):

        self.make = make

        self.year = year

    def get_info(self):

        return f"Make: {self.make}, Year: {self.year}"

500

Whoever can draw this on the board first wins:

import matplotlib.pyplot as plt
plt.plot([1,2,3], [4,5,6])
plt.show()

A line graph connecting the points (1,4), (2,5), (3,6)

500

What is the purpose of this code?

with pd.ExcelWriter("file.xlsx") as writer:
    df.to_excel(writer, sheet_name="Sheet1")

It writes a DataFrame to an Excel file using a specified sheet name.

M
e
n
u