Python Bangla Tutorials 29 : Guessing Game

preview_player
Показать описание
Learning outcomes:
1) Generating random number
Full Python Course is here :
Рекомендации по теме
Комментарии
Автор

alhamdulilla nije korar por sei lagtase thankqu 🥰🥰🥰

sozibmia-fjuw
Автор

# Guessing Game:

import random

upto = 0
count = 1
while upto != 1:

guessNumber = int(input("Guess a number between 1-10: "))
randomNumber = random.randint(1, 10)

if randomNumber==guessNumber:
print("Yes! You have won.")
print("The correct random number was ", randomNumber)
upto = upto+1

else:
print("No! You have lost.")
print("The correct random number was ", randomNumber)
print("\n")

count = count+1

print("You have guessed after ", count, " times.")

B__Hridoy
Автор

You should be paid. I hzve bought a course from Udemy. But regular i have to visit you for clarification. Jajakallah.

motiurrahmanbappy
Автор

Sir apni youtube video banano chara ar ki ki koren?? Apnar video tutorial gulo khub bhalo ami apnar video dekha java sikhace.All thanks to you.

saimunislam
Автор

“Python” Tutor Wanted
About Student

Graduated (2010) from the Mathematics discipline
Learned C language during the bachelor
Need a python Tutor for “Beginner to Advance level”

Tutor Selection and Qualification

1.Study time Saturday 4:00 - 5:30 PM and Sunday 4:30 – 5:00 PM
(per week 3 hours)
2. Honorarium 500 Taka/hour (per month 6000 Taka, if full attend)
3. Payment monthly basis
4. Tutor must have punctual
(Without 2 hours’ prior notice for every 12 min. late, 100 Taka will be deducted)
5. Tutor must have own computer and internet facility
6. Study medium: WebEx/Zoom/Skype
7. Tutor should have documented and organized
Next, python advance level according to teacher syllabus
9. If you have a GitHub website then you will be given more priority based on experience/project
10. Programming Job experience will be given more priority
Contact: skype: iamfarhadbd

arifhasan
Автор

from random import randrange
n=int(input("Enter loop number: \n"))
for x in range(1, n+1):
guessNumber=int(input("enter guess number: \n"))
randomNumber= randrange(1, 5)

if guessNumber==randomNumber:
print("you have won this time\n")
else:
print("you have lost\n")
print("random number is: ", randomNumber)

ikramhossain
Автор

from math import *
import random
num = int(input("Please enter a number in 1-5 :"))
ran = random.randint(1, 5)
win = 0
lose = 0

for x in range(1, 6):
num = int(input("Please enter a number in 1-5 :"))
if num==ran:
print("HURRA")
print("you have won")
win = win+1
else:
print("Sorry")
print("the currect number is :", ran)
lose = lose+1
print("You have won", win, "time")
print("and")
print("you have lose", lose, "times")

arsonbasak
Автор

Assalamu Alaikum bhai, I wrote below codes for kids, I want to count right answers, how can I use count/count the correct answers?
#Quiz for kids
question1=input("which animal is the fastest animal? Use lower case only: ")
answer1='cheetah'
if question1==answer1:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer1)
question2=int(input("How many days in week?: "))
answer2=7
if question2==answer2:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer2)
question3=int(input("How many Surahs in Al-Quran?: "))
answer3=114
if question3==answer3:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer3)
question4=int(input("How many months in a year?: "))
answer4=12
if question4==answer4:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer4)
question5=int(input("How many starts in US flag?: "))
answer5=50
if question5==answer5:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer5)
question6=int(input("How many vowels are in English language?: "))
answer6=5
if question6==answer6:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer6)
question7=input("what does 50 stars represents in US flag? Use lower case only: ")
answer7='50 states'
if question7==answer7:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer7)
question8=int(input("How many stripes in US flag?: "))
answer8=13
if question8==answer8:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer8)
question9=input("What day is independence day in US? Use lower case only: ")
answer9='4th of july'
if question9==answer9:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer9)
question10=input("What does 13 stripes represents in in US flag? Use lower case only: ")
answer10='13 colony'
if question10==answer10:
print("Yup!You are right!!")
else:
print("Nope!You are wrong!!")
print("Right Answer is:", answer10)

BlueSky
Автор

import random
option_dic = {"r":"Rock", "p":"Peper", "s":"Sissor"}
for key, value in option_dic.items():
print("Press", key, "for", value, "\n", end="")

computer_option = ("Rock", "Peper", "Sissor")
player_score = 0
computer_score = 0
play_limit = 0
while (play_limit <=5):
computer_choice =
usr_guess_input = input("::")
if option_dic[usr_guess_input] == computer_choice:
print("You have won this round. \n Lets move to the next stage")
player_score+=1
else:
print("Better luck next time. \nTime to to move next round")
computer_score+=1
play_limit+=1

if play_limit > 5:
print("Play limit exceed")

if player_score > computer_score:
print("Congrats, You have won. /n But, i won't you win next time")
else:
print("Haha, I got you")

funnydirector
Автор

If i want to take value any float value, then which function should i need to take random

himadrisekhar
Автор

from random import randint

for i in range(1, 6):
guessNumber = int(input("Enter you Guess Number between 1 to 5: "))
randomNumber = randint(1, 5)

if guessNumber == randomNumber:
print("You have won")
else:
print("You have lost")
print("Random number was:", randomNumber)

onlinementor
Автор

sir python ar java konter ke kaj jode akto boltan

littlecryptoking
visit shbcf.ru