-
Notifications
You must be signed in to change notification settings - Fork 0
/
1.PythonBasics.py
27 lines (25 loc) · 867 Bytes
/
1.PythonBasics.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#Using print function where I am sending the arguments what I want to print
print("Hello wooorld!")
print("What is your name?")
#Using the input function where it will take input from my input device and save in the myName variable
myName = input()
print("Length of your name is: ")
#the len function will determine the length of myName string
print(len(myName))
print("How are you?",myName)
myStatus = input()
print("Is it AM or PM time now?")
timeStatus = input()
if timeStatus == 'AM':
print("Whats the time in AM now?")
#Concerting the format from string to integer and saving to time, as input function always makes inputs strings
time = int(input())
else:
print("Whats the time in PM now?")
time = int(input())
print("So in 24hours format the time will be: ")
if timeStatus == "PM" :
time = 12 + time
else:
time = time
print(time)