Question: Write the answers to these practice questions in Python Programming (Artificial Intelligence) # Question 1: Find the sum of all odd numbers between 1 and

Write the answers to these practice questions in Python Programming (Artificial Intelligence)

# Question 1: Find the sum of all odd numbers between 1 and 99 (inclusive).

# Question 2: The population of a town starts at 100. # Each year, the population grows by 50% (rounded down to the nearest integer). # Calculate the number of years it takes for the population to exceed 2000.

# Question 3: Write a function that takes an input x (number of seconds) # and returns 4 numbers, namely the number of days, hours, minutes, and seconds # that is represented by the input.

# e.g. f(100) should return 1 minute 40 seconds # f(1000000) should return 11 days 13 hours 46 minutes 40 seconds

# Question 4: Write a function that takes in two lists of integers # and returns the integers that are in both lists

# e.g. f([1,2,3], [2,3,5,6]) should return [2,3]

# Question 5: Create a NumPy array with 10 rows and 3 columns.

# The first column should be all zeros

# The second column should be all ones

# The third column should be all fives

# Question 6: Using NumPy, count the number of positive numbers in each of the following lists: L1 = [5, -10, 4, 9, -3, -1, 3, 9, 4, 6] L2 = [[-8, -8, 9], [-1, -3, 4], [ 1, -5, -9]] L3 = [[[-4, 3], [-1, -1]], [[ 6, 1], [-4, -7]]]

# Questions 7: The following NumPy array represents a table of weather data where

# each row represents a city and each column represents the temperature at a particular day

# Calculate the mean and standard deviation in temperature for each city import numpy as np temperatures = np.array([ [61.7, 73.4, 74.4, 60.9, 63.2, 63.1, 73.3, 73.7, 79.4, 77.3], [78.1, 67.7, 62. , 78.5, 62.9, 78.2, 75.8, 74.6, 76. , 66.1], [76.8, 79.7, 63.6, 70.5, 74.3, 61.5, 76.3, 61.3, 66.7, 73. ], [73.6, 77.7, 68.5, 65.4, 77.3, 62.4, 69.5, 71.2, 64.4, 76. ], [78.8, 62.8, 63.8, 77.9, 68.7, 66.6, 69.3, 68.5, 61.9, 71.9]])

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!