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
Korolek [52]
3 years ago
8

TOPIC-PYTHON

Computers and Technology
2 answers:
Wewaii [24]3 years ago
6 0

Explanation:

r=r*10+d shifts the previous value to the left (by multiplying by 10) and adds a new digit.

So imagine r = 123 and you want to append 4 to it.

First r is multiplied by 10, so you have 1230. Then you add 4, and get 1234.

The r variable builds up the reverse of s, so it starts at 0.

mixer [17]3 years ago
4 0

This program prints a number with reversed digits. For example, if you input 3564, you'll get 4653.

Suppose you give s=45, and let's see what the code does line by line:

We give 45 as input, and define r=0.

Then, we enter the while loop. The instruction d = s%10 simply extracts the last digit from s. In this case, d=5.

The istruction r = r\ast 10+d adds a 0 at the end of the current value of r. Then we add d, so now the last digit of r is d: we're performing

0\cdot 10 + 5 = 5

Finally, the integer division s = s//10 cuts the last digit from s. So, after the first loop, we have

d=5,\quad r=5,\quad s=4

We enter the loop again. we have

d = s\%10 = 4\%10 = 4

The new value of r is

5\cdot 10 + 4 = 54

And the division s//10 returns 0, so we exit the loop.

And indeed we have r=54, which is 45 in reverse.

You might be interested in
Please help!
Dafna1 [17]
You'd have to convert it into a supported format (mp4, avi, etc.) To do this I would add either video in the background or you can also add a plain color background
8 0
3 years ago
Read 2 more answers
Select three advantages of cloud computing.
Julli [10]

Answer:

A,B,and C

Explanation:

Hopefully this helps!

7 0
3 years ago
If a movie, song, or book is offered for free, is it malware?
ElenaW [278]

Answer:

Yes

Explanation: If the something is a site or app offering free downloads or streams of well-known movies, popular TV shows, big-league sports, and absorbing games, the hidden cost is probably malware.

3 0
3 years ago
Which of the following commands contains an error?
victus00 [196]

Answer:

The very first command contains an error.

Explanation:

The create query is used to create the table in the database. The syntax of the create query is :

create table tablename(column1 datatype,column2 datatype ........columnn datatype);

So there is a keyword table is missing in the given query. so it is incorrect query.

INSERT INTO vehicletype VALUES (1,"truck","Ford",2000); This query is correct.

SELECT * FROM vehicletype; This query is also correct.

6 0
3 years ago
Who invented the ENIAC? More than one answer may apply.
andriy [413]

Answer:John Mauchly and Presper Eckert

Explanation:

3 0
3 years ago
Other questions:
  • Can you give me a free neon legendary pet in Adopt Me on Roblox!!!​ my user is: IamNathan215
    15·2 answers
  • Holly would like to run an annual major disaster recovery test that is as thorough and realistic as possible. She also wants to
    5·1 answer
  • Which group on the sparkline tools design tab would you choose if you wanted to change the data source of the sparkline? (1 poin
    10·1 answer
  • nswer the following questions concerning chapter 1:1.1 Which pair of layers are NOT peer layers?a.Transport layer in the sender
    9·1 answer
  • Can you clone apps form your PC and to other PC?<br>Yes or No
    13·2 answers
  • Using underlining and italics at the same time is which of these? A. allowed but might be overkill B. always a good idea C. not
    15·2 answers
  • What development in operating systems happened between the years 1990 and 2000?
    15·1 answer
  • The process of giving the user the result of processing is called
    14·1 answer
  • Could you tell me the family link app code to unlock a phone please?
    13·1 answer
  • What is this line called that appears and disappears in the search box<br><br> WILL MARK BRAINLIEST
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!