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
navik [9.2K]
3 years ago
15

Input a string of digits. Convert the string to an int. Print the int. Convert the string to a float. Print the float.

Computers and Technology
1 answer:
ollegr [7]3 years ago
7 0

Answer:

x_inp = [ '1', '2', '3']

   int_val = [ int(a) for a in x_inp ]

   print("integer: int_val")

y_inp = [ '1.0', '2.0', '3.0']

flo_val = [ float(a) for a in y_inp ]

   print("float: flo_val")

Explanation:

All the items in the arrays x_inp and y_inp are coverted to integer and float data types respectively with the for loop statement, which individually assigns the resolved integer and float values to the memory locations int_val and flo_val respectively.

The output becomes,

integer:

1

2

3

float:

1.0  

2.0

3.0

You might be interested in
The terminology used to describe a possible path to resolution to a problem from one end to the other is called what?
Ede4ka [16]

The terminology used to describe a possible path to a resolution to a problem from one end to the other is called a solution.

<h3 /><h3>What is terminology?</h3>

The research of these phrases and related applications is known as terminology science. A glossary is a collection of specialist words plus their corresponding interpretations in a given field.

If there is a body or a term which is the need to have a resolution that needs to be made through that the person can evaluate and find a solution for the following situation then that is called a resolution or solution for that particular problem

Learn more about terminology, here:

brainly.com/question/2511894

#SPJ1

6 0
1 year ago
Andy is trying to put together a holiday gift knapsack (with W=8) for Sarah. He has n items to choose from, each with infinitely
Sever21 [200]

Answer:

See explaination

Explanation:

Given 3 items: {w1 = 1, v1 = 3}, {w2 = 3, v2 = 2}, {w3 = 4, v3 = 3}

Hence OPT(1) = 3, OPT(3) = 2, OPT(4) = 3

Recursive formula for OPT(k) to minimize value is

OPT(k) = INFINITE if k <= 0

= min(3 + OPT(k-1), 2 + OPT(k-3), 3 + OPT(k-4))

Let us calculate OPT(1) to OPT(8)

OPT(1) = 3

OPT(2) = min ( 3 + OPT(1), 2 + OPT(-1), 3 + OPT(-2)) = 6

OPT(3) = 2

OPT(4) = 3

OPT(5) = min ( 3 + OPT(4), 2 + OPT(2), 3 + OPT(1)) = min(6, 8, 6) = 6

OPT(6) = min ( 3 + OPT(5), 2 + OPT(3), 3 + OPT(2)) = min(9, 4, 9) = 4

OPT(7) = min ( 3 + OPT(6), 2 + OPT(4), 3 + OPT(3)) = min(7, 5, 5) = 5

OPT(8) = min ( 3 + OPT(7), 2 + OPT(5), 3 + OPT(4)) = min(8, 8, 6) = 6

3 0
3 years ago
The main differences between laptops and desktop computers other than size and portability.
e-lub [12.9K]

Answer:

Difference between laptops and desktop computer are:

  • Desktop computers contain wide variety of components, but laptops are realtively expensive than desktop computers because laptop has high speed and better graphics designs which increased the cost of whole system.
  • Desktop computer processors are larger in size and it is more efficient and powerful as compared to laptops because laptop processor still has some limitations.
  • Laptop uses less power as compared to desktop computer because laptop contain small components and that is why it needs less power.
  • Desktop computers are easy to upgrade and in laptops hard drive and memory, these two components needs to be upgraded.

5 0
3 years ago
What does a transistor do?
mixas84 [53]

It Transmits electrical currents. You can use it as an amplifier or switch of currents.

5 0
3 years ago
Read 2 more answers
Please complete the following questions. It is important that you use complete sentences and present the questions and answers w
Vanyuwa [196]

Answer:

well... i came for the same answer

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • What is the slogan of the sociological school of criticism ?​
    9·1 answer
  • Which of the following is not an advanced strategy you may use to help you conduct a search on the Internet?
    12·1 answer
  • If you cause a car accident, which type of insurance will require you to pay the least out of pocket?
    5·2 answers
  • Create a datafile called superheroes.dat using any text-based editor, and enter at least three records storing superheroes’ name
    9·1 answer
  • I still haven't figured out how to award someone branliest will someone help me? If you explain to me how to do it i will do awa
    14·1 answer
  • Which member of the Jackson family was the spokesperson for the Psychic Friends Network.​
    7·1 answer
  • Which tool allows users to share code and also serves as a social networking
    10·1 answer
  • AfcAAgrwdsgsFsefvzsdfvbjhbdjbbjbjsdndVHFadbhZJBVdb
    10·2 answers
  • Which two choices are examples of trivial file transfer protocol (tftp) use? (choose two. )
    5·1 answer
  • Data frames can be subset by a chosen value using ==.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!