WGU D522 PYTHON FOR IT
AUTOMATION SCRIPTING GUIDE WITH
100 PERCENT CORRECT ANSWERS
◉ int_num = int(float_num)
Answer: converting something to integer, int
same for x = float(y)
x = round(y)
x=abs(y) - absoluite value
◉ You can create multiple strings with
Answer: three quotes
◉ Repitition (*)
Answer: repeat a string
◉ concatenation (+)
Answer: combine two strings
◉ Indexing ([])
, Answer: accessing individual characters by position. First pos is 0.
◉ (f-strings)
Answer: stands for format. Replaces the name of any variable in
braces with its value.
◉ \n
\t
Answer: new line
new tab
◉ string slicing
Answer: refers to the technique of extracting a portion of a string
by specifying a range of indices
start, stop, and step
◉ string [start:stop:step]
Answer: start is where slicing begins
-if not provided default to beginning of string
stop is where slicing ends
- if not provided default to end of string
AUTOMATION SCRIPTING GUIDE WITH
100 PERCENT CORRECT ANSWERS
◉ int_num = int(float_num)
Answer: converting something to integer, int
same for x = float(y)
x = round(y)
x=abs(y) - absoluite value
◉ You can create multiple strings with
Answer: three quotes
◉ Repitition (*)
Answer: repeat a string
◉ concatenation (+)
Answer: combine two strings
◉ Indexing ([])
, Answer: accessing individual characters by position. First pos is 0.
◉ (f-strings)
Answer: stands for format. Replaces the name of any variable in
braces with its value.
◉ \n
\t
Answer: new line
new tab
◉ string slicing
Answer: refers to the technique of extracting a portion of a string
by specifying a range of indices
start, stop, and step
◉ string [start:stop:step]
Answer: start is where slicing begins
-if not provided default to beginning of string
stop is where slicing ends
- if not provided default to end of string