Python code to create batch file.
0:28
Python code to create batch file
0:39
python code to create a mp3 audio
1:14
Пікірлер
@Betta_world128
@Betta_world128 7 сағат бұрын
Thanks bro
@user-vj2ee8vk8g
@user-vj2ee8vk8g 2 ай бұрын
Array = [9,3,2,4,5,4] Array.sort(reverse=True) print(Array)
@nitheshm5031
@nitheshm5031 3 ай бұрын
Its kinda selection sort
@user-cy4ph2jl7f
@user-cy4ph2jl7f 3 ай бұрын
Boblesort
@rahulvishwakarma6235
@rahulvishwakarma6235 3 ай бұрын
better:- str = hello str1= str[: : -1] print(str1)
@adityaanuragi6916
@adityaanuragi6916 4 ай бұрын
Time complexity is n2 terrible solution
@ramuannadurai
@ramuannadurai 5 ай бұрын
Why use bubble sort. When you have timsort inbuilt😅
@it41148
@it41148 9 ай бұрын
illuminati shii
@JustforFun-qj3fg
@JustforFun-qj3fg 10 ай бұрын
It's doesn't work if have same elements
@sourabhmori8129
@sourabhmori8129 10 ай бұрын
if list = [2,3,4,5,6,6,6] what will be the solution in this senario ?
@Michael-kq3qm
@Michael-kq3qm 11 ай бұрын
array.sort()
@Your_localAndrew
@Your_localAndrew 2 ай бұрын
And print(array)
@TurtlemanUPG
@TurtlemanUPG 11 ай бұрын
C = '*' for i in range(1, 10): Print(i*C)
@banjoller
@banjoller Жыл бұрын
array = [1,4,6,3,6,4,6,9] n = len(array) for i in range(0, n): for j in range(i+1, n): if(array[i]>array[j]): temp = array[i] array[i] = array[j] array[j] = temp print(array)
@devenderbhatt421
@devenderbhatt421 Жыл бұрын
Bad solution o(n2) complexity sorry😢
@nedalalaoui3089
@nedalalaoui3089 Жыл бұрын
👐
@akashwnl3337
@akashwnl3337 Жыл бұрын
We can use swapcase instead of temp
@akashwnl3337
@akashwnl3337 Жыл бұрын
Line 7 revstr != str is correct condition
@Ruben-ho9jd
@Ruben-ho9jd Жыл бұрын
It can be done in O(n) time complexity using two separate for loops. max = float("-inf'0 for i in range (0, len(array1)): if (array1[i] > max): max = array1[i] max2 = float("-inf") for i in range(0, len(array1)): if (array[i] > max2 and array[i] != max): max2 = array[i] return max2
@Rubyd777
@Rubyd777 Жыл бұрын
You can do it in single loop in n times
@pajvarma
@pajvarma Жыл бұрын
It's not a pyramid brother
@osretrogames64
@osretrogames64 Жыл бұрын
Linux users opening an application:
@TecRox-
@TecRox- Жыл бұрын
The time complexity is O(n2) 🤒
@faaiqrahman669
@faaiqrahman669 Жыл бұрын
Create a number question with 5 rows and make all options as unique values also extract first highest and second highest number in next follow up question....plz programm this in python
@PoosuLunda69
@PoosuLunda69 Жыл бұрын
Can someone pls explain the working of nested for loop here in this program . Will be glad if someone clarifies me!!. Got stuck in this program. :(
@ChhayaKamble-ft1fd
@ChhayaKamble-ft1fd Жыл бұрын
Done = sorted(array1) print(Done[-2])
@ChhayaKamble-ft1fd
@ChhayaKamble-ft1fd Жыл бұрын
The code can be improved further. Just use sorted() function in list and get the second last index with -2
@immor8al808
@immor8al808 Жыл бұрын
Bro He has used Bubble sort to sort the list
@ramisettyharsha9251
@ramisettyharsha9251 11 ай бұрын
not lists we need to solve in arrays
@azziazzi9810
@azziazzi9810 7 ай бұрын
array.sort(reverse=True) for x in range(1,len(a)): if a[x]!=a[x-1]: print(a[x]) break
@ab_web_surfer_
@ab_web_surfer_ Жыл бұрын
This is bubble sort right
@abhiramjayan6034
@abhiramjayan6034 Жыл бұрын
Is this realy bubble sort its insertion sort right
@WinterNox
@WinterNox Жыл бұрын
I don't know if people will ask you to make a right angle triangle in the terminal on an interview.
@_____JUNPark_____
@_____JUNPark_____ Жыл бұрын
Bruh. Just use str[::-1]. (string slice, [start:end:step])
@_____JUNPark_____
@_____JUNPark_____ Жыл бұрын
I perfer to use filter function for that.
@maxspies8908
@maxspies8908 Жыл бұрын
array = [9, 3, 2, 4, 5, 4] print(sorted(array, key=lambda x: x[1]))
@naveenkumarmarrapu
@naveenkumarmarrapu Жыл бұрын
It is right-angled triangle, Not pyramid.
@Account-oz5vd
@Account-oz5vd Жыл бұрын
Nailed the damm interview.
@Veigaburame
@Veigaburame Жыл бұрын
=.= you converted string to list instead of list to string ... but it still useful for me lol
@IQ_reviews
@IQ_reviews Жыл бұрын
Array = [9,3,2,4,5,4] Print(list(sorted(Array)))
@_____JUNPark_____
@_____JUNPark_____ Жыл бұрын
​​@@yt_user685 sortArray = lambda array: (type(array)) (sorted(array)) print(sortArray([3,2,4,1]))
@_____JUNPark_____
@_____JUNPark_____ Жыл бұрын
@@yt_user685 okay. Array = [6,3,4,5,2,6] __builtins__.print(__builtins__.sorted(Array))
@IQ_reviews
@IQ_reviews Жыл бұрын
#Using lambda Functions Array = [9,3,2,4,5,4] Array.sorted(key=lambda, Array: Array[1]) Print(Array)
@IQ_reviews
@IQ_reviews Жыл бұрын
Array = [9,3,2,4,5, 6] Print(list(sorted(Array)))
@yt_user685
@yt_user685 Жыл бұрын
@@IQ_reviews LOL
@maxspies8908
@maxspies8908 Жыл бұрын
​@@yt_user685 array = [9, 3, 2, 4, 5, 4] print(sorted(array, key=lambda x: x[1]))
@yt_user685
@yt_user685 Жыл бұрын
​@@maxspies8908 you cant use the function sort on interviews
@devenderbhatt421
@devenderbhatt421 Жыл бұрын
Mind left the chat whole point of question is to do it eithout sorting inbuilt function 😂😂
@ashutoshchoudhury1755
@ashutoshchoudhury1755 Жыл бұрын
Which source coder this is
@eddyxide
@eddyxide Жыл бұрын
Man, array1.sort()
@BunnyRabbit.
@BunnyRabbit. Жыл бұрын
build-in functions are not allowed in Exams.
@faisalshafiuddin1018
@faisalshafiuddin1018 Жыл бұрын
@@BunnyRabbit. thats what if we know the built in function already whats the point of seeing tutorials then hahahaah
@_____JUNPark_____
@_____JUNPark_____ Жыл бұрын
​@@BunnyRabbit. It's method.
@Michael-kq3qm
@Michael-kq3qm 11 ай бұрын
@@BunnyRabbit. Thats just stupid, exams are stupid then. Its part of the language, and its more efficient, so they are teaching students wrong, whats the point using python if you don't use the built in functions?
@josuemolina6124
@josuemolina6124 8 ай бұрын
@@Michael-kq3qm You are right, this is kind of stupid, but job interviews are just like this.
@karthikmadhavan4098
@karthikmadhavan4098 Жыл бұрын
L.sort() print(L[-2])
@deborshikashyap6745
@deborshikashyap6745 Жыл бұрын
You're using OnlineGDB
@rajsekharmuppidi736
@rajsekharmuppidi736 Жыл бұрын
I think it's not an array it's list
@herzeg6146
@herzeg6146 Жыл бұрын
arrays can be list, tuple, str, bytearray and e.tc
@guruyadavraj636
@guruyadavraj636 Жыл бұрын
Before square brackets he forgot to mention paranthesis
@monnichoudhory4406
@monnichoudhory4406 Жыл бұрын
Runtime error
@dotaxanime6689
@dotaxanime6689 Жыл бұрын
Can u please include an explanation to your code tnx
@time2enjoy301
@time2enjoy301 Жыл бұрын
useful bro
@time2enjoy301
@time2enjoy301 Жыл бұрын
thanks
@royalmech14
@royalmech14 Жыл бұрын
How did it work. Can anyone explain
@bhavaniryali9596
@bhavaniryali9596 2 жыл бұрын
With explanation please
@kakajsbdhdh
@kakajsbdhdh 2 жыл бұрын
Thanks a lot
@praveenrockcse2192
@praveenrockcse2192 2 жыл бұрын
Array1.sort() Print(-1) #done in two lines
@styleremo2879
@styleremo2879 2 жыл бұрын
-2 bro
@sofyanalwi35
@sofyanalwi35 Жыл бұрын
@@styleremo2879 Bruh. Starts from 0
@faridayasmeen7432
@faridayasmeen7432 Жыл бұрын
@@sofyanalwi35 it's -2 you can check it
@SN-oo2fq
@SN-oo2fq Жыл бұрын
School marks
@dannyezechukwu1175
@dannyezechukwu1175 Жыл бұрын
Definitely -2. -1 is the last element in the list which would be the max value after the list is sorted.