Coding Exercise for Beginners in Python |Exercise 12 | Python Tutorials for Beginners #lec35

preview_player
Показать описание
In this Lecture we have written a Program in Python for "Who will pay the bill?"

*********************************************

Connect & Contact Me:

*******************************************

More Playlists:

#coding #pythonforbeginners #python #jennyslectures #pythonprogramming #codingquestions
Рекомендации по теме
Комментарии
Автор

import random
a=input("enter any four memeber name seperate by comma:")
f=a.split(", ")
print(f)
d=random.choice(f)
print(f"{d} will pay the bill")

ValliSurvepalli-egpe
Автор

import random
bill=input("names:")

bill_split=bill.split(", ")
print(bill_split)

will pay the bill")

wribbcu
Автор

I am watching & learning with consistency i appreciate your hard work and thank you mam for fast uploading 😃✌🏻

mr_affan
Автор

AOA Madam....brilliant way of teaching....university students of CS Department gets a lot of knowledge from yours lectures from pakistan c++ remaining lectures completed from Islamabad madam yours efforts are remakable and remember your efforts madam....pray to allah for yours prosperity and happiness

rizwangibralter
Автор

import random
names = input("Enter the names ").split(", ")
print(random.choice(names), " will pay the bill")

preetamkumarbadatya
Автор

Mam start giving interesting problems in different languages(c, java, python, c++, js)....
After some days like 1 or 2 u will upload the solution video..
Will be interesting 🔥🔥✅

vella
Автор

In lecture 35, for the problem we can use this also right mam...
import random
name = input("enter the names seperated by comma:")
guess = name. split(", ")
print(guess)
a = random.choice(guess)
print("The guy who is going to pay the bill is :", a)

D.
Автор

import random

names=input("enter names separated with spaces : ")
list=names.split(" ")
# print(list)
n=len(list)
r=random.randrange(0, n)
print(list[r])

Harsha.
Автор

Simple

import random
names = input("Please Enter Names separated by comma : ")
names11=names.split(", ")
x=len(names11)

print(names11)
y=random.randrange(0, x+1)
print(f"{names11[(y)]} Will pay the Bill")

girishbv
Автор

#without finding the length function.

import random as r
friends = input("enter the friends name: ")
after_splitting = friends.split(', ')
random_friend = r.choice(after_splitting)
print(f"{random_friend} is my best friend! ")

MARUTHU_
Автор

Thank you to give your prime knowledge of this field for free 🙏🏻🙏🏻

ravalsinhal
Автор

Mam, bilash here, I am not clear at all for use split function, I think if use list and choice func'n may be well, tell just my wrong.

mdnazmulhoque
Автор

name = input("enter your friends name : ")
list = name.split(", ")
print(list)
import random
bill = random.randrange(0, len(list))
print(f"{list[bill]} will pay the bill")

bhautikhirpara
Автор

import random
text = input("Enter the names:")
split_text=text.split()
print(split_text)

print(f"{random_name} will pay the bill")

Output:
Enter the names:jenny aakash payal
['jenny', 'aakash', 'payal']
payal will pay the bill

learnfreeblog
Автор

import random
name=input("Enter everybody's name separated by comma:")
name=name.split(', ')
length=len(name)
choice=random.randint(0, length-1)
print(f'{name[choice]} will pay the bill')

wskvzct
Автор

import random

Name = input('Enter the name (with comas) : ')
List = Name.split(", ")

Length = len(List)
Num = random.randint(0, Length)
print(List[Num], "hs to pay ")

mohammedjazim
Автор

import random

names = []
input_names = input("Enter all names :")
names += input_names.split(", ")
select = random.choice(names)
print(names)
print(f"{select} will pay the bill.")

prudhvijeeja__
Автор

import random
names1=input("Enter your names seperated by commas : ")
names2=names1.split(", ")

print(f"{final_name} will pay he bill")

LingeshhvarenKA
Автор

import random as r
user_input = input("enter the cities: ")
after_splitting = user_input.split(', ')
length = len(after_splitting)
random_cities = r.choice(after_splitting)
print(f'{random_cities} is in India')

MARUTHU_
Автор

ask_names = input("Enter everybody's name separated by commas: ")
list1 = ask_names.split(', ')
import random
a = random.choice(list1)
print(f"{a.strip()} will pay the bill.")

tayyabusman