Question

Using Python Assigns the value “Phil” to the variable SomeName. Uses the len function and the...

Using Python

  1. Assigns the value “Phil” to the variable SomeName.
  2. Uses the len function and the SomeName variable to assign the number of letters in Phil’s name to the variable NameLength.
  3. Outputs the following using a print statement (the print statement should output the quotation marks and the values of the SomeName and NameLength variables where indicated by the [brackets]):
    “I very much enjoy infinite loops,” said [value of SomeName], whose name is [value of NameLength] letters long.
    1. Use placeholders to insert the variable values into your print statement.

Homework Answers

Answer #1

Please upvote if you are able to understand this and if there is any query do mention it in the comment section.

CODE:

SomeName = "Phil"
NameLength = len(SomeName)#using len function to calculate the length of SomeName
#using the format method for placeholders
print("I very much enjoy infinite loops, said {0} whose name is {1} letters long".format(SomeName, NameLength))

OUTPUT:

If there is still any doubt then please mention it in the comment section otherwise please upvote.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using Python Assigns the value of “dog” to the variable AnimalName. Assigns the value of “pigeon”...
Using Python Assigns the value of “dog” to the variable AnimalName. Assigns the value of “pigeon” to the variable AltAnimal. Includes an if-statement in which… (Hint: You should use both elif and else.) If the value of AnimalName is “cat”, prints “The animal is a cat.” Includes a comment on the same line as this if-statement that explains what the if-statement is looking for (i.e., what would have to be true for the statement to return “true”). If the value...
Using python Asks the user to input their favorite integer and assigns this value to the...
Using python Asks the user to input their favorite integer and assigns this value to the variable somenumber. Converts somenumber to an integer. Outputs the square, square root, and cube root of somenumber, with each output labeled (e.g., “The square of your integer is…”) and outputted on a separate line.
Use Python to Complete the following on a single text file and submit your code and...
Use Python to Complete the following on a single text file and submit your code and your output as separate documents. For each problem create the necessary list objects and write code to perform the following examples: Sum all the items in a list. Multiply all the items in a list. Get the largest number from a list. Get the smallest number from a list. Remove duplicates from a list. Check a list is empty or not. Clone or copy...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT