5th day of python challenges 80-87

This commit is contained in:
abd.shallal
2019-07-22 15:22:11 +03:00
parent 6a11f68f12
commit d4902e6ad1
10 changed files with 196 additions and 49 deletions

View File

@@ -0,0 +1,5 @@
first_name = str(input('Enter your first name : '))
print('Your first name length is {0}'.format(len(first_name)))
sure_name = str(input('Enter your sure name : '))
print('Your surname length is {0}'.format(len(sure_name)))
print('{0} {1} name length is {2}'.format(first_name, sure_name, len(first_name+' '+sure_name)))

View File

@@ -0,0 +1,3 @@
school_subject = str(input('Enter your favourite school subject? : '))
for i in school_subject:
print(i)

View File

@@ -0,0 +1,5 @@
poem = 'Here we stand, and still we fight until we won'
print(poem)
start_point = int(input('Enter start point in this poem : '))
end_point = int(input('Enter end point in this poem : '))
print(poem[start_point: end_point])

View File

@@ -0,0 +1,8 @@
string = str(input('Please enter word in upper case ? '))
is_upper = False
while not is_upper:
if string.isupper():
is_upper = True
else:
string = str(input('Sorry not all in upper case, please enter word in upper case ? '))
print(string)

View File

@@ -0,0 +1,2 @@
post_code = str(input('Enter your postcode'))
print(post_code[0:2])

View File

@@ -0,0 +1,7 @@
name = str(input('Enter your name ? : '))
vowel = ['a', 'i', 'e' 'o', 'u']
count = 0
for i in name:
if i.lower() in vowel:
count = count + 1
print('the number of vowels in your name {0}'.format(count))

View File

@@ -0,0 +1,8 @@
password = str(input('Enter password : '))
re_password = str(input('Re-enter password : '))
if password == re_password:
print('Thank you')
elif password != re_password:
print('They must be in the same case')
else:
print('Incorrect')

View File

@@ -0,0 +1,9 @@
string = str(input('Enter a word : '))
length = len(string)
count = 1
for i in string:
position = length - count
letter = string[position]
print(letter)
count = count + 1
# easy way is type string[::-1]