Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Basics/greet.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#This programs says hello and asks for a name and greets the user

print("Hello,There")
print("Hello,There...")

Uname = input("Please,Enter your sweet Name:") #taking input(user name) from the user
Uname = input("Please,Enter your sweet Name:") #taking name from the user

print("It's nice to meet you,"+ Uname) #printing the greeting output
print("Welcome to the Python world")
26 changes: 26 additions & 0 deletions Coding Questions/prgm-1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# A program to find the short form of a given word in a specific format.The conditions are given below
# Adjacent letters of a string are paired.From each pair one letter is selected
# The letter with highest ascii value is selected
# The letter is stored into str1 variable
# If a pair cannot be formed, then the last letter is added to str1




x = input()
n = len(x)
#print(n)
#print(ord(x[0]))
str1 = ''
for i in range(0,n,2):
if(i+1 < n):
if(ord(x[i]) > ord(x[i+1])):
str1 = str1 + x[i]
elif(ord(x[i]) < ord(x[i+1])):
str1 = str1 + x[i+1]
elif(ord(x[i]) == ord(x[i+1])):
str1 = str1 + x[i]
else:
str1 = str1 + x[n-1]
print(str1)