Questions: 5 831

Answers by our Experts: 5 728

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 & Filtering

1.      Write a menu driven program to implement of list as a stack containing integers.


iven an integer N  denotes N×N  matrix. Initially, each cell of matrix is empty. U r given K  tasks. In each task, you are given a cell (i,j)  where cell (i,j)  represents

ith  row and jth  column of given matrix.

I/p format

  • first line contains two space-separated integers N and K where N is number of rows and columns in given matrix and K is number of tasks respectively.
  • Next K lines contain two space-separated integers i and j.

O/p format

Print K space-separated integers denoting numberr of empty cells in matrix.


1. Start off by importing the cars.csv file in the jupyter notebook.

2. Generate a line plot graph for the column ‘model’ and ‘hp’.

a. Map the ‘model’ column on the x-axis.

b. Map the ‘hp’ column on the y-axis.

c. Provide the x-axis label as Models of the cars.

d. Provide the y-axis label as Horse-Power of Cars.

e. Set the title as Model Names vs HorsePower. 





How to find the maximum and minimum from the list by using loops


Write a program that inputs a numerator and denominator then display their quotient and remainder


Sample output:

Enter numerator: 91

Enter denominator: 6

Quotient is: 15

Remainder is: 1


single digit number

input - the input is a single line containing a positive integer N.


output - the output should be a single line containing a single-numeral number.






Difficult Addition

Arjun is trying to add two numbers. Since he has learned addition recently, an addition which requires a carry is difficult for him. Your task is to print Easy if the addition does not involve a carry, Otherwise print Hard.


Input

The first line of input contains two space separated integers A and B.


Output

If the addition does not involve a carry,print Easy, otherwise print Hard.




Explanation

When calculating 229 + 390, we have a carry from the tens digit to the hundreds digit, so the answer is Hard.


Sample Input1

123456789 9876543218

Sample Output1

Easy


Sample Input2

229 390

Sample Output2

Hard


1. Which of the following statement is not correct about k-means?

 


a)Accuracy of cluster are improved by scaling of attributes.

b)K-means clusters are affected by outliers.

c)K-Means clustering is NOT influenced by initial centroids which are called cluster seeds

d)Number of clusters to be built is typically an user input and it impacts the way clusters are created


Write a program that takes a string as input and prints “Binary Number” if the string contains only 0s or 1s. Otherwise, print “Not a Binary Number”.


Rules:

1. Play a simple Black Jack game.

2. The player will get two cards first.

3. If the player get black Jack (21 points or two Aces), the player won and does not need to draw the third card.

4. If not, ask if the player wanted to draw the third card.

5. If the player get points less than 22, he won, else he lost.


Points:

1. J, Q and K is 10 points.

2. A is 11 points, but it will become 1 point if the player chooses to draw the third card.

3. Add up the points from the cards and show the final result.


Code:

import random

cards = "A234567890JQK"

print("Your cards are: - -")

first_card = random.randint(1, 13)



LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS