Questions: 5 290

Answers by our 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 & Filtering

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)



question: Cards Game





There are M people from 1 to M . Andy has N cards with her. Starting with person Z , he gives the cards one by one to the people in the numbering order. Z, Z+1, Z+2,.....,M, 1, 2,....Z-1. Your task is to output the number of the person who will get the last card.





input 1:- 3 3 2



output 1:- 1



input 2 :- 1 100 1



output 2:- 1

write an expression that evaluates to true if and only if the string variable s equals the string "end".


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.


Given a string, create a new string with all the consecutive duplicates removed.

Hint: You may make a new string to store the result. You can check whether the current character and the next character are the same, then add that character to the new string.

Note: Only consecutive letters are removed not all duplicate occurences of a letter. You may try doing this alternative i.e. removing all duplicate letters from a given string, for your own practice.


Write a python program that splits a given string on a given split character. The first input is a String and the second input is the character that will be used to split the first String.

[You cannot use the built-in split function for this task]


Write a Python program that takes a String as input from the user, removes the characters at even index and prints the resulting String in uppercase without using the built-in function upper().


LATEST TUTORIALS
APPROVED BY CLIENTS