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
Ierofanga [76]
2 years ago
10

Let's revisit our lucky_number function. We want to change it, so that instead of printing the message, it returns the message.

This way, the calling line can print the message, or do something else with it if needed. Fill in the blanks to complete the code to make it work.
def lucky_number(name):
number = len(name) * 9
___ = "Hello " + name + ". Your lucky number is " + str(number)
___

print(lucky_number("Kay"))
print(lucky_number("Cameron"))
Computers and Technology
1 answer:
maksim [4K]2 years ago
3 0

Answer:

Replace the first blank with:

message = "Hello " + name + ". Your lucky number is " + str(number)

Replace the second blank with:

return message

Explanation:

The first blank needs to be filled with a variable; we can make use of any variable name as long as it follows the variable naming convention.

Having said that, I decided to make use of variable name "message", without the quotes

The next blank is meant to return the variable on the previous line;

Since the variable that was used is message, the next blank will be "return message", without the quotes

You might be interested in
Return 1 if ptr points to an element within the specified intArray, 0 otherwise.
Paladinen [302]

Answer:

int withinArray(int * intArray, int size, int * ptr) {

      if(ptr == NULL) // if ptr == NULL return 0

            return 0;

      // if end of intArr is reached

      if(size == 0)

          return 0; // element not found

  else  

          {

            if(*(intArray+size-1) == *(ptr)) // check if (size-1)th element is equal to ptr

                   return 1; // return 1

            return withinArray(intArray, size-1,ptr); // recursively call the function with size-1 elements

         }

}

Explanation:

Above is the completion of the program.

4 0
2 years ago
Write a static generic method PairUtil.minmax that computes the minimum and maximum elements of an array of type T and returns a
Gnesinka [82]

Answer:

Explanation:

The following code is written in Java. It is hard to fully create the code without the rest of the needed code including the T class and the Measurable interface. Regardless the following code can be implemented if you have that code available.

 public static T minmax(ArrayList<T> mylist) {

       T min = new T();

       T max = new T();

       for (int x = 0; x < mylist.size(); x++) {

           if (mylist.get(x) > max) {

               max = mylist.get(x);

           } else if (mylist.get(x) < min) {

               min = mylist.get(x);

           }

       }

       

       return (min, max);

   }

5 0
2 years ago
Go to the Creamy Ice Corporation passage on the next page. Insert the trademark sign after the word “Corporation'' in the first
GuDViN [60]

Answer:

v

Explanation:

because it is

5 0
2 years ago
A 1.17 g sample of an alkane hydrocarbon gas occupies a volume of 674 mL at 28°C and 741 mmHg. Alkanes are known to have the gen
Nina [5.8K]

Answer:

C3H8

Explanation:

Step 1:

Data obtained from the question. This includes the following:

Mass of alkane = 1.17g

Volume (V) = 674 mL

Temperature (T) = 28°C

Pressure (P) = 741 mmHg.

Gas constant (R) = 0.08206 atm.L/Kmol

Step 2:

Conversion to appropriate unit.

For Volume:

1000mL = 1L

Therefore, 674mL = 674/1000 = 0.674L

For Temperature:

Temperature (Kelvin) = Temperature (celsius) + 273

Temperature (celsius) = 28°C

Temperature (Kelvin) = 28°C + 273 = 301K

For Pressure:

760mmHg = 1atm

Therefore, 741 mmHg = 741/760 = 0.975atm

Step 3:

Determination of the number of mole of the alkane..

The number of mole of the alkane can be obtained by using the ideal gas equation. This is illustrated below:

Volume (V) = 0.674L

Temperature (T) = 301K

Pressure (P) = 0.975atm

Gas constant (R) = 0.08206 atm.L/Kmol

Number of mole (n) =?

PV = nRT

n = PV /RT

n = (0.975 x 0.674)/(0.08206x301)

n = 0.0266 mole

Step 4:

Determination of the molar mass of the alkane.

Mass of alkane = 1.17g

Number of mole of the alkane = 0.0266mole

Molar Mass of the alkane =?

Number of mole = Mass/Molar Mass

Molar Mass = Mass/number of mole

Molar Mass of the alkane = 1.17/0.0266 = 44g/mol

Step 5:

Determination of the molecular formula of the alkane.

This is illustrated below:

The general formula for the alkane is CnH2n+2

To obtain the molecular formula for the alkane we shall assume n = 1, 2, 3 or more till we arrive at molar Mass of 44.

When n = 1

CnH2n+2 = CH4 = 12 + (4x1) = 16g/mol

When n = 2

CnH2n+2 = C2H6 = (12x2) + (6x1) = 30g/mol

When n = 3

CnH2n+2 = C3H8 = (12x3) + (8x1) = 44g/mol

We can see that when n is 3, the molar mass is 44g/mol.

Therefore, the molecular formula for the alkane is C3H8.

7 0
2 years ago
HackerCards is a trendy new card game. Each type of HackerCard has a distinct ID number greater than or equal to 1, and the cost
joja [24]

Answer:

I don't know if this is right output is {1,3}

Explanation:

5 0
2 years ago
Other questions:
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • [20 POINTS] Jaime has to configure the dmz network of his organization to the optimum level. Which is the best practice to do so
    7·2 answers
  • Prompt: Which references and reference formats are you most likely to use? Why?<br><br><br> ED2020
    13·2 answers
  • Which of the following dimensions of e-commerce technology involves the integration of video, audio, and text marketing messages
    11·1 answer
  • Replace any alphabetic character with '_' in 2-character string passCode. Ex: If passCode is "9a", output is:9_Hint: Use two if
    15·1 answer
  • Will mark brainliest if correct. First come, first serve.
    15·1 answer
  • 9.6 Code Practice: Question 1
    9·1 answer
  • Flight Simulation software, which imitates the experience of flying, is often used to train airline pilots. Which of the followi
    10·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    9·1 answer
  • Design and implement an algorithm that gets as input a list of k integer values N1, N2,..., Nk as well as a special value SUM. Y
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!