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

You are given a positive integer N. Your task is to find the number of positive integers K <= N such that K is not divisible by any of the following numbers 2, 3, 4, 5, 6, 7, 8, 9, 10.

int(inpu)t=,11,12,200,10


# Method: Write levelsList to levelsFile (override the existing file)

 def writeLevelsToFile(self):

 # Open the file in a way that will override the existing file (if it already exists)

 ...

 # Use a loop to iterate over levelsList item by item

 ...

# Convert everything in the item to a string and then add \n to it - before writing it to the file

...

 # Close the file

 ...

#Replace all ellipsis with applicable code

The media company "GlobalAd" has received a
batch of advertisements from different product
brands. The batch of advertisements is a
numeric value where each digit represents the
number of advertisements the media company
has received from different product brands.
Since the company banners permit only even
numbers of advertisements to be displayed, the
media company needs to know the total
number of advertisements it will be able to
display from the given batch.
Write an algorithm to calculate the total
number of advertisements that will be
displayed from the batch.
Input
The input consists of an integer batch,
representing the batch of advertisements
Output
Print an integer representing the total number
of advertisements that will be displayed by the
media company
Constraints
0 < batchs 109​

# Method: Load levelsList using the data in levelsFile 

def readLevelsFromFile(self):

try:

# Set levelsList to an empty list 

...

# Open the file

...

# Use a loop to read through the file line by line

...

# If the last two characters in the line is "\n", remove them

...

...

# Append the line to levelsList

...

# Close the file

 ...

except:

return

#replace all ellipsis with applicable code

In a bank there are two types of transactions: credit and debit. All transactions are assigned an alphabetical ID. Credit transactions are assigned a vowel and debit transactions are assigned a consonant. To track transactions over a year, all the transaction IDs are combined to form a string of IDs for each customer. A customer wishes to know the number of times he made a debit transaction immediately after a credit transaction.

Write an algorithm to print the count of debit transactions that were made immediately afte a credit transaction for that particular customer.

Input

The first line of the input consists of a string userString, representing the string of transaction IDs.

Output

Print an integer representing the count of det transactions made immediately after a credit

Temperature Conversion

You are given the temperature T of an object in one of Celsius, Fahrenheit, and Kelvin scales. Write a program to print T in all scales viz Celsius, Fahrenheit, and Kelvin. Formula to convert from Fahrenheit F to Celsius C is C = (F - 32) * 5 / 9.Formula to convert from Kelvin K to Celsius C is C = K - 273.Here "C", "F", "K" represent that the temperature scale is in Celsius, Fahrenheit and Kelvin scales respectively. The input contains the temperature (a number) and the unit of the temperature scale (C,F, K) without any space. The output contains temperature in Celsius, Fahrenheit and Kelvin scales in each line in the format similar to input and the value of the temperature is rounded to 2 decimal places.




Finding Difference

Write a program to print the absolute difference between the two given numbers. (Absolute difference is the difference without the negative sign)Input


The first line of the input will be an integer N1.

The second line of the input will be an integer N2.Output


Print the absolute difference of the given two numbers.Explanation


For example, if the given N1 is 200 and N2 is 500

The difference in number is 200 - 500 = -300

The absolute difference is 300.


Letter, Digit or Special Character

You are given a character as input. Check if the given input is a Lowercase Letter or Uppercase Letter or Digit or a Special Character.

Input

The first line of input is a single character N.

Explanation

In the given example character is

9. So, the output should be Digit.

Sample Input 1

9

Sample Output 1

Digit

Sample Input 2

A

Sample Output 2

Uppercase Letter




In a bank there are two types of transactions: credit and debit. All transactions are assigned an alphabetical ID. Credit transactions are assigned a vowel and debit transactions are assigned a consonant. To track transactions over a year, all the transaction IDs are combined to form a string of IDs for each customer. A customer wishes to know the number of times he made a debit transaction immediately after a credit transaction.

Write an algorithm to print the count of debit transactions that were made immediately after a credit transaction for that particular customer

Create a program in Python to accept input from clients of their name, weight (in pounds) and height (in inches). Calculate his/her BMI and then display a message telling them the result. Below is the table of BMI for adults:

BMI​​​Weight Status

Below 18.5​​Underweight

18.5—24.9​​Normal

25.0—29.9​​Overweight

30.0 and Above​Obese

BMI is calculated as dividing your weight in pounds by your height (in inches) squared and then multiplied by 703. In other words BMI = (W / H2  ) * 703. 

the program should display for the client a message telling them in which range they are.  Code your program as a loop so that the program will continue to run until there are no more clients. You decide what will end the program. 

 


LATEST TUTORIALS
APPROVED BY CLIENTS