Answer: Following code is in python
n=input()
num='1'
while int(num)<=int(n): //loop from 1 to n
flag=1 //if an unequal element will be found it will be 0
l=len(num)
if num[0]=='3':
j=0
k=l-1
while j<k: //loop till middle of number
if num[j]==num[k]:
j+=1 //from beginning
k-=1 //from end
else:
flag=0
break
if flag==1:
print(int(num))
num=str(int(num)+1) //number will be incremented as integer
INPUT :
1000
OUTPUT :
3
33
303
313
323
333
343
353
363
373
383
393
Explanation:
In the above code, a loop is executed till num is equal to n which is entered by the user. num is treated as a string so that to ease the process of checking first character is 3 or not. If it is 3 then another loop executes which checks if an element from starting is equal to the corresponding element from the end. If an element is not equal then the flag is changed and then we break out of the loop and prints the number if the flag isn't changed.
I looked up the answer; I believe the answer is true.
6 cells because you have to drag and it becomes six cells .
Answer:
Your answer is initial-response field kit
Explanation:
Answer:
TAX_RATE = 0.20
STANDART_DEDUCTION = 10000.0
DEPENDENT_DEDUCTION = 3000.0
gross_income = float(input("Enter the gross income: "))
number_of_dependents = int(input("Enter the number of dependents: "))
income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents)
tax = income * TAX_RATE
print ("The income tax is $" + str(round(tax, 2)))
Explanation:
Define the <em>constants</em>
Ask user to enter the <em>gross income</em> and <em>number of dependents</em>
Calculate the <em>income</em> using formula (income = gross_income - STANDART_DEDUCTION - (DEPENDENT_DEDUCTION * number_of_dependents))
Calculate the <em>tax</em>
Print the <em>tax</em>
<em />
round(number, number of digits) -> This is the general usage of the <em>round</em> function in Python.
Since we need <u>two digits of precision</u>, we need to modify the program as str(<u>round(incomeTax, 2</u>)).