Python Interview Question asked by Oracle Company.

  Рет қаралды 2,858

CloudyML

CloudyML

Күн бұрын

Пікірлер: 9
@gururajag8796
@gururajag8796 2 жыл бұрын
Super
@ashwinr5058
@ashwinr5058 2 жыл бұрын
Explanation was perfect 👌
@suhaskishore1615
@suhaskishore1615 Жыл бұрын
AMAZING EXPLANATION!!!!
@CloudyML
@CloudyML Жыл бұрын
Thanks Suhas😄
@ipvikas
@ipvikas 2 жыл бұрын
# INPUT: # The input consists of 3 lines. The first line contains the integer N, denoting the length of the list. The next line consists of N space-separated lowercase English letters, denoting the elements of the list. The third and the last line of input contains the integer K, denoting the number of indices to be selected. # OUTPUT: # Output a single line consisting of the probability that at least one of the indices selected contains the letter 'b' # example: for input as ['b', 'b', 'c', 'd'], output should be 0.8333 from itertools import combinations N = int (input()) #print (N) L = input().split() # print(L) K = int(input()) C = list(combinations(L,K)) F = filter (lambda c : 'b' in c, C) print('{0: .3}'.format(len(list(F))/len(C)))
@ipvikas
@ipvikas 2 жыл бұрын
Thanks a lot!!!
@navneetsinghtaneja5002
@navneetsinghtaneja5002 2 жыл бұрын
Easy question, but one question ye hain mind main ki jab tak detail vala question nhi samjha tha tab tak samajh ni aya tha kya karna hain
@KaushalKumar-ic8qj
@KaushalKumar-ic8qj 2 жыл бұрын
What I get from question...indices means index which was 'to be selected' in the third line. Could you please explain why and how did you get to know that it would be in pairs and you decided to use tuple for that. The solution is easy, but I want to understand third point of the question more...If you could explain more..Thanks in advance.
@CloudyML
@CloudyML 2 жыл бұрын
It's given 2 in 3rd line, 2 here means pair of 2. Then we decided to use tuple. Sometimes you need to read question multiple times to understand what they are asking. Sorry for the late reply, I got this comment while cross checking, since We did not get notification.
Pandas for Data Science in 20 Minutes | Python Crash Course
23:06
Nicholas Renotte
Рет қаралды 138 М.
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 63 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 98 МЛН
Python Decorators in 15 Minutes
15:14
Kite
Рет қаралды 453 М.
BGP Interview Questions and Answers - BGP Scenario Based Questions
2:04:20
I-MEDITA (IT Training Academy)
Рет қаралды 9 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 99 МЛН
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,2 МЛН
How To Become a Python Developer (2024 Roadmap)
28:21
Loïs Talagrand
Рет қаралды 13 М.
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 63 МЛН