Python Answers

Questions answered by Experts: 5 288

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

What is library in python?

Matrix Rotation

You're given a square matrix A of dimentions N X n. You need to apply below 3 operations.

Rotation: It is represented as R S where S is an integer in {90,180,270...} which denotes the number of degrees to rotate .You need to rotate the matrix A by angle S in the clockwise direction.

The angle of rotation S will always be in multiples of 90 degrees.

Update: It is represented as U X Y Z. In initial matrix A , you need to update the element at row index X and column index Y with value Z.

Querying: It is represented as Q K L.You need to print the value at row index K and column index L of the matrix of the matrix A.


Sample Input 1

2

1 2

R 90

Q 0 0

Q 0 1

R 90

Q 0 0

U 0 0 6

Q 1 1

-1


Sample Output 1

3

1

4

6


Sample Input 2

2

5 6

7 8

R 90

Q 0 1

R 270

Q 1 1

R 180

U 0 0 4

Q 0 0

-1

Sample Output 2

5

8

8



The first line will contain a message prompt to input the text message.

The second line will contain the number of vowels found in the text message.






Smallest of the Three

by CodeChum Admin

There's always going to be that odd one out. In this case, it's the one with the smallest value. It's your job to determine which one that is!


Instructions:

  1. Input three integers in one line.
  2. Evaluate the integers using conditional statements and print out the integer with the smallest value among the three.

Input

A line containing three integers separated by a space.

10·5·-5

Output

A line containing an integer.

-5

Write a python program that takes 2 inputs from the user. The first input is a string and the second input is a letter. The program should remove all occurences of the letter from the given string and print the output. If the letter is not found in the string and the length of string is greater than 3, then remove the first letter and last letter of the given string and print it. Otherwise print the string as it is. You can assume that all the input will be in lowercase letter.

=====================================================================

Sample Input 1:

tanjiro kamado a

Sample output 1:

tnjiro kmdo


Write a Python program that will take one input from the user made up of two strings separated by a comma and a space (see samples below). Then create a mixed string with alternative characters from each string. Any leftover chars will be appended at the end of the resulting string.



Hint: For adding the leftover characters you may use string slicing.



Note: Please do not use lists for this task.



=====================================================================



Sample Input 1:


ABCD, efgh



Sample Output 1:


AeBfCgDh

Let us now try comparing two numbers by letting the user input two different numbers and say "Greater" if the first inputted number is greater than the second one, and "Lesser" if it’s the other way around.

Let's go!


Input

A line containing two different numbers separated by a space.

1.2·1.02

Output

A line containing a string.

Greater






1. The total number of missing values within the dataset.

 

2. Which column / feature requires correction in the type of value they hold?

 

3. After imputation of nulls with mean what is the average value of the compressive strength in concrete?

4. The feature that has a moderately strong relationship with compressive strength in concrete is?

5. Standardize the dataset using standardscaler(), split the dataset into train and test of proportions 70:30 and set the random state to 1. Build a Linear Regression Model on the data and the resulting r-squared value is between which range?


Create a program that identifies if the entered number is divisible by 7.Use tbe mod operator


Create a program that identifies if the entered number is am odd number.Use the mod operator


LATEST TUTORIALS
APPROVED BY CLIENTS