1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
4vir4ik [10]
2 years ago
15

Please code in python and add comments to code

Computers and Technology
1 answer:
Gnoma [55]2 years ago
4 0

#accepting input from user

n=int(input("Enter a number: "))

#entered number is stored in a temporary variable

temp=n

#initializng required variables

rev=0

dgt=0

#digits are reversed inside while loop

while(n>0):

dgt=n%10

rev=rev*10+dgt

n=n//10

#original number and its reverse are compared

if(temp==rev):

#if equal, it's a palindrome

print("It is a Palindrome")

else:

#if not equal, it's not a palindrome

print("It is not a Palindrome")

#◌⑅⃝●♡⋆♡Nåmřāthā♡⋆♡●⑅◌

You might be interested in
A Ground Fault Circuit Interrupter (GFCI) works by comparing the amount of current going to and returning from equipment along t
Shtirlitz [24]

As the name states, during a ground-fault (when the current going out is significantly different than the current going in) the GCFI interupts the current.  Usually by a switch of some sort.  (Pushing the "test" button produces that click, and cuts off the current)

7 0
3 years ago
Read 2 more answers
How to do this PLEASE HELP 80 points!
sp2606 [1]

When reading the story, you know that the code has been created by humans, so it might actually be english and use concepts like our number system, our computer code system (I'm thinking ASCII), things that you should not assume when decoding a real alien message.

Looking at the numbers I notice that digits 6 to 9 do not occur in the message, which is statistically unexpected. This leads me to believe the number base might be 6 rather than our common base 10. In the story there are insects mentioned. Insects have 6 legs, so this makes sense (after all, our base 10 was based on the number of fingers).

Next, I notice the code 052 appearing regularly, so that could be a space. Let's check a hypothesis. 052 in base 6 is 5*6+2 = 32. 32 is the ASCII code for a space!!

Now, a decoding algorithm is ready to be devised:

"for each number in the sequence, parse it as a base-6 number and then print out its corresponding ASCII value".

The following node.js snippet does this:

var code = ['220','241','255','245','052','313',

           '311','052','312','303','052','312',

           '252','245','052','205','241','251',

           '253','243','052','203','253','302',

           '251','244','303','301','053'];

           

var msg = "";

for (let n of code) {

   msg += String.fromCharCode(parseInt(n,6));

}

console.log(msg);


And the message is.........:

<em>Take us to the Magic Kingdom!</em>

So, do these aliens want to visit Disneyland????

5 0
3 years ago
An argument does not always have to be made in words. A piece of music
mixas84 [53]

Answer:

B. emotional

Explanation:

An emotional argument. An argument does not always have to be made in words.

4 0
3 years ago
What technical was the microscope invented in?
Ilia_Sergeevich [38]

Answer:

Two Dutch spectacle-makers and father-and-son team, Hans and Zacharias Janssen, create the first microscope in 1590.

Explanation:

A microscope is an instrument that makes an enlarged image of a small object, thus revealing details too small to be seen by the unaided eye. The most familiar kind of microscope is the optical microscope, which uses visible light focused through lenses. Eeuwenhoek observed animal and plant tissue, human sperm and blood cells, minerals, fossils, and many other things that had never been seen before on a microscopic scale. He presented his findings to the Royal Society in London, where Robert Hooke was also making remarkable discoveries with a microscope.

8 0
2 years ago
Anisha was learning ‘for’ and ‘while’ loop. Help her understand why for and while loops are called entry controlled loops.
Andrew [12]

Entry controlled loop - <u>The loop which has a condition check at the entrance of the loop, the loop executes only and only if the condition is satisfied is called as entry control loop.</u>

So, for and while loops are its examples.

6 0
2 years ago
Other questions:
  • What is the Multiplier if the change in RGDP is $525,000,000 and initial spending is $100,000?
    12·1 answer
  • You use_____ to view an XPS file
    10·1 answer
  • Hydropower uses moving water to do work, such as grinding grains in a mill. True False
    7·1 answer
  • Matt is a senior developer for Cyber Protect, a company that helps secure management information systems. Matt's new task is to
    8·1 answer
  • The first known permanent photograph was called "View from the Window at Le Gras." True False
    9·1 answer
  • What 2 important components are found on a motherboard? (2 points each)
    13·1 answer
  • the tool that is used on the form to display text that the user cannot change is a. textbox b. label c. button​
    9·1 answer
  • Watson Studio is the IBM premier integrated development environment for data science and artificial intelligence practitioners.
    5·1 answer
  • How does the use of blocking affect the external sorting algorithm, and how does it change the cost formula
    5·1 answer
  • In which ways can governments manipulate the media? Select 3 options.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!