Write a short program (not a function definition) that will get a decimal value x (type float) from standard input and print a message regarding the value of x and the value of 3 - x.
Write the code needed to get two float values from standard input, A and B. Calculate A as a percentage of B, rounded to one decimal place. For example, if A is 25.0 and B is 75.0, A is about 33.3% of B since 25.0 / 75.0 = 1 / 3 = .3333333... (multiply the ratio by 100 to get the percentage).
Write the code needed to get an integer value from standard input, calculate the square root of the value rounded to the nearest hundredth, then print a message with the result.
Assign the decimal value to the variable decimal and the integer value to the variable precision (or other reasonable names).Finally, round the value of decimal to the number of places after the decimal point indicated by precision, and print the result.
Write the code needed to get two integer values from standard input, assign the first integer to the variable dividend, and assign the second integer to the variable divisor. Calculate two things and print the results:
You are planning to add bookcases to a wall in your living room, but you donβt know how many bookcases to buy. You decide to write a Python function, get_num_bookcases, to help. Your function needs to do the following:
Take parameters for the width of the wall (an integer number of feet) and the width of a bookcase (an integer number of inches). (Your function does not read input from the keyboard; it gets its input through named parameters.)
Calculate how many whole bookcases will fit on the wall using modular arithmetic (use div and/or mod, represented by the operators // and %, as needed to solve the problem).
Write a function, print_integers_less_than(β n), which takes an integer parameter n and prints each integer k which is at least 0 and is less than n, in ascending order.
Write a function, print_perfect_cubes(n), that takes an integer parameter n and prints the perfect cubes starting from \(0^3 = 0\) and ending with \(n^3\text{.}\) When n is negative, the function prints nothing; but do not check for this condition with an "if" statement, it is unnecessary; use a for loop that will automatically print nothing when \(n < 0\text{.}\)
Hint for choosing the right range for your for loop: In the general case, when n is not negative, your function will need to print n+1 different values.
Hint for printing the first part of the output: Convert n to a string and then concatenate that string with "^3"; assign the result to a variable, the_cube. Make the_cube the first argument in your print function call.