first group of challenges
This commit is contained in:
2
challenges20-26/challenge-020.py
Normal file
2
challenges20-26/challenge-020.py
Normal file
@@ -0,0 +1,2 @@
|
||||
name = str(input('enter your name to check length : '))
|
||||
print('{0} name length is {1}'.format(name, len(name)))
|
4
challenges20-26/challenge-021.py
Normal file
4
challenges20-26/challenge-021.py
Normal 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)))
|
4
challenges20-26/challenge-022.py
Normal file
4
challenges20-26/challenge-022.py
Normal 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)
|
4
challenges20-26/challenge-023.py
Normal file
4
challenges20-26/challenge-023.py
Normal 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]))
|
2
challenges20-26/challenge-024.py
Normal file
2
challenges20-26/challenge-024.py
Normal file
@@ -0,0 +1,2 @@
|
||||
any = str(input('Type any thing to display in UPPER case : '))
|
||||
print(any.upper())
|
7
challenges20-26/challenge-025.py
Normal file
7
challenges20-26/challenge-025.py
Normal 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())
|
9
challenges20-26/challenge-026.py
Normal file
9
challenges20-26/challenge-026.py
Normal 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)
|
Reference in New Issue
Block a user