Exercise 1 solution : Python tutorial 24

preview_player
Показать описание
Exercise 1 solution : Python tutorial 24
Рекомендации по теме
Комментарии
Автор

Number_1 = int(input("Enter first number "))
Number_2 = int(input("Enter second number "))
Number_3 = int(input("Enter third number "))
print(Number_1 + Number_2 + Number_3 // 3)


This also worked!

Dudeinfire
Автор

a, b, c = input("enter three no. seperating by commas : ").split(", ")

average= (int(a)+int(b)+int(c))/3

print(f"average of number {a}, {b} and {c} is {average}")

SaurabhKumar-qlgn
Автор

one1, two2, three3 = input("enter three number :").split(", ")
total = /3
print("average of three number " + str(total))

mobiletrick
Автор

why it is not giving the output when i write the program as
num1, num2, num3=float(input("enter numbers")).split()
avg=(num1+num2+num3)/3
r=round(avg, 3)
print(f"average is {r}")

abhishekjain
Автор

is it possible to do code like take input from the user and also in that line do typecasting?
e.g. num1, num2, num3=int(input("enter three no. separated by comma").split(", "))
this will throw an error but if there is another method like these so please show me !!!

keyursheladiya
Автор

Hi Harshit,
can we use int function with three input in single line
num1, num2, num3 = int(input("enter three values separated by comma : ")).split(", ")
num1, num2, num3 = int(input("enter three values separated by comma : ").split(", "))

deepakkothari
Автор

i mean suppose agar hum ek int(average) variable me num1, 2, 3 daal de to kya output me changes aenge

DeepakkumaR-fvlv
Автор

hello harshit, why the 3.6 version of string formatting command is not working in my python 3.7 installed via virtual box, it always gives syntax error

asadted
Автор

Direct data type chnge nhi kr skte kya user input me hi?

Virgo
Автор

I did is

A= ("enter your no.")
B = (" enter your 2nd no ")
C = ("enter your 3rd no")

Sum = float(A) + float(B) +float (C)
Avg = float(sum/3)
Print(f" the average of this no. Is {Avg}")

It worked

shoya
Автор

I am in trouble split() function is not working in my code:
x, y, z = input("Enter a three values separated by space: ").split(" ")

Traceback (most recent call last):

File "C:/Users/PROVIDENT/Desktop/python_working/average.py", line 1, in <module
x, y, z = input("Enter a three values separated by space: ").split(" ")

ValueError: not enough values to unpack (expected 3, got 1)

muhammadarslankahloon
Автор

num1, num2, num3=input ("plz enter three numbers"). split (", ")
print (f"Average is {(

sigmamotivation
Автор

can we not use two multivariable input function in single prg?

sahusanjeev
Автор

thanks sir it wasn't clear to me at first i had the same idea how we can do this but i couldn't quite understand then i found out this ex vid and that doubt was cleared thanks sir

ofcrusty
Автор

bro agar hum 'average' variable ko hi int lele to kya usme int 1, 2, 3 bhi as int hi input hoga or output me change hoga
vase mane try karke dekha to output change ho rha hai
so please samjhao

DeepakkumaR-fvlv
Автор

can we use int function with split # when input

yogeshkushwah
Автор

Is this comma seperated and split fun work in python 3.8???

awaismughal
Автор

How to clear the screen in pychem editor after input data and before print.

rajeevpillai
Автор

Why used int during print ..
You told previously no need to mention numbers with int in python version 3.6 ?

akashmohanty
Автор

I did it like this:

p = int(input("First Number "))

q = int(input("Second Number "))

r = int(input("Third Number "))

s = (p + q + r)/3

print (f"Your Average Comes out to be {s}")

techno-tronics