python

[Solved] Maximum Score Of Spliced Array LeetCode Contest Problem

[Solved] Maximum Score Of Spliced Array LeetCode Contest Problem

You are given two 0-indexed integer arrays nums1 and nums2, both of length n. You can choose two integers left and right where 0 <= left <= right < n and swap the subarray nums1[left…right] with the subarray nums2[left…right]. For example, if nums1 = [1,2,3,4,5] and nums2 = [11,12,13,14,15] and you choose left = 1 and right = 2, nums1 becomes [1,12,13,4,5] and nums2 becomes [11,2,3,14,15]. You may choose to apply…

MCQs Python Programming 60+

MCQs Python Programming 60+

1. What will be the output of the following python code? a=2 def fun(a=3): global a a+=5 fun() print(a) Ans: Error 2. consider the following statement and choose the correct option: a=[10, 4, 1, 50, 8, 2] b=sorted(a, reverse=’No’) print(b)…

[Solved] Weak Password Problem with Python

[Solved] Weak Password Problem with Python

Weak Password: Write a program to obtain user details in CSV format. If the password entered by the user satisfies the following constraints, print the user details, else raise an exception “Your password is weak”.    A password is said…