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
Goryan [66]
3 years ago
11

Write a function named "higher_lower" that takes an int as a parameter and returns "higher" if 14 is greater than the input and

"lower" if 14 is less than the input, and "correct" if 14 is equal to the input.
Computers and Technology
1 answer:
Butoxors [25]3 years ago
4 0

Answer:

Following are the program in python language for the above question:

Explanation:

Program :

def higher_lower(value): #function definition.

   if(value<14): #if condition for 14 is greator than the input.

      return "higher"

   elif(value==14): #else if condition for 14 is equal to the input.

       return "correct"

   else:# else condition.

       return "lower"  

return_value = higher_lower(int(input("Enter the integer value: "))) #take the value from the user and call the function.

print(return_value)# print the returned value.

Output :

  • If the user gives the input as 4, it will prints higher.
  • If the user gives the input 15, it will prints lower.

Code Explanation:

  • The above code is in python language, In which the first line will instruct the user, take the input and pass to the function after converting it into an integer.
  • Then the first line of the function is used to check the value is less than 14 or not.
  • Then the else if condition checks that the value is equal to 14 or not.
  • Then the else condition will be true if the value is greater than 14.
You might be interested in
Write a program that asks the user for a CSV of the NYC Open Data Film Permits: There is a sample file for June 2019 film permit
Westkost [7]

Answer:

Before running this program, make sure you have installed pandas module for python.

pip install pandas

import pandas as pd

import numpy as np

csv_file = input("Enter CSV File Name : ")

df = pd.read_csv(csv_file)

count_row = df.shape[0]

print("There were %d Film Permits in Total." %(count_row))

borough_count = df['Borough'].value_counts()

print(borough_count)

location_count = df['ParkingHeld'].value_counts().head(5)

print(location_count)

Explanation:

4 0
3 years ago
Read 2 more answers
Write 3 functions in the starter code below such that: add_to_dict(): takes a dictionary, a key, a value and adds the key,value
shepuryov [24]

Answer:

Required code is given below:

Explanation:

def add_to_dict(dictt, key,value):

if key in dictt.keys():

print("Error. Key already exists.")

else:

dictt[key]=value

return dictt

def remove_from_dict(dictt,key):

try:

dictt[key]

dictt.pop(key, None)

return dictt

except KeyError:

print("No such key exists in the dictionary.")

def find_key(dictt,key):

try:

value=dictt[key]

print("Value: ", value)

except KeyError:

print("Key not found.")

4 0
3 years ago
What symbol indicates that a cell is not wide enough to display its numbers ?
Yuki888 [10]

Answer:

Option D is correct. A pound sign is used to indicates that a cell is not wide enough to display its numbers.

Explanation:

A pound sign symbol indicates that a cell is not wide enough to display its number in Excel. However, it is noted that if you use or installed a US keyboard in your computer then hash symbol (#) is shown and the pound sign symbol is shown if you use or installed the UK keyboard layout in your computer.

Why other options are not correct.

  • An Asterisk symbol:

this symbol is used for multiplication in formula or in a cell to multiply the numbers with each other.

  • A dollar sign:

A dollar sign is used in a cell to show the currency. If you want to show the cell value as a currency. Then, you can use the dollar sign.

  • Percentage Sign

Percentage sign in the cell shows that value in a cell is representing a percentage of some values.

3 0
3 years ago
Read 2 more answers
Suppose that you have just bought a new computer and you want to install soft- ware on that. Specifically, two companies, which
Gennadij [26K]

Answer:

#importing the time module

import time

#welcoming the user

name = raw_input("What is your name? ")

print "Hello, " + name, "Time to play hangman!"

print "

"

#wait for 1 second

time.sleep(1)

print "Start guessing..."

time.sleep(0.5)

#here we set the secret

word = "secret"

#creates an variable with an empty value

guesses = ''

#determine the number of turns

turns = 10

# Create a while loop

#check if the turns are more than zero

while turns > 0:          

   # make a counter that starts with zero

   failed = 0              

   # for every character in secret_word    

   for char in word:      

   # see if the character is in the players guess

       if char in guesses:    

   

       # print then out the character

           print char,    

       else:

   

       # if not found, print a dash

           print "_",      

       

       # and increase the failed counter with one

           failed += 1    

   # if failed is equal to zero

   # print You Won

   if failed == 0:        

       print "

You won"  

   # exit the script

       break              

   print

   # ask the user go guess a character

   guess = raw_input("guess a character:")  

   # set the players guess to guesses

   guesses += guess                    

   # if the guess is not found in the secret word

   if guess not in word:  

 

    # turns counter decreases with 1 (now 9)

       turns -= 1        

 

   # print wrong

       print "Wrong

"    

 

   # how many turns are left

       print "You have", + turns, 'more guesses'  

 

   # if the turns are equal to zero

       if turns == 0:            

   

       # print "You Lose"

           print "You Lose

"  

7 0
3 years ago
What type of address do computers use to find something on a network?
Leona [35]
An Internet Protocol address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. An IP address serves two main functions host or network interface identification and location addressing which can help you a lot.
6 0
3 years ago
Other questions:
  • If a linux installation ends abnormally and the screen displays a fatal signal 11 error, what type of error has occurred?
    7·1 answer
  • In the Microsoft publisher application, words underlined in red are ____.
    6·1 answer
  • Who can help me on my school we will to google meet and i share my screen
    5·1 answer
  • The IBM nine-track tapes that became the industry standard for storage for three decades had several sizes , the most common bei
    13·1 answer
  • What is the largest positive number one can represent in an eight-bit 2’s complement code? Write your result in binary and decim
    7·1 answer
  • If you’re storing some personal information like Debit/Credit card numbers or Passwords etc, on different sites for running you’
    10·1 answer
  • Anyone here codes? <br> C++, C#, Lua? Anything?
    15·2 answers
  • Write short cut of<br> fully justified​
    7·1 answer
  • Please please help I don’t understand this please.
    11·1 answer
  • What type of attack occurs when the threat actor snoops and intercepts the digital data transmitted by the computer and resends
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!