Question: Section 1: multiple choice Data Types: The following is what data type: number = 23 a.string b.float c.list d.integer. e.dictionary The following is what data

Section 1: multiple choice

Data Types:

The following is what data type:

number = 23

a.string

b.float

c.list

d.integer.

e.dictionary

The following is what data type:

number = "

Hello World!

"

a.string

b.float

c.list

d.integer

e.dictionary

The following is what data type:

shopping_list = {1: "kale",

2: "almond milk",

3: "olive oil",

4: "walnuts"}

a.string

b.float

c.list

d.integer

e.dictionary

The following is what data type:

class_list = ["differential equations",

"python for finance",

"data structures",

"algorithms"]

a.string

b.float

c.list

d.integer

e.dictionary

If you wanted to find out the type of a variable in Python called number, which command would you use?

A.type(number)

B.typeof(number)

C.number.class

Section 2: programming

Program 1:

Account management of our software has a request from a

client to build a basic calculator using python that has the following

criteria:

input your choice 1 4 (these get added as functions)

1 is to add

2 is to subtract

3 is to multiply

4 is to divide

print out what you chose in terms of if you picked 2 it would say

you chose to subtract

enter number 1 as x

enter number 2 as y

print out the answer

Here is an example of one of the functions (you need 4)

# example of one of the calculator functions

def add(x, y) :

return x + y

Here is an example of printing out your choice:

Choice_dictionary = {1: "add",

2: "subtract",

3. "multiply",

4. "divide"}

for i in choice_dictionary:

if choice == i:

print "you chose: " + choice_dictionary[i]

Section 3:

Pi = Poert

P means population. Po is population start and Pi is population finish.

It basically means how much population growth happens.

e is a constant and is approximately 2.718281828

you can also import math and go math.e

r is the growth rate which has to be converted to a decimal by dividing by 100. So if growth rate is 1.6, it is 0.16 by making it 1.6/100

t is time. So it can be hours in terms of bacteria or years in terms of population growth. This also works for money growth.

Write a function that returns the population growth number.

The arguments you need to pass into the function is

P = starting population

r = population growth rate

t = time

and it should return the finishing population.

If the starting population in the US in 1920 was 100 million, and the growth rate is approximately 1.234 from 1920 to 2014. What does your final population give? It should be around 318 million

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!