Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit af74a9c

Browse files
add question
1 parent 5b1ddc7 commit af74a9c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Print list in reverse order using a loop
2+
3+
list1 = [10, 20, 30, 40, 50]
4+
# reverse list
5+
new_list = reversed(list1)
6+
# iterate reversed list
7+
for item in new_list:
8+
print(item)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#wap to check if a singal character is a vowel or not
2+
ch = input ("Enter a Singal Character: ")
3+
if ch.lower() in ('a', 'e', 'i', 'o', 'u'):
4+
print(ch,"is a vowel")
5+
else:
6+
print(ch," is not a vowel")
7+
8+
#WAP to check if the 3rd last character of a string is a vowel or not
9+
10+
str1 = input("Enter a string: ")
11+
if len(str1)<= 2:
12+
print("given the word is too small")
13+
else:
14+
ch = str1[-3]
15+
if ch.lower() in ('a', 'e', 'i', 'o', 'u'):
16+
print(ch, "is a vowel")
17+
else:
18+
print(ch, "is not a vowel")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /