Function:
question 1: convert inche-mm
question 2: convert Celsius-Fahrenheit
question 3: return max of 3 nums
question 4: input and combine title+first+last
question 5: car_rental (dayrate, #days) get discount with >5 dayes , >10 days
I want very simple code for them
Note: Set numpy random seed value 100
• Define a random 3-D array x2 of shape (x, y, z) and of numbers between 0 and 1
• Print the value of x2
✓ Sample Case
Sample Input For Custom Testing
3 4 2
Sample Output
[[[0.00568851 0.25242635]
0.01525497]
[0.79566251 [0.59884338 0.60380454]
[0.10514769 0.38194344]]
[[0.03647606
0.89041156]
[0.98092086 8.05994199]
[0.89054594
0.5769015 ]
[0.74247969 0.63018394]]
[[0.58184219
0.02043913]
[8.21002658
0.54468488]
[0.76911517 0.25069523]
[0.28589569
0.85239509]]]
Write a python program with algorithm and output to find sum of the following series for n terms: 1 – 2/2! + 3/3! - - - - - n/n!
Write a program that takes multiple student marks as input. If a user enters negative
marks, the program writes all marks to a file called “marks.txt” and exits.
Write a python program with algorithm/flowchart to find sum of the following series for n terms: 1 – 1/2 + 1/3.....+1/n × (-1)^(n-1).
def concatenate(ws:list, n:int):
what is ws:list and n:int
Getting error in this line of code
new_matrix[k][j] = 0
Please help!
Write a program using pseudocode to store your name, class, section in a text file.
Task:
Write a program which will take an input from the user and search it in a built in
array using the linear search algorithm.
For Example:
BuiltInArray = [Apple, Orange, Grape, Strawberry, Blueberry, Mango]
UserInput = Mango
Output: The input found and the index number is 5
UserInput = Rice
Ouput: Input is not available in the array
INCORRECT SOLUTION:
FruitArray= ["Apple", "Orange", "Grape", "Strawberry", "Blueberry", "Mango"]
FruitSearch=input("Enter fruit to search")
c=0
while c<len(FruitArray):
if FruitArray[c]==FruitSearch:
print (FruitSearch, "found in index number", c)
if FruitArray[c]!= FruitSearch:
c = c + 1
print (FruitSearch, "is not available in the array")
****MY QUESTION: What to correct in the program to stop printing for infinite times if fruit is found?