There are two different methods for putting in a place holder for numeric values.
Answers
Answer:Working with placeholders¶
Placeholders can make adding content a lot easier. If you’ve ever added a new textbox to a slide from scratch and noticed how many adjustments it took to get it the way you wanted you understand why. The placeholder is in the right position with the right font size, paragraph alignment, bullet style, etc., etc. Basically you can just click and type in some text and you’ve got a slide.
A placeholder can be also be used to place a rich-content object on a slide. A picture, table, or chart can each be inserted into a placeholder and so take on the position and size of the placeholder, as well as certain of its formatting attributes.
Access a placeholder¶
Every placeholder is also a shape, and so can be accessed using the shapes property of a slide. However, when looking for a particular placeholder, the placeholders property can make things easier.
The most reliable way to access a known placeholder is by its idx value. The idx value of a placeholder is the integer key of the slide layout placeholder it inherits properties from. As such, it remains stable throughout the life of the slide and will be the same for any slide created using that layout.
It’s usually easy enough to take a look at the placeholders on a slide and pick out the one you want:
>>> prs = Presentation()
>>> slide = prs.slides.add_slide(prs.slide_layouts[8])
>>> for shape in slide.placeholders:
... print('%d %s' % (shape.placeholder_format.idx, shape.name))
...
0 Title 1
1 Picture Placeholder 2
2 Text Placeholder 3
… then, having the known index in hand, to access it directly:
>>> slide.placeholders[1]
<pptx.parts.slide.PicturePlaceholder object at 0x10d094590>
>>> slide.placeholders[2].name
'Text Placeholder 3'
Note
Item access on the placeholders collection is like that of a dictionary rather than a list. While the key used above is an integer, the lookup is on idx values, not position in a sequence. If the provided value does not match the idx value of one of the placeholders, KeyError will be raised. idx values are not necessarily contiguous.
In general, the idx value of a placeholder from a built-in slide layout (one provided with PowerPoint) will be between 0 and 5. The title placeholder will always have idx 0 if present and any other placeholders will follow in sequence, top to bottom and left to right. A placeholder added to a slide layout by a user in PowerPoint will receive an idx value starting at 10.
Answer:
True
Explanation:
In Python, you can use {} as placeholders for strings and use format() to fill in the placeholder with string literals.