This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| candidateage = 30 | |
| candidate_exp = 5 | |
| candidate_salary_expectation = 95000 | |
| ''' | |
| if candidateage>18: | |
| if candidate_exp>=2: | |
| if candidate_salary_expectation<=100000: | |
| print("Congrats ! You Are Eligible for the job") | |
| else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if candidateage>18 & candidate_exp>=2 & candidate_salary_expectation<=10000: | |
| print("Congrats ! You Are Eligible for the job") | |
| else: | |
| print("Not! eligible") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| x = 5 | |
| if x==5: print('x equals 5') | |
| for i in range(x+5): print(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| condition = True | |
| x = 1 if condtion else 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| check = lambda x:True if x%5==0 else False | |
| check(10) ## True | |
| check(12) ## False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from algorithms.sort import merge_sort | |
| if __name__ == "__main__": | |
| my_list = [1, 8, 3, 5, 6] | |
| my_list = merge_sort(my_list) | |
| print(my_list) | |
| ------------------------------------------------ | |
| [1, 3, 5, 6, 8] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from moviepy.editor import * | |
| video = VideoFileClip("sample_video.mp4") ## Video Link | |
| # Make the text. Many more options are available. | |
| txt_clip = ( TextClip("Live Your Dream To The Fullest",fontsize=70,color='white') | |
| .set_position('center') | |
| .set_duration(10) ) | |
| result = CompositeVideoClip([video, txt_clip]) # Overlay text on video |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Taking Two Integers as input | |
| a,b = map(int,input().split()) | |
| print("a:",a) | |
| print("b:",b) | |
| ## Taking a List as input | |
| arr = list(map(int,input().split())) | |
| print("Input List:",arr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arr = [2,4,6,3,8,10] | |
| for index,value in enumerate(arr): | |
| print(f"At Index {index} The Value Is -> {value}") | |
| '''Output | |
| At Index 0 The Value Is -> 2 | |
| At Index 1 The Value Is -> 4 | |
| At Index 2 The Value Is -> 6 | |
| At Index 3 The Value Is -> 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def check_anagram(first_word, second_word): | |
| return sorted(first_word) == sorted(second_word) | |
| print(check_anagram("silent", "listen")) # True | |
| print(check_anagram("ginger", "danger")) # False |