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
Stolb23 [73]
3 years ago
11

Write two statements to read in values for my_city followed by my_state. Do not provide a prompt. Assign log_entry with current_

time, my_city, and my_state. Values should be separated by a space. Sample output for given program if my_city is Houston and my_state is Texas: 2014-07-26 02:12:18: Houston Texas Note: Do not write a prompt for the input values. 1 current_time = '2014-07-26 02:12:18:' 2 my_city = "' 3 my_state = "" 4 log_entry - "' 1 test passed 6 print(log_entry) All tests passed Run Run

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

Answer:

Here is the program:

current_time = '2014-07-26 02:12:18:'  

my_city = ''

my_state = ''

log_entry = ''

 

my_city = input("")   #reads in value for my_city

my_state = input("")  #reads in value for my_state

log_entry = current_time + ' ' + my_city + ' ' + my_state   #concatenates current_time, my_city and my_state values with ' ' empty space between them

 

print(log_entry)

Explanation:

You can also replace

log_entry = current_time + ' ' + my_city + ' ' + my_state  

with

log_entry = f'{current_time} {my_city} {my_state}'

it uses f-strings to format the strings

If you want to hard code the values for my_city and my_state then you can replace the above

my_city = input("")

my_state = input("")

with

my_city = "Houston"

my_state = "Texas"

but if you want to read these values at the console from user then use the input() method.

The screenshot of the program along with the output is attached.

You might be interested in
Calculate the time complexity for the following function in terms of Big O notation. Explain your answer.
DerKrebs [107]

Answer: It is 1 int count = 0;

2 for (int i = n; i >= 0; i /= 2)

3 count += i;

4 for (int j = 0; j < n; j++)

5 count +=j;

6 return count;

SO it is j(0-(-n)

Explanation: Im dum

4 0
2 years ago
How is the JOptionPaneclass used to display a dialog box that performs a yes/noconfirmation?
8_murik_8 [283]

Answer:

JOptionPane.showConfirmDialog() function with the option_type parameter set to JOptionPane.YES_NO_OPTION

Explanation:

JOptionPane is a java swing class which enables users to display different kinds of  standard dialog boxes such as - InputDialog, MessageDialog, ConfirmDialog or OptionDialog.

In order to display a Yes/No confirmation we can use JOptionPane.showConfirmDialog() function. This function takes a parameter called option_type. In order to display Yes/No options for the confirmation dialog, the option_type parameter needs to be set to the value JOptionPane.YES_NO_OPTION.

8 0
3 years ago
Why should we apply print preview before printing the document.​
Ghella [55]

to helps them to see how the final printed material will appear. 

7 0
2 years ago
Why is it a good idea not to change the subject line when replying to a message?
Sedbober [7]

Answer:

the correct answer is <em><u>C</u></em>

Explanation: i just did it on edge 2021

4 0
3 years ago
Read 2 more answers
In Excel, you can sort a table by one or more columns by.
timofeeve [1]
Ushsbcjdiosjdhwjwjif math
8 0
3 years ago
Other questions:
  • Sam's manager would like him to create and distribute copies of a budget report for each department. The budget report should sh
    8·2 answers
  • In which step of web design is storyboarding helpful?
    14·1 answer
  • I NEED IT FOR TODAY FOR KEYBOARDING TEST! GIVE ME CORRECT ANSWER PLZ!
    12·2 answers
  • .Ashley is creating a new logo for her client that should be a vector graphic. Which is classified as a vector editing software?
    8·1 answer
  • Before you give your presentation to an audience, you should make sure that your ideas are organized in a clear and meaningful w
    8·2 answers
  • Is the jane austen pride and prejudie a primary source
    6·1 answer
  • #Write a function called hide_and_seek. The function should #have no parameters and return no value; instead, when #called, it s
    7·1 answer
  • I CANT DO SKIN MODS ON BRAWLHALLA RIGHT!!!! IM SO MADDDDDDDDDDD
    11·1 answer
  • Copy and paste is the only way to move text from one place to another.<br><br>True or <br>False​
    15·2 answers
  • Classes that depend on field names from parent classes are said to be ____ because they are prone to errors.Group of answer choi
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!