×

Python Tutorial

Python Basics

Python I/O

Python Operators

Python Conditions & Controls

Python Functions

Python Strings

Python Modules

Python Lists

Python OOPs

Python Arrays

Python Dictionary

Python Sets

Python Tuples

Python Exception Handling

Python NumPy

Python Pandas

Python File Handling

Python WebSocket

Python GUI Programming

Python Image Processing

Python Miscellaneous

Python Practice

Python Programs

Python - Convert temperature from Celsius to Fahrenheit using Lambda Function

Here, we are going to learn how to convert temperature from Celsius to Fahrenheit using lambda function? By Pankaj Singh Last updated : December 27, 2023

Problem statement

Write a Python program to convert temperature from Celsius to Fahrenheit using lambda function.

Python program to convert temperature from Celsius to Fahrenheit using lambda function

# lambda function
ctof = lambda c: 9 / 5 * c + 32

# input
c = int(input("Enter Temp(C) : "))

# function call
f = ctof(c)

# print
print("Temp(F) :", f)

Output

Enter Temp(C) : 10
Temp(F) : 50.0

In this example, we have used the following Python basic topics that you should learn:

Python Lambda Function Programs »

Advertisement
Advertisement

Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.