From 631340a20ffa3e6a80f84ccd87aa87fb7415cd11 Mon Sep 17 00:00:00 2001 From: rakesh Date: Sat, 20 Jul 2019 20:50:32 +0530 Subject: [PATCH] Search in Hetrogenious data --- DataStructure/hetro.py | 17 +++++++++++++++++ similar_word.py | 2 +- string/reverseString.py | 2 +- webscraper/youtubeDownloader.py | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 DataStructure/hetro.py diff --git a/DataStructure/hetro.py b/DataStructure/hetro.py new file mode 100644 index 0000000..de3ed10 --- /dev/null +++ b/DataStructure/hetro.py @@ -0,0 +1,17 @@ +# program to search an element from a list of different type of values +# Developed by : rakesh kumar +# Last revised on : 20-lujy-2019 + +list =[10,20,'a','abc',40,50.6] +a = input("Enter any number") +try: # if we are able to type cast the value + b = eval(a) + if b in list: + print("found") + else: + print("not found") +except: # if some run time error occur while conversion + if a in list: + print("Found") + else: + print("not found") diff --git a/similar_word.py b/similar_word.py index d3350ca..8050577 100644 --- a/similar_word.py +++ b/similar_word.py @@ -1,5 +1,5 @@ # Python program to print the similar -# words using Enchant module +# words using Enchant module # Importing the Enchant module import enchant diff --git a/string/reverseString.py b/string/reverseString.py index 6696108..7ede82b 100644 --- a/string/reverseString.py +++ b/string/reverseString.py @@ -1,3 +1,3 @@ str = "This is original string" rev = ''.join(reversed(str)) -print(rev) \ No newline at end of file +print(str[::-1]) \ No newline at end of file diff --git a/webscraper/youtubeDownloader.py b/webscraper/youtubeDownloader.py index 7a53bc0..2703d85 100644 --- a/webscraper/youtubeDownloader.py +++ b/webscraper/youtubeDownloader.py @@ -4,4 +4,4 @@ import shutil ydl_opts = {} with youtube_dl.YoutubeDL(ydl_opts) as ydl: - ydl.download(['https://www.youtube.com/watch?v=AOcWELTI56Q&index=3&list=PLbpAWbHbi5rMM3i--gfgjwQ404DZmwwd3']) \ No newline at end of file + ydl.download(['https://www.youtube.com/watch?v=HgwCeNVPlo0']) \ No newline at end of file