diff --git a/scripts/convert_ hours_to_seconds/convert_hours_to_seconds.py b/scripts/convert_ hours_to_seconds/convert_hours_to_seconds.py new file mode 100644 index 0000000..0cdea5f --- /dev/null +++ b/scripts/convert_ hours_to_seconds/convert_hours_to_seconds.py @@ -0,0 +1,13 @@ +#function to convert hours to seconds +def convert_to_seconds(hours): + + seconds = hours*60*60 + + return seconds + +# Driver program +hours = int(input("\nEnter number of hours: ")) + +seconds=convert_to_seconds(hours) + +print(hours, "hour/s = ", seconds, "seconds") diff --git a/scripts/create_password/create_random_password.py b/scripts/create_password/create_random_password.py new file mode 100644 index 0000000..a584ae3 --- /dev/null +++ b/scripts/create_password/create_random_password.py @@ -0,0 +1,10 @@ +# create random password of given length +import string +import random +def create_password(length): + temp_password = '' + for i in range(length): + temp_password += random.choice(string.ascii_letters+ string.digits+'!@#$%^&*()') + return password +length=int(input("Enter length of password: ")) +print(create_password(length)) \ No newline at end of file