first group of challenges

This commit is contained in:
abd.shallal
2019-07-17 09:56:46 +03:00
commit 375875c7a1
379 changed files with 107059 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
name = str(input('enter your name to check length : '))
print('{0} name length is {1}'.format(name, len(name)))

View File

@@ -0,0 +1,4 @@
first_name = str(input('Enter your first name : '))
surname = str(input('Enter your surname : '))
compact = first_name + ' ' + surname
print('{0} your name length is {1}'.format(compact, len(compact)))

View File

@@ -0,0 +1,4 @@
first_name = str(input('Enter your first name in lower-case : '))
surname = str(input('Enter your surname in lower-case : '))
compact = first_name.title() + ' ' + surname.title()
print(compact)

View File

@@ -0,0 +1,4 @@
rhyme = str(input('Enter the 1st. line of nursery rhyme : '))
start = int(input('Enter start number for display : '))
end = int(input('Enter end number for display : '))
print('this is the 1st. line \n {0} \n and this is truncated {1}'.format(rhyme, rhyme[start:end]))

View File

@@ -0,0 +1,2 @@
any = str(input('Type any thing to display in UPPER case : '))
print(any.upper())

View File

@@ -0,0 +1,7 @@
first_name = str(input('Enter your first name : '))
if len(first_name) < 5:
surname = str(input('Enter your surname : '))
compact = first_name.upper() + surname.upper()
print(compact)
else:
print(first_name.lower())

View File

@@ -0,0 +1,9 @@
word = str(input('Please enter a word : '))
first = word[0]
length = len(word)
rest = word[1:length]
if first != 'a' and first != 'e' and first != 'i' and first != 'o' and first != 'u':
newword = rest + first + 'ay'
else:
newword = word+'ay'
print(newword)