Coder Social home page Coder Social logo

python-- about python HOT 10 OPEN

coded92 avatar coded92 commented on August 15, 2024 2
python--

from python.

Comments (10)

adarshBrata avatar adarshBrata commented on August 15, 2024 2

I have done it. Please check.

from python.

Naman-Garg-06 avatar Naman-Garg-06 commented on August 15, 2024 1

temperature=float(input())
celsius=input()
if (temperature<=0 and celsius=='True') or (temperature<=32 and celsius=='False'):
print("Freezing")
else:
print("Not freezing")

from python.

lionpower7 avatar lionpower7 commented on August 15, 2024

Tempeture

Temp = -8

Celcius

Cel = True

Conditionals For Temp & Cel To Be Considered Freezing Or Not.

if Cel == True and Temp <= 0:
print "Freezing!!!"

elif Cel == True and Temp > 37.7:
print "Really Hot!!!"

elif Cel == False and Temp <= 32:
print "Freezing!!!"

elif Cel == False and Temp >= 100:
print "Really Hot!!!"

else:
print "Not Freezing"

from python.

Siddharth-Vadapalli avatar Siddharth-Vadapalli commented on August 15, 2024

if temperature >32:
(Indent)print("Not Freezing")
elif temperature <= 32 and Celsius == False:
(Indent)print("Freezing")
elif temperature <=0 and Celsius == True:
(Indent)print("Freezing")
else:
(Indent)print("Unknown")

from python.

LeelKumar avatar LeelKumar commented on August 15, 2024

temperature = input(">::Enter Temp Value =")
celsius = input(">::Celsius -> Enter True or False:")

if (celsius == True and temperature <= 0) or (celsius == False and temperature <= 32):
print ("Freezing")

else:
print ("Not freezing")

from python.

cclauss avatar cclauss commented on August 15, 2024

@coded92 Can we please have a better title on this issue?

from python.

Geethikagb avatar Geethikagb commented on August 15, 2024

temperature = -3.7
celsius = True

You may modify the lines of code above, but don't move them! When you Submit your code, we'll change these lines to assign different values to the variables.

Above are given two variables. temperature is a float that holds a temperature. celsius is a boolean that represents whether the temperature is in Celsius; if it's False, then the given temperature is actually in Fahrenheit.

Add some code below that prints "Freezing" if the values above represent a freezing temperature, and "Not freezing" if they don't.

In Celsius, freezing is less than or equal to 0 degrees. In Fahrenheit, freezing is less than or equal to 32 degrees.

Comment your code

temperature = eval(input("Enter Temperature : "))
Celsius = input("Enter input(Celsius = True/Fahrenheit = False) : ")

if Celsius == True:
if temperature <= 0:
print("Freezing")
else:
print('Not Freezing')
else:
if temperature <= 32:
print("Freezing")
else:
print("Not Freezing")

from python.

 avatar commented on August 15, 2024

temperature = -3.7
celsius = True

You may modify the lines of code above, but don't move them! When you Submit your code, we'll change these lines to assign different values to the variables.

Above are given two variables. temperature is a float that holds a temperature. celsius is a boolean that represents whether the temperature is in Celsius; if it's False, then the given temperature is actually in Fahrenheit.

Add some code below that prints "Freezing" if the values above represent a freezing temperature, and "Not freezing" if they don't.

In Celsius, freezing is less than or equal to 0 degrees. In Fahrenheit, freezing is less than or equal to 32 degrees.

Comment your code

def isFreezing():
if celsius and temperature <= 0:
print("Freezing")
elif not celcius and temperature <= 32:
print("Freezing")
else:
print("Not Freezing")
isFreezing()

from python.

suzatathapa avatar suzatathapa commented on August 15, 2024

if celsius and temperature <=0 :
print("Freezing")

elif not celsius and temperature <= 32 :
print ("Freezing")
else:
print ("Not freezing")

Instead of checking Fahrenheit and Celsius
together, we could convert one to the other:

if not celsius:
temperature = (temperature - 32) / 1.8
if temperature <= 0:
print("Freezing")
else:
print("Not freezing")

from python.

vaidehi79 avatar vaidehi79 commented on August 15, 2024

temperature = -3.7
celsius = True

#You may modify the lines of code above, but don't move them!
#When you Submit your code, we'll change these lines to
#assign different values to the variables.

#Above are given two variables. temperature is a float that
#holds a temperature. celsius is a boolean that represents
#whether the temperature is in Celsius; if it's False, then
#the given temperature is actually in Fahrenheit.

#Add some code below that prints "Freezing" if the values
#above represent a freezing temperature, and "Not freezing"
#if they don't.

#In Celsius, freezing is less than or equal to 0 degrees.
#In Fahrenheit, freezing is less than or equal to 32 degrees.

#Add your code here!
if (celsius == True and temperature <= 0) or (celsius == False and temperature <= 32):
print("Freezing")
else:
print("Not freezing")

from python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.