From 660feaa042b930dc09b550a28e1cbeb1da4f6cbd Mon Sep 17 00:00:00 2001 From: JibinJoseph2000 <49112780+JibinJoseph2000@users.noreply.github.com> Date: Thu, 3 Oct 2019 18:17:35 +0400 Subject: [PATCH 1/2] Updated version --- Basics/greet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Basics/greet.py b/Basics/greet.py index aa0c635..2158d7d 100644 --- a/Basics/greet.py +++ b/Basics/greet.py @@ -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") From 203f95bf4f87877b363ee46fa35b05db71fcf074 Mon Sep 17 00:00:00 2001 From: JibinJoseph2000 <49112780+JibinJoseph2000@users.noreply.github.com> Date: Mon, 27 Sep 2021 19:43:40 +0530 Subject: [PATCH 2/2] Create prgm-1.py --- Coding Questions/prgm-1.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Coding Questions/prgm-1.py diff --git a/Coding Questions/prgm-1.py b/Coding Questions/prgm-1.py new file mode 100644 index 0000000..ae19d52 --- /dev/null +++ b/Coding Questions/prgm-1.py @@ -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) +