Python String Manipulation, If else and iteration example

## program to demonstrate input output of strings

import time

print ('Hello there I am Python \n')
name= input('What is your name ? \n')
print ('Hi,'+ name + ' Welcome \n')
age = input('What is your age in years?  \n')
age = int(age)
if age >= 18 :
    print('You can apply for driving license\n')
    choice = input('Do you want to apply Y/N \n')
    if choice == 'Y' or choice =='y' :
        print('Come to nearest Driving Test Centre')

        print('Then why are you wasting my time, Buzz off')

    print('Sorry ' + name + 'you are under age ')

""" For iteration
print (' Reversing your age')
while age > 1 :
    print (age)
    age -=1
    print('You are now ' + str(age)+' Years old')
now = time.time()
print (time.strftime("%b,%d,%Y, %H:%M:%S", time.gmtime(now)))
print (time.timezone)

## End Code

Leave a Reply