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
alexandr402 [8]
3 years ago
11

What is the output of the following code:

Computers and Technology
1 answer:
Oksi-84 [34.3K]3 years ago
3 0
<h2>Answer:</h2>

786

<h2>Explanation:</h2>

In Python, and of course many other programming languages, lists are one of the built-in data types used to store several items in a variable.

In creating a list, the items, which may be of different types (e.g integer, float, string e.t.c), are placed in a square bracket and each item is separated from the other by a comma. The following are an example of a list.

<em>myList = ["fish", "meat", 5, 8, "egg"]</em>

<em>scores = [10, 34, 78, 90]</em>

To access or retrieve an item in a list, the index of that item is used. Indexes start from 0. For example, in <em>myList </em>the first item (which is <em>fish</em>) has an index of  0. The second item (which is <em>meat</em>) has an index of 1 and so on. In <em>scores, </em>the first item (which is <em>10</em>) has an index of 0, <em>34 </em>has an index of 1, <em>78 </em>has an index of 2 and so on.

Now;

i. to access the first item in <em>myList, </em>we simply write: myList[0]. This will give <em>fish</em>

ii. to access the third element in <em>scores, </em>we simply write: scores[2]. This will give <em>78</em>

From the list given in the question which is:

list1 =  [ 'cyber', 786 , 2.23, 'square', 70.2 ]

print(list1[1]) will print the item at index 1 which is 786.

Therefore, the output of the code is <em>786</em>

<em></em>

<em></em>

<em></em>

You might be interested in
i see tabs named mowed and Ramsey i tried shredding them and deleting them and ending all the processes but they start duplicati
VikaD [51]

1.Select the data.

2.Go to Data –> Data Tools –> Remove Duplicates.

3.In the Remove Duplicates dialog box: If your data has headers, make sure the 'My data has headers' option is checked. Make sure the column is selected (in this case there is only one column).

4 0
3 years ago
Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
sdas [7]

Answer:

The modified program in Python is as follows:

import math

paint_colors = {'red': 35,'blue': 25,'green': 23}

wall_height = int(input('Enter wall height (feet):\n'))

wall_width = int(input('Enter wall width (feet):\n'))

area = wall_height*wall_width

print('Wall area:',area,'square feet')

paint_needed = area/350.0

print('Paint needed: {:.2f} gallons'.format(paint_needed))

print('Cans needed:',round(paint_needed),'can(s)')

color = input("Choose a color to paint the wall: ")

print("Cost of purchasing", color, "paint: $",paint_colors[color])

Explanation:

The italicized are given from the question [unchanged]

<em>import math</em>

<em> paint_colors = {'red': 35,'blue': 25,'green': 23} </em>

<em>wall_height = int(input('Enter wall height (feet):\n')) </em>

This gets input for width

wall_width = int(input('Enter wall width (feet):\n'))

Calculate the wall area

area = wall_height*wall_width

Print the calculated wall area

print('Wall area:',area,'square feet')

Calculate the amount of paint needed

paint_needed = area/350.0

Print the amount of paint needed to 2 decimal places

print('Paint needed: {:.2f} gallons'.format(paint_needed))

Print the amount of can needed to nearest integer

print('Cans needed:',round(paint_needed),'can(s)')

Prompt user for color of paint [here, we assume the user input is correct]

color = input("Choose a color to paint the wall: ")

Prints the corresponding amount for the color

print("Cost of purchasing", color, "paint: $",paint_colors[color])

3 0
3 years ago
Shaniya has misspelled a scientific name in her biology report. She needs to correct it, but she has no access to a computer. Sh
Sav [38]

Answer:

Selection of answers:

Yes, she can navigate the window and do simple editing.

Yes, she can use this application for free and navigate the window.

No, her document is “Read-Only,” so she cannot navigate the window.

No, her application has limited features and she cannot access the document.

Answer is: No, her document is “Read-Only,” so she cannot navigate the window.

3 0
3 years ago
Which of the following is NOT a common grammar adjustment which is identified by grammar-check software?
Sedbober [7]

Answer:

Shortened versions of phrases Ex:(l ol, s mh, i dk, ect.)

Explanation:

Hope that this helps, if you have any more question please feel free to contact me, hope you have an amazing rest of your day. ;D

7 0
3 years ago
Which of the following is CORRECT about database managementsystem's languages?
scZoUnD [109]

Answer:

Data manipulation languages are used for the retrieval of the,insertion,deletion and modification of data.

Explanation:

Data Manipulation Languages(DML) are used to insert,delete,update,modify the data in the database.

The commands used to do these operations are as following:-

INSERT INTO :-This command is used to insert values in the database.

DELETE:-It is used to delete existing records from the table.

UPDATE:- It is used to modify the records in the table.

SELECT:- It is used to select data from database.

3 0
3 years ago
Other questions:
  • What will happen with communication methods in five years?
    8·1 answer
  • Translate each of these statements into logical expressions using predicates, quantifiers, and logical connectives. a) Something
    7·1 answer
  • What is the unique impact him professionals have on coded data?
    11·1 answer
  • The following algorithm should output the t times table in the format:
    6·1 answer
  • In Alphatech Systems, email software screens incoming messages by organizing them into mailboxes and identifying junk mail. As a
    13·1 answer
  • You have three users who travel to four branch offices often and need to log on to the RODCs at these offices. The branch office
    12·1 answer
  • Write a program that reads a string and outputs the number of times each lowercase vowel appears in it. Your program must contai
    14·1 answer
  • PLEASE HELP ITS CODING AND I INCLUDED A SCREENSHOT OF WHAT TO DO
    14·1 answer
  • How many string object are in 128,55 in python
    7·2 answers
  • marion is an iot developer working for a large organization. why does his supervisor want him to stay informed about the network
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!