Using the knowledge of computational language in python it is possible to write a code that program reads a list of single-word first names and ages (ending with -1), and outputs that list with the age incremented.
Writting the code:# Split input into 2 parts: name and age
parts = input().split()
name = parts[0]
while name != '-1':
# Insert try/except blocks to catch the exception.
try:
age = int(parts[1]) + 1
# printing name and age
print('{} {}'.format(name, age))
except ValueError:
# printing name and age as 0
print('{} {}'.format(name, 0))
# Get next line
parts = input().split()
name = parts[0]
See more about python at brainly.com/question/18502436
#SPJ1
What is output if the user types in 7? Click all that apply.
Based on the code that is given below, the output if the user types in 8 is option C: C.
What is the line of code about?The code above is an if statement: A will not be printed since the user had specified x = 8, which does not satisfy the criterion x!= 8 (!= stands for not equal).
Since x must be greater than or equal to 10 in order to satisfy the criterion for "B" to be printed, "B" will not be printed because x does not meet the condition.
Also x is less than 10, the requirement of x10 is satisfied, and "C" will be printed as a result.
Learn more about coding from
https://brainly.com/question/20312196
#SPJ1
See correct question below
x = int (input ("Enter a number: "))
if (x != 8):
print ("A")
if (x >= 10):
print ("B")
if (x < 10):
print ("C")
if (x % 2 == 1):
print ("D")
What is output if the user types in 8? Click all that apply.
A
B
C
D
4. Some programs add extra characters,
called a(n)________, to
a file name.
Answer:
big letters
Explanation:
in order for the file to be more impacable