Final answer:
To write a program that prompts the user to enter two integers, calculates their quotient, and handles the case where the second integer is zero, use a try-except block. To write a function that raises a ValueError if a string contains non-alphabetic characters, use the isalpha() method.
Step-by-step explanation:
To write a program that prompts the user to enter two integers and calculates and prints their quotient, you can use the following Python code:
try:
num1 = int(input('Enter the first integer: '))
num2 = int(input('Enter the second integer: '))
quotient = num1 / num2
print('The quotient of', num1, 'and', num2, 'is', quotient)
except ZeroDivisionError:
print('Error: Cannot divide by zero')
To write a function that raises a ValueError if a string contains any non-alphabetic characters, you can use the following Python code:
def check_string(input_string):
if not input_string.isalpha():
raise ValueError('Error: Non-alphabetic characters found')
return input_string