Ask the user to input an integer. Print out the three numbers before it.

Sample Run-
Enter an integer: 4
3
2
1

Answers

Answer 1

Answer:

f=float(input("Enter an integer: "))

c=(f-1)

a=(c-1)

b=(a-1)

print(str(c))

print(str(a))

print(str(b))

Explanation:

This will print everything correctly, just copy and paste!

Questions about Python or more ProjectStem help? Just Send me a message!


Related Questions

The code is working fine but I keep getting an EOF error on my 2nd last line.
program:
# option list for user choice
option = ['y', 'yes', 'YES', 'n', 'no', 'NO']
# invalid characters for hawaiian language
invalid_letters = {"b", "c", "d", "f", "g", "j", "q", "r", "s", "t", "v", "x", "y", "z"}
# dictionary for pronunciation of the letters of word
dictionary = {
'a' : 'ah',
'e' : 'eh',
'i' : 'ee',
'o' : 'oh',
'u' : 'oo',
'ai' : 'eye',
'ae' : 'eye',
'ao' : 'ow',
'au' : 'ow',
'ei' : 'ay',
'eu' : 'eh-oo',
'iu' : 'ew',
'oi' : 'oy',
'ou' : 'ow',
'ui' : 'ooey',
'p' : 'p',
'k' : 'k',
'h' : 'h',
'l' : 'l',
'm' : 'm',
'n' : 'n',
'w' : ['v', 'w']
}
# loop for user input
while option not in ['n', 'no']:
Alolan_word = input("Enter a hawaiian word: ").lower()
word = ' ' + Alolan_word + ' '
pronunciation = ''
skip = False

# loop for traversing the word by character wise
# match each character of word with elements of invalid_letters
for letter in Alolan_word:
if letter in invalid_letters:
print("Invalid word, " + letter + " is not a valid hawaiian character.")
break

# loop for scanning the accepted word letter wise
# match each letter of th word with corresponding pronunciation in the dictionary
for index in range(1,len(word)-1):
letter = word[index]

if skip:
skip = False
continue

if letter in {'p','k','h','l','m','n'}:
pronunciation += dictionary[letter]

if letter == 'w':
if word[index-1] in {'i','e'}:
pronunciation += dictionary[letter][0]
else:
pronunciation += dictionary[letter][1]


if letter == 'a':
if word[index+1] in {'i','e'}:
pronunciation += dictionary['ai'] + '-'
skip = True
elif word[index+1] in {'o', 'u'}:
pronunciation += dictionary['ao'] + '-'
skip = True
else:
pronunciation += dictionary[letter] + '-'

if letter == 'e':
if word[index+1] == 'i':
pronunciation += dictionary['ei'] + '-'
skip = True
elif word [index+1] == 'u':
pronunciation += dictionary['eu'] + '-'
skip = True
else:
pronunciation += dictionary[letter] + '-'

if letter == 'i':
if word[index+1] == 'u':
pronunciation += dictionary['iu'] + '-'
skip = True
else:
pronunciation += dictionary[letter] + '-'

if letter == 'o':
if word[index+1] == 'i':
pronunciation += dictionary['oi'] + '-'
skip = True
elif word [index+1] == 'u':
pronunciation += dictionary['ou'] + '-'
skip = True
else:
pronunciation += dictionary[letter] + '-'

if letter == 'u':
if word[index+1] == 'i':
pronunciation += dictionary['ui'] + '-'
skip = True
else:
pronunciation += dictionary[letter] + '-'

if letter in {"'", ' '}:
if pronunciation[-1] == '-':
pronunciation = pronunciation[:-1]
pronunciation += letter

if pronunciation[-1] == '-':
pronunciation = pronunciation[:-1]

# display the pronounciation of accepted word in hawaiian language
print(Alolan_word.upper() + " is pronounced " + pronunciation.capitalize())
option = input("Would you like to enter another word? [y/yes, n/no] ").lower()

print("All done.")

Answers

Answer:

Code is in the attached  .txt file

Explanation:

It must have been an indentation error since I get good results using your code properly formatted. I am not sure what the original problem was so unable to comment further

Hello, I desprately need help in python with this question. I have tried everything:This is the question:



4.19 LAB: Driving costs - functions

Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles.

Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
print('{:.2f}'.format(your_value))

Ex: If the input is:

20.0
3.1599
the output is:

1.58
7.90
63.20
Your program must define and call the following driving_cost() function. Given input parameters driven_miles, miles_per_gallon, and dollars_per_gallon, the function returns the dollar cost to drive those miles.

Ex: If the function is called with:

50 20.0 3.1599


This is my code:

miles_per_gallon = float(input('miles_per_gallon: '))
dollars_per_gallon = float(input('dollars_per_gallon: '))
dollars_per_mile = dollars_per_gallon/miles_per_gallon


your_value1 = 10 * dollars_per_mile
your_value2 = 50 * dollars_per_mile
your_value3 = 400 * dollars_per_mile

print('{:.2f} {:.2f} {:.2f}'.format(your_value1, your_value2, your_value3))



Can someone tell me what I'm doing incorrectly or show me? Thanks truly.



Lily

Answers

Answer:

Code is below and also attached in text file

Explanation:

Because Python indentation is extremely important and pasting code in the brainly window sometimes messes it up, I have provided code below as well as in the attached text file. If the one below works, well and good. Otherwise use the one in the text file

Let me know if you have questions

def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon):

   '''

   Equations Used:

   gallons_consumed = driven_miles/miles_per_gallon

   dollar_cost = gallons_consumed x dollars_per_gallon

   '''

   gallons_consumed = driven_miles/miles_per_gallon

   dollar_cost = gallons_consumed * dollars_per_gallon

   return dollar_cost

# Get inputs from the user

miles_per_gallon = float(input('miles_per_gallon: '))

dollars_per_gallon = float(input('dollars_per_gallon: '))

print()

#Compute dollar cost by calling the driving_cost function

for miles_driven in [10, 50, 400]:    #iterate through the list of miles

   cost = driving_cost(miles_driven, miles_per_gallon, dollars_per_gallon) #call function

   print("{:.2f}".format(cost))

   

The reduction of the amount of medication in the body can be modeled by
the equation , where A is the amount at time t, A0 is the amount at
t = 0, and k is the decay constant ( ). The half-life time of a certain
medication is 3.5 h. A person takes 400 mg of the medication at t=0, and
then additional 400 mg every 4 h. Determine the amount of the medication
in a patient’s body 23 h after taking the first dose.
After determining the value of k, define a vector
(the time since taking each dose) and calculate the corresponding values of
A. Then use MATLAB’s built-in function sum to determine the total
amount.

Answers

Answer:

hahahahahhahah

Explanation:

beacause nathonih

Other Questions
I was there to add some color to the British theater."But the blacks cant do Shakespeare, they have no experience.This was true. Their thick skulls bled with rancorwhen the riot police and the skinheads exchanged quipsyou could trace to the SonnetsMidsummer,Derek WalcottWhich statement best describes the effects of allusions in the passage?The allusions show that the police and the skinheads shared a common language based on their race.The allusions help the speaker describe the poor educational system in England at the time.The allusions create a peaceful image of different ethnic groups discussing art and literature together.The allusions suggest that the speaker supports a violent response to racism. The word that has the/TS/ sound Why might a state implement its own Religious Freedom Restoration Act?to protect religious practices and use religion as justification for controversial practicesto prohibit the practice of one religion so as to protect those who practice another religionto protect the tax-exempt status of religious groups and institutions in the stateto allow for state tax revenue to fund both public and parochial schools equally What would happen if there was no judiciary? suppose abc is a right triangle with sides a, b, and c and right angle at c. use the pythagorean theorem to find the unknown side length. then find the values of the six trigonometric functions for angle b. rationalize the denominators when applicable. An enzyme that follows simple michaelismenten kinetics has an initial reaction velocity of 10 molmin1 when the substrate concentration is five times greater than the km. What is the vmax of this enzyme?. mat was killed in action while serving in iraq. his duty station at the time he was deployed was fort benning, georgia, where he and his wife, kristal, had lived for the previous three years. kristal chose to move back to waterloo, iowa, where they lived at the time mat enlisted. the cost to move their household goods was $4,800; kristal drove 1,050 miles and spent $300 for two nights of lodging. kristal received $5,810 of reimbursement from the military. the taxable amount of kristal's reimbursement is When adding and subtracting with significant digits, it's important to consider decimal places in the numbers being added. TRUE or FALSE? The line y=kx+4 goes through the point (2,-2)K=-3Sketch the graph of the line (need ASAP!) pls pls help whoever gets it right gets marked brainliest A _____________ factor is any living part of an environment. Select the correct answer from each drop-down menu Multiply by the shortcut method: 525 1,000,000 zach wants to install windows 10 over his existing copy of windows 10. he wants to keep his personal files, apps, and windows settings but freshen up all windows components. he currently has a usb drive with a windows 10 iso. Given P(A) = 0.2, P(B) = 0.31 and P(AB) = 0.152, find the value ofP(AUB), rounding to the nearest thousandth, if necessary. Write a strory that involves plan going wrong What is the truth value for the following conditional statement?p: falseq: true~p~qOTF FOTF-TOFF-TOFT F Solve the quadratic equation using the method indicated. See attached photo. Thanks in advance! A plant that shows stability is said to have what When Riley left her house in the morning, her cell phone battery was partiallycharged. The charge remaining in Riley's battery, as a percentage, can be modeled bythe equation B = 40 - 5t, where t is the number of hours since Riley left herhouse. What is the x-intercept of the equation and what is its interpretation in thecontext of the problem?