FLAMES Game - Python Program | Interview Question
ฝัง
- เผยแพร่เมื่อ 16 พ.ย. 2019
- In this Python programming video tutorial you will learn to write the program to implement FLAMES Game in detail.
FLAMES is a fun game. Using this game we can find out the relationship between 2 people.
In FLAMES F stands for Friends L stands for Lovers A stands for Affectionate
M stands for Marriage E stands for Enemies and S stands for Siblings.
#Python #PythonProgramming
For more free tutorials on computer programming
/ amulsacademy
/ amulsacademy
I wonder why this channel is underated......it deserves more attention by python lovers
Thank you :)
This girl deserves more than a like and a subscribe.
I have been following this channel since a month.
There came no point where I struggled to understand the logic.
Thank you for this.(once again)
Do you have insta page for programming??
Hope you see my comment.
Thank you so much :)
I will create insta page soon :)
@@AmulsAcademy did you create
@@The_Voicee SIMP!!!!!! LOL BROTHER YOU GONNA WAIT TILL THE END OF YOUR LIFE xD.
YOU SIMPP!!!!! xDD
@@AmulsAcademy HEY thanks for the tutorial but becareful and stay away from these two guys xD
n=input("enter the first name")
m=input("enter the second name")
s1=len(n)
s2=len(m)
c=0
for i in n:
for j in m:
if i==j:
s1-=1
s2-=1
c=s1+s2
list=["f","l","a","m","e","s"]
x=c%6
while (len(list)>1):
if x==0:
list.pop(len(list)-1)
else:
list.pop(x-1)
x=c%len(list)
print(list)
i tried this logic..a bit simpler
Actually I started Python with a basic course this Jun20 and thought of doing some project to learn more. and First one came to mind was Flames. I could create a working model in first week of July itself in tkinter. Today i just thought of checking it again and re-wrote few functions and made look good (to my satisfaction except that removing 'FLAMES'). But this slicing part never appeared in my wildest imaginations. So I had to write crazy loop to start from the very next word after deleting. Then thought of better ways by googling.This is indeed simple and logical. Thanks a lot. No other words. simply superb way of coding and teaching. Looking forward to see more
Thank you :)
"thank you so much amulya" # [ we waiting next videos ]
nalla irukku akka
Vera level
Thanks u AMUL for making a game
Hope u doing more games
Amuls_Academy={ "Explanation" : "Neat" ," Voice-over" : "Sweet" }
Thank you :)
Not like a sweet அதுக்கும் மேல
@@t.gowthamarasu1258 tamil ahh
Mam hats off to your teaching efforts , speechless indeed.. please make some videos on SQL...I am not getting anything of SQL
Thank you :)
I will try :)
very good explanation
Relationships b/w "Amuls"," Academy" is "Affectionate"
i knew someone gonna try this.
Awesome mam 🎉🎉❤
Simple and common example to explain
U rocked...
Thank you :)
A slight change to first part
for i in range(len(name1)):
chk_letter=name1[i]
if chk_letter in name2:
name1,name2=name1.replace(chk_letter," ",1),name2.replace(chk_letter," ",1)
chk_letter="".join((name1+name2).replace(" ",""))
print("Truncated Name ",chk_letter)
num=len(chk_letter)
i ping question which is asked in python interview .please do a video for this one .the question is below check it once.
chef Gesteau is one of the finest chefs in paris.lets understand how he cooks!
chef's Ingredients:
1.The chef receives "excatly 1 ingredient" per day from the market.The ingredients never repeat.
2.Every ingredient belongs to one of the 3 categories namely FIBER,FAT,CARB.
3.Every ingredient has a unique ingredient id.
4.The ingredient id always starts with the category name(ex:FIBERBroccoli,FATCheese,CARBRice)
chefs Dishes:
1.All of the chefs dishes have "exactly 3"ingredients.
2.All the ingredients used wiil be fully used in a dish.The chef doesn't use some part/quantity of an ingredient.
3.All of the chef's dishes must take "atleast 2"of the ingredients froma single category(i.e, At least 2 FAT ingrdients OR at
least 2 FIBER Ingredients OR at least 2 CARB ingredients)
chefs cooking style:
1.If the chef has multiple options of ingredients for dish, then he takes the oldest possible ones to cook in the order
of their arrival.
2.After the chef prepares a dish ,the ingredients used "can not be reused" as they've been already used.
3.The chef prepares a "maximum of 1 dish" per day.
Given the input array of ingredient id that the chef receives every day(i.e.,array index is the day number) write a program
to print when does the chef cook a dish and when he doesn't
INPUT:
Line1: The total number of days for the scope of the problem(1
I will try :)
nice content maam youre great teacher
Thnqq soo much for ur wonderful explanation....
Pleasure 😊
A big ❤️ for your tutorials sister
I don't know why it doesn't have likes .... Thank you for nice explanation... Before I took 3 days to solve... After seeing this video I understood well easily.. but what if I want to print flames cancelled ones ... Eg . If for 1 st step "L" is cancelled then FAMES should be printed and and 2 nd step so on .. is it possible pls say??
Thank you :)
Yes you can modify the program like that :)
If u don't mind will u say logic for that?? Pls? For me it's coming but not in order(eg. [m,a,e,f,s] but not [f,a,m,e,s]) because we are changing list FROM left to right and right to left...
Sister really super we support you😃😃😃
Thank you so much :)
Great
Such an interesting game , I appreciate your efforts ❤️👍
Thank you 👍
lol sounds like u never know this huh?? xD
i can feel your hard work
Mam are U working in any IT COMPANY. its a great teaching
No :)
I am a Full Time TH-camr :)
Here is an interview question :- make a quiz that has four options and add 1 point if the answer is correct and deducts 1 if it is incorrect also it should have an option to skip the question and quit the quiz design this quiz with dictionary python
Your voice is very lovely!
Thanks a lot 😊
Simple logic awesome
Thank you :)
fantastic explanation
Thanks! But Why u didn't use remove function?
Try with remove function 😊
Thanks for teaching us, teach more
Pleasure :)
Why don't you use symmetric_ difference () to remove the common letters.....that would be quite easy right.....
Thank you so much madam
I'm waiting for this concept
Pleasure :)
@@AmulsAcademy
Madam please explain Django madam
By using pycharm editor
Mam, if suppose name1 n name2 have same characters but different arrangements then we get count=0.In this case we also need to check arrangements of characters for count=0.
thanks for explaining everythin
My Pleasure :)
osm creative
nice maam
@Amulya It was a very nice video, 1 suggestion it would be nice if u gave the code in the description
Ok i will remember that :)
How do will I become an expert like you?? Can you tell me plzzz , Amulya Garu 🤔
To eliminate common characters you could use set
We cannot appreciate in every video even it is boring to you ma'am 😛
Thank you :)
hello mam ,,,plz make video on temperature...like printing a message ,,,enter the temp:90
it just right
enter the temparature :120
it is hot
....
in python....i am waiting ...tthank yu
I will try :)
temperature = int (input("Enter the temperature: "))
if temperature = 90:
print("It is hot")
print('Thank you')
S_index = 2.
At last we got ["Enemies","Friends"].
Here only 0th and 1st indexes are present . Then how we slice the list1 using s_index=2..
Problem showing when count is 10, please tell me why
Pls say how become a good programer
Learn, practice, keep learning 😊
Madam please explain tkinter GUI
madam gameing programming video
Mam can you explain pygame plz
4 modulus 6 is 2 ryt..how come it become 4
4 % 6 = 4
Because 6 * 0 + 4 = 4
If Incase the count is 7 then ??
The Formula is used in the cases where the length of the list is greater that 6
anyone here have played flames
Ha ha ha soo funny... 🤣🤣
U don't reply on social media's... Stop lying😡
#taking input from user
name1 = input("enter the 1st name ---> ").lower()
name2 = input("enter the 2nd name ---> ").lower()
#removing white space from input for easy cal
name1 = name1.replace(" ", "")
name2 = name2.replace(" ", "")
#getting commman ch and deleting it
#ex ab in name 1 and cd in name2
# so a is compare with c and d a-->c $ a-->d
# then b is comare with c then d , b--->c $ b-->d
for i in name1:
for j in name2:
if i == j: #comman ch
name1 = name1.replace(i, "",1) # remove those comman ch by empty string using replce meth
name2 = name2.replace(j, "",1) # 1 == once occurance
break
count = len(name1+name2)
# print(count)
# if count is greater then 0 then only i find relationship in fLAME
if count>0:
list1 = ["Friends","Lovers","Affectionate","Marriage","Enemies","Siblings"]
while len(list1)>1:
c = count%len(list1)
s_index = c - 1
if s_index >= 0:
left = list1[:s_index]
right = list1[s_index+1:]
list1 = right+left
else:
list1 = list1[:len(list1)-1]
print("relationship is: ",list1[0])
else:
print("name are not correct or diff")
Awesome mam 🎉🎉❤