jeudi 5 mars 2020

How to print only First name in print()

a = input("Enter your Full Name ")
b = int(input("Enter your age "))
if b >= 20:
  print("You can drive " + a)
else:
  print("You can't drive " + a + " You are underage")

i want to print only first name here, so if given name is Don Jon then the output should be "You can drive Don" or You can't drive Don You are underage

Aucun commentaire:

Enregistrer un commentaire