answer.
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
liberstina [14]
2 years ago
8

Mark and John are developing a program using Python. They name a variable 24_hour_mart, but then recognize that this name violat

es a Python naming convention. What naming convention does it violate?
Variable names can not include the underscore character (_).
Variable names can not begin with a number.
Variable names can not exceed ten characters in length.
Variable names can not be fewer than fifteen characters in length.
Computers and Technology
1 answer:
77julia77 [94]2 years ago
3 0

Answer:

Option 2: Variable names can not begin with a number.

Explanation:

As given Mark and John named a variable as 24_hour_mart while writing a program in python.

While it is forbidden to name a variable starting with any digit, only alphabets (capital and smaller) and underscore can be the first letter of the variable name.

Moreover, by considering the other options given:

  • Variable name can include the underscore (_) between the words. It is used instead of spaces that are not allowed.
  • There is no upper limit for variable length, it can be of any reasonable length and more than 10 characters say 11 or 12 are reasonable.
  • There is no lower limit for variable length, it can be any reasonable length , even it can be of 1 character.

Variables named in python language must not be the keywords as they are reserved for other purposes.

i hope it will help you!

You might be interested in
Choose the reasons why Windows Server operating systems are a popular choice for a network because they _____. Select all that a
____ [38]

Answer:

The answers are -

work on networks that include using Windows operating systems as well as Mac OS, NetWare, or UNIX

provide a graphical user interface that makes it easier for network administrators to learn the system

use wizards and setup devices as the user operating system, making it easier to set up network features

Explanation:

5 0
2 years ago
Write a sequence of statements that create a file named "greeting" and write a single line consisting of "Hello, World!" to that
tia_tia [17]

Answer:

The solution code is written in Python 3 as below:

  1. outfile = open("greeting.txt", "w")
  2. outfile.write("Hello World")
  3. outfile.close()

Explanation:

To create a simple text file in Python, we can use Python built-in function, <em>open()</em>. There are two parameters needed for the open() function,

  1. the file name and
  2. a single keyword "w". "w" denote "write". This keyword will tell our program to create a file if the file doesn't exist.

The statement <em>open("greeting.txt", "w")</em> will create a text file named "<em>greeting.txt</em>" (Line 1)

To fill up the content in the greeting.txt, we use <em>write()</em> method. Just include the content string as the argument of the <em>write()</em> method. (Line 2)

At last, we use <em>close() </em>method to close the opened file,<em> outfile</em>. This will release the system resource from the<em> outfile.</em>

4 0
2 years ago
Lucy is completing a project as part of a science class using materials she found online. Which of the following is MOST LIKELY
const2013 [10]

Answer:

D.

Explanation:

Most students would fail to realize that the pictures they use also need citations so that would be the MOST LIKELY to lead to legal consequence.

7 0
2 years ago
A corporation needs an operating system that allows the various teams in its office to network and collaborate on projects. Whic
maks197457 [2]
They would all work as they can all run on servers and be set up as networks. Microsoft is not an operating system it is a company that rights the windows operating system.
5 0
2 years ago
Write a recursive, string-valued method, replace, that accepts a string and returns a new string consisting of the original stri
ch4aika [34]

Answer:

Check the explanation

Explanation:

public String replace(String sentence){

  if(sentence.isEmpty()) return sentence;

  if(sentence.charAt(0) == ' ')

     return '*' + replace(sentence.substring(1,sentence.length()));

  else

     return sentence.charAt(0) +            replace(sentence.substring(1,sentence.length()));

3 0
2 years ago
Other questions:
  • What is a cursor?
    6·2 answers
  • Isabel is creating a wireframe. She has drawn a layout for the home page along with outlining the navigation elements. She now w
    15·2 answers
  • ______ is a certification program that recognizes sustainable building practices and strategies. Question 1 options: A) Brundtla
    10·1 answer
  • Graduating from college can boost your income 60% compared to high school graduates. An average high school graduate without a c
    8·1 answer
  • How does the discussion of “Luddites,” “Marx,” and “John Maynard Keynes” in paragraph 21 contribute to the development of the id
    7·1 answer
  • Write a program that gets a list of integers from input, and outputs non-negative integers in ascending order (lowest to highest
    13·2 answers
  • Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
    7·1 answer
  • Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in
    15·1 answer
  • A Security team is working with a client to evaluate the security of data and IT functions that are most critical to the operati
    13·1 answer
  • Consider the following code segment, which is intended to create and initialize the two-dimensional (2D) integer array num so th
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!