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
# 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
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
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:
BMIWeight Status
Below 18.5Underweight
18.5—24.9Normal
25.0—29.9Overweight
30.0 and AboveObese
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.