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
VMariaS [17]
3 years ago
5

A sequence of data values separated by commas can be made into a list by enclosing the sequence in what type of symbols?

Computers and Technology
1 answer:
Dovator [93]3 years ago
3 0

Answer:

square brackets [ ]

Explanation:

In python programming language a list is a data structure type that contains data values which can be of different data types separated by commas and enclosed in a pair of square brackets. in the example below, I have created a list and initialized the values

MyList = [ 2,3,4,5,"David", 2.5, 5.8].

This list contains three different data types integers, float and a string

This code below will produce the output that is attached as an image

<em>MyList = [2,3,4,5,"David"]</em>

<em>print(MyList[0])</em>

<em>print(MyList[1])</em>

<em>print(MyList[2])</em>

<em>print(MyList[3])</em>

<em>print(MyList[4])</em>

<em>Observe that list follow the zero-based indexing</em>

You might be interested in
When a programmer creates an abstract data type, he or she can decide what values are acceptable for the data type, as well as w
Vanyuwa [196]

The abstract data type is a type of data type whose behavioural manner is always determined by a set of values and a set of operations.

<u>Explanation:</u>

These data types depend only on extracting the data and hiding the essential background data. That is why it is called an abstract data type.

It will not show how it is implemented, what algorithms are used and how the data is manipulated.

The abstract data type has three types

i)List ADT

ii)Stack ADT

iii)Queue ADT.

This is how an abstract data type works.

8 0
4 years ago
Write a program that first reads in the name of an input file and then reads the input file using the file.readlines() method. T
topjm [15]

Answer:

Explanation:

The following is written in Python. It creates the dictionary as requested and prints it out to the output file as requested using the correct format for various shows with the same number of seasons.The output can be seen in the attached picture below.

mydict = {}

with open("file1.txt", "r") as showFile:

 for line in showFile:

   cleanString = line.strip()

   seasons = 0

   try:

       seasons = int(cleanString)

       print(type(seasons))

   except:

       pass

   if seasons != 0:

       showName = showFile.readline()

       if seasons in mydict:

           mydict[seasons].append(showName.strip())

       else:

           mydict[seasons] = [showName.strip()]

f = open("output.txt", "a")

finalString = ''

for seasons in mydict:

   finalString += str(seasons) + ": "

   for show in mydict[seasons]:

       finalString += show + '; '

   f.write(finalString[:-2] + '\n')

   finalString = ''

f.close()

6 0
3 years ago
Which of the following is considered a white collar crime?
irinina [24]

Answer:

The answer would be C if I am correct

Explanation:

The reason being is because white collar crimes are non-violent and usually are finance related and involves business or government things, so money laundering would make sense, i hope this helps

5 0
3 years ago
Can someone please answer these questions! Thank you :)
kolbaska11 [484]
1. Technology is something that makes things easier. 2. Technology help students in someway maybe find information about something the good thing about technology in students is that they can learn more things and the bad thing is that technology can be dangerous for students,
3 0
3 years ago
PLZ HELP!!! I'm a beginner in coding!
Lina20 [59]

import random

rock,paper,scissors = 1,2,3

choice = int(input("Please choose 1 2 or 3: "))

computer = random.randint(1,3)

player_won = False

draw = False

if choice == computer:

   draw = True

elif choice == 1 and computer == 3:

   player_won = True

elif choice == 2 and computer == 1:

   player_won = True

elif choice == 3 and computer == 2:

   player_won = True

if player_won:

   print("You won!")

elif not player_won and not draw:

   print("The computer won!")

else:

   print("It's a draw!")

First, I recommend importing at the beginning of your program. Also, you can combine all your same datatype variables in one line. You also need to cast your user choice to an integer so you can compare it with the computer's choice. I wrote the if, elif, and else statements using a boolean variable. I simply wrote all the possibilities that would result in the player winning and this would result in the player_won variable being true. If this is the case, we print to the console, "You won!"

4 0
3 years ago
Other questions:
  • In JAVA, answer the following:
    15·1 answer
  • Which feature is a component of a database application?
    7·1 answer
  • URGENT!! You decide not to use any recipes or information from the "Don't Be an Animal Murderer" Web site. What characteristic o
    7·2 answers
  • A spreadsheet has some values entered:Cell A1 contains 10 cell A2 contains, cell A3 contains 7. you enter in cell A4 the followi
    14·2 answers
  • Jeanne writes a song, and Raul wants to perform
    6·2 answers
  • In this project you will demonstrate your knowledge of decision making blocks such as if statements. Objectives Building on ever
    11·1 answer
  • In a penetration test, a ________ team consists of IT staff who defend against the penetration testers. They are generally aware
    14·1 answer
  • Laura has many online accounts discuss the privacy concerns associated with individuals use of the Internet
    15·1 answer
  • Pls answer i need to turn it in today!!
    15·1 answer
  • (Please hurry will give brainliest and anything else please Due in 5 min)
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!