The following code will not compile. Which of the options below would allow the code to compile and run as intended?

if (x >= -10 and <= 10):
print("In range")

Answers

Answer 1

Answer:

Follows are the code to this question:

x=int(input())#use input method with int that takes integer value from user-end  

if (x >= -10 and x<=10):#defining if block that checks x in between -10 to 10

   print("In range")#print message

Output:

6

In range

Explanation:

In this code, the choices were missing that's why the solution to this question can be defined as follows:

In this, x variable using the input method with the int, which takes integer value from the user-end. In the next step, the if block is used, that checks x value lies on between the -10 to 10, to check this condition it used the and logical operator, that run the code when both conditions are true, and at last, it prints the message "In range".


Related Questions

An else statement will be executed in what situation?
the if statement is true
the if statement is false
there is a syntax error
the elif statement is executed

Answers

Answer:

The second one.

Explanation:

An `else` statement is like the alternative route for the code. I like to put it in my own words like, "If the user puts a number insted of a letter tell them they did a good job! Else(Otherwise) Tell them they need to try again.

I hope I helped!

Answer:

b) the if statement is false

Explanation:

The else statement is performed if the if statement's condition is not fulfilled. An else statement executes if an if statement is false. The else statement gives the code a backup if the if statement fails. If the if statement fails, this might propose a different course of action.

An if statement may test whether an integer is even or odd by dividing it by two. This tells the computer whether the number is even or odd. If the input number is divisible by 2, the software will print "the number is even" if it is the computer that determines whether the number is even or odd. If the input number is divisible by 2, the software will print "the number is even" if it is. The else statement may show that the "number is odd" if the integer cannot be divided by two.

In a particular spreadsheet, the data in each cell is password protected. When cells are selected, the formula is visible
in the formula bar. Which is true?
O The cells are locked and hidden.
The cells are locked and unhidden.
The cells are unlocked and hidden.
O The cells are unlocked and unhidden.

Answers

Answer:

Explanation:

Locked and hidden

RIGHT ANSWER GETS BRAINLEST

Complete the code.

You are writing a loop to allow the user to enter data until they enter a "Q". You want to allow them to enter an upper- or lowercase "Q".

if yourTeam.
() == "q":
break


The options they give are:
Upper
Compare
lower

Answers

Answer:

sir i beleive lower is your answer, i know it isnt upper.

Explanation:

:D

Answer:

lower

Explanation:

i just did the quiz and got it right :)

can someone help me on codehs. its 7.1.5: initials. here is what your supposed to do

Write a function called initials that will take a first and last name and return their initials using the following format:

initials("Tracy", "Turtle")
# => "T.T."
initials("Peter", "Parker")
# => "P.P."

Answers

Answer:

first = input( "What is your first name? " )

last = input( "What is your last name? " )

def initials():

   print ("Your initials are: "+first[0]+"."+last[0]+".")

initials ()

Explanation:

it works when I test but it won't submit. Hope this helps

Following are the program to prints the initials of the input value.  

Program Explanation:

Defining a class Main.Inside the class, a method "initials" is declared that takes two string variables "first, last" in the parameter.Inside the method, a return keyword is defined that uses the charAt method that returns the first character value of the parameters. In the next step, the main method is defined.Inside the main method, a print method is declared that calls initials method that accepts value in the parameter and prints its value.

Program:

public class Main //defining a class Main

{

   static String initials(String first, String last)//defining a String method initials that input two variables in the parameter

   {

       return first.charAt(0)+"."+last.charAt(0)+".";//using charAt method that returns first character value

   }

 public static void main(String[] as) //defining main method

 {

   System.out.println(initials("Tracy", "Turtle"));//using print method that calls initials method that accepts value in parameter

   System.out.println(initials("Peter", "Parker"));//using print method that calls initials method that accepts value in parameter

 }

}

Output:

Please find the attached file.

Learn more:

brainly.com/question/2810164

How many comparisons will be done to find 8 in this list using a linear search?

2, 4, 6, 8, 10, 12

Answers

Answer:

I think 4 comparisons

Other Questions
If you are near the North Pole in July and are observing the Sun, describe what you would see during a 24-hour period.A. 19N50, 72E2B. 9N2, 72E50C. 2N19, 50E72D. 72N50, 19N2 (**10 POINTS**)Create two expressions, 1 in the form a (b+c) and a (b - c), that equal 100. Im confused Im not really sure about these Explain the title Guns, Germs and Steel. help with english 10 pionts!! Precision Aviation had a profit margin of 6.25%, a total assets turnover of 1.5, and an equity multiplier of 1.8. What was the firm's ROE Elenas bowling league tracks the number of strikes that each player on her team gets. It also tracks the number of games bowled. The table shows the results. Name Games Strikes Elena 10 7 Jenna 7 8 Freya 3 6 Ginny 6 12 Carol 13 15 Katie 9 18 The graph shows the relationship between each players games and strikes. Determine which team members have the same ratio of games to strikes, and select their corresponding points on the graph. marys age is 2 upon 3 that of peters age. two years ago marys age was 1 upon 2 of whats peters age will be in 5years time. how old is peter now plzz What is the Correct meaning of the word torrid?the torrid conditions sapped energy from the runner, so they struggled to reach the finish line.A.swelteringB.competitiveC.relentlessD.frightening PLease helpwhich would be an exception to the comity clauseA) Buying and selling in different statesB) charging more money for out-of-state college tuition C) freely traveling between states D) recognizing all marriages from all states I wanna finish this hw but I don't know how to do it pls teach me brainly is now my favorite thing Alice has total of 12 dimes and nickels she has 2 more nickels than dimes .which equation represents the given problem situation The Attack on Pearl Harbor had all of thefollowing effects on America except Which of the following was NOT done in Houston's second term to cut government spending?A. cutting the size of the army B.ending land grant to settlers C.cut government salaries D.firing some government workers A plane stress state (2D) of material is defined by: [] = [800300300400] (MPa). Define the principal stresses 1, 2 using: Determinant Method Mohrs Circle (determine also ????max) Sample Response: Amy Tan uses details to show that her family's meal was embarrassing. Her description of her father burping uses imagery because the reader can imagine hearing her father's burp. The guests are astonished, which means they are shocked, because this custom is different. Robert's red face is another description that helps the reader picture him being embarrassed as well. The minister's burp is quiet, and he seems embarrassed by the custom too. Amy says this moment made her silent for the rest of the night, which shows that she is embarrassed.Which details did you include in your response? You can select more than one answer.the detail of Amys father belchinglanguage that appeals to hearing or sightthe guests astonishmentRoberts red facethe ministers quiet belchthe detail of Amys being stunned into silence what is 1=1?????????????????????????????//// HELP At the craft store, Kenji bought a bag of brown and blue marbles. The bag contained 60 marbles, and 40% of them were brown. How many brown marbles did Kenji receive? Read the stanzas from "The Battle of Blenheim" by Robert Southey.With fire and sword the country roundWas wasted far and wide,And many a childing mother then,And new-born baby died;But things like that, you know, must beAt every famous victory.They say it was a shocking sightAfter the field was won;For many thousand bodies hereLay rotting in the sun;But things like that, you know, must beAfter a famous victory."Which technique does the poet use when the old man repeatedly refers to the battle as a "famous victory"?A. exaggerationB. verbal ironyC. metaphorD. pun find the measure of