0% found this document useful (0 votes)
3 views1 page

Coding Lawrence

The document contains a Python script that prompts the user for their name and checks if it consists only of alphabetic characters. It also asks for the user's age, validating it within a specific range, and then requests a first and last name to check for alphabetic input. Finally, it takes two numbers as input and performs a division, ensuring the second number is not zero.

Uploaded by

kangc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Coding Lawrence

The document contains a Python script that prompts the user for their name and checks if it consists only of alphabetic characters. It also asks for the user's age, validating it within a specific range, and then requests a first and last name to check for alphabetic input. Finally, it takes two numbers as input and performs a division, ensuring the second number is not zero.

Uploaded by

kangc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

name = input("name: \n")

x = name.isalpha()
print (x)

----------------------------------------------------------------------------------------------------------------------------

number = int(input("age? \n"))

while number <= 1 or number >= 99:


print("False")
Break

else :
print(str(number) + " is True")
name1 = input("first name: \n")
x = name1.isalpha()
name2 = input("last name: \n")
y = name2.isalpha()
print (x,y)

----------------------------------------------------------------------------------------------------------------------------

num1 = int(input("first num: \n"))


num2 = int(input("second num: \n"))
if num2<=0:
print("invalid")
exit()
print(num1/num2)

----------------------------------------------------------------------------------------------------------------------------

You might also like