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

Write a Python program to access the Furniture spreadsheet, update the price of tables, and then create a new excel spreadsheet called updatedfurniture. Create a dictionary for the price updates and update the prices via a loop, increasing the row number to include all the rows in the spreadsheet. Do not change the formatting of the original spreadsheet. Be sure to check your updatedFurniture spreadsheet to verify that the Total price of the furniture increased. The new Total price amount should be $273,938.20.

class User :

def __int__(self, user_id, username):

self.id = user_id

self.username = username


user_1 = User("001", "allobang")

print(user_1.username)

user_2 = User("002", "Jack")

print(user_2.username)


ACTIVITIES:

1. Finish this code by adding a password attribute.

2. Assign passwords on user_1 and user_2 of your choice.

3. Create 3rd user object.

a. The value of the id should be your student ID number.

b. The value of username should be your first name.

c. Assign the value of the password attribute of your choice.

4. Print the username of 3rd user object.


PYTHON CREATING CLASS AND ATTRIBUTE :



1. Create a Class and initialize attribute of the following:


Class name: Student


Attribute: First Name


Last Name


Sex


Age



2. From the created class, create 5 objects, and display it using pretty table.

Triplet Sum


Given an array n integers, find and print all the unique triplets (a, b, c) in the array which give the sum K. (a+b+c=K).Input


The first line of the input will be space separated integers, denoting the elements of the array. The second line of the input will be an integer denoting the required sum KOutput


The output should be multiple lines, each line containing a unique triplet. The elements of the triple must be sorted in increasing order and all the triplets printed must be sorted in increasing order. Print "No Matching Triplets Found" if there are no triplets with the given sum.Explanation


Sample Input 1

0 12 17 8 9 21

29

Sample Output 1

(0, 8, 21)

(0, 12, 17)

(8, 9, 12)

Sample Input 2

0 1 2 3 5 7 13 17 19 19

22

Sample Output 2

(0, 3, 19)

(0, 5, 17)

(1, 2, 19)

(2, 3, 17)

(2, 7, 13)

Give me exact output of this question sir


Rotate Matrix Rings

Given a matrix of order M*N and a value K, write a program to rotate each ring of the matrix clockwise by K elements. If in any ring has less than or equal to K elements, then don’t rotate that ring.

Input


The first line of input will be two space-separated integers, denoting the M and N.

The next M lines will contain N space-separated integers.

The next line will contain an integer, denoting K.

Output

The output should be M*N matrix by rotating the matrix by K elements.

Explanation

Therefore, by rotating each ring in clockwise direction by 3 elements will give (13, 9, 5, 1, 2, 3, 4, 8, 12, 16, 15, 14) and (10, 6, 7, 11). So the output should be

4 8 12 16

3 10 6 15

2 7 11 14

1 5 9 13

Sample Input 1

4 4

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 16

3


Sample Output 1

13 9 5 1

14 7 11 2

15 6 10 3

16 12 8 4


Sample Input 2

3 4

1 2 3 4

10 11 12 5

9 8 7 6

2

Sample Output 2

9 10 1 2

8 11 12 3

7 6 5 4




give exact output this question


Create a python program that will accept positive or negative number and store it to a list. Accepting input will stop when empty input is encountered. Count and display all positive and negative number input and its index number in the list. Count and display all even and odd positive numbers and its index number. Exclude 0 input.

 

Example Output:

 

number 1: 78

number 2: 91

number 3: -5

number 4: 0

number 4: 8

number 5: -100

number 6: -2

number 7: 100

number 8:

There are 4 positive numbers

All positive numbers: 78 91 8 100

Positive numbers can be found at index number: 0 1 3 6

There are 3 negative numbers

All negative numbers: -5 -100 -2

Negative numbers can be found at index number: 2 4 5

There are 3 positive even numbers

Positive even numbers are: 78 8 100

Positive even numbers can be found at index: 0 3 6

There are 1 positive odd numbers

Positive odd numbers are: 91

Positive odd numbers can be found at index: 1


given an amount write a program in python to find a minimum number of currency notes of different denominations that sum to the given amount. Available note denominations are 1000, 500, 100, 50, 20, 5, 1.

The manager of the company has informed his assistant to enter the age of all the workers working in production department. Among all he has to find the employee with minimum age employee. Help the manager to find the minimum age employee by storing the all age of all employeesin 1D array. Use functions to solve this task.


write a program to implement reversal of a string using stack data structure in list of numbers

What is direct addressing? *


Fewer keys than array positions


Distinct array position for every possible key


Same array position for all keys


Fewer array positions than keys

LATEST TUTORIALS
APPROVED BY CLIENTS