Stringb="A card is drawn at random from a pack of 52 playing cards. Find the probability that the card drawn is (i) a king (ii) neither a queen nor a jack.";
test_str="1. 21 bricks have a mean mass of 24.2 kg, and 29 similar bricks have a mass of 23.6 kg. Determine the mean mass of the 50 bricks."
matches=re.finditer(regex,test_str,re.MULTILINE)
formatchNum,matchinenumerate(matches,start=1):
print("Match {matchNum} was found at {start}-{end}: {match}".format(matchNum=matchNum,start=match.start(),end=match.end(),match=match.group()))
forgroupNuminrange(0,len(match.groups())):
groupNum=groupNum+1
print("Group {groupNum} found at {start}-{end}: {group}".format(groupNum=groupNum,start=match.start(groupNum),end=match.end(groupNum),group=match.group(groupNum)))
from_list=["What is the probability that when two cards are drawn from a deck of cards without replacement that both of them will be 8’s?",
"What is the probability that both cards drawn (without replacement) will be spades?",
"What is the probability of drawing a red king and then a black 7 without replacement?",
"What is the probability of being dealt a flush (5 cards of all the same suit) from the first 5 cards in a deck?",
"What is the probability of drawing two face cards, and then 2 numbered cards, without replacement?",
"What is the probability of drawing an Ace 3 times in a row with replacement?",
"A card is drawn at random from a pack of 52 playing cards. Find the probability that the card drawn is (i) a king (ii) neither a queen nor a jack.",
"A card is drawn from a well-shuffled pack of 52 cards. Find the probability of getting: (i) ‘2’ of spades (ii) a jack (iii) a king of red colour (iv) a card of diamond (v) a king or a queen",
"A card is drawn from a well shuffled pack of 52 cards. Find the probability of: (i) ‘2’ of spades (ii) a jack (iii) a king of red colour (iv) a card of diamond (v) a king or a queen (vi) a non-face card (vii) a black face card (viii) a black card (ix) a non-ace (x) non-face card of black colour (xi) neither a spade nor a jack (xii) neither a heart nor a red king",
"A card is drawn at random from a well-shuffled pack of cards numbered 1 to 20. Find the probability of (i) getting a number less than 7 (ii) getting a number divisible by 3.",
"If you pull 2 cards out of a deck, what is the probability that both are spades?"]
to_list=["What is the probability of drawing a red king and then a black 7 without replacement?"]
What is the probability that two cards drawn at random from a deck of playing cards will both be aces
"If you pull 2 cards out of a deck, what is the probability that both are spades"
"If you draw two cards from a deck, what is the probability that you will get the Ace of Diamonds and a black card"
What is the probability that when two cards are drawn from a deck of cards without replacement that both of them will be 8’s
What is the probability that both cards drawn (without replacement) will be spades
What is the probability of drawing a red king and then a black 7 without replacement
What is the probability of being dealt a flush (5 cards of all the same suit) from the first 5 cards in a deck
"What is the probability of drawing two face cards, and then 2 numbered cards, without replacement"
What is the probability of drawing an Ace 3 times in a row with replacement
"A card is drawn at random from a pack of 52 playing cards. Find the probability that the card drawn is
(i) a king
(ii) neither a queen nor a jack."
"A card is drawn from a well-shuffled pack of 52 cards. Find the probability of getting:
(i) ‘2’ of spades
(ii) a jack
(iii) a king of red colour
(iv) a card of diamond
(v) a king or a queen"
"A card is drawn from a well shuffled pack of 52 cards. Find the probability of:
(i) ‘2’ of spades
(ii) a jack
(iii) a king of red colour
(iv) a card of diamond
(v) a king or a queen
(vi) a non-face card
(vii) a black face card
(viii) a black card
(ix) a non-ace
(x) non-face card of black colour
(xi) neither a spade nor a jack
(xii) neither a heart nor a red king"
"A card is drawn at random from a well-shuffled pack of cards numbered 1 to 20. Find the probability of
(i) getting a number less than 7
(ii) getting a number divisible by 3."
Consider the example of finding the probability of selecting a black card or a 6 from a deck of 52 cards.
"What is the probability of drawing a king and a queen consecutively from a deck of 52 cards, without replacement."
Two cards are drawn at random from an ordinary deck of 52 card. Find the probability P that (a) Both are spade (b) One is a spade and one is heart
"Say, a coin is tossed twice. What is the probability of getting two consecutive tails ?"
A single coin is tossed 5 times. What is the probability of getting at least one head?
How many combinations can 2 dice make?
What are the odds of rolling a 12 with two dice?
What is the probability of rolling a 4 or 7 for two 6 sided dice?
Probability of rolling more than a 5
What is the probability of rolling a 5 when a die is rolled?
What is the probability of getting a 2 or a 5 when a die is rolled?
What is the probability of the occurrence of a number that is odd or less than 5 when a fair die is rolled.
"When two dice are rolled, find the probability of getting a greater number on the first die than the one on the second, given that the sum should equal 8."
A die is rolled thrice. What is the probability that the sum of the rolls is atleast 5.
"A dice is rolled repeatedly and X, the total score from all the rolls is kept. The game stops when the dice lands on either one or two, Find : 1. P(X =10) 2. The probability the first roll was 6 given X was 10"