如何找到最多2个数字? [英] How do I find the maximum of 2 numbers?

查看:59
本文介绍了如何找到最多2个数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找到最多2个数字?

How to find the maximum of 2 numbers?

value = -9999
run = problem.getscore()

我需要比较两个值,即valuerun并找到最大值2.我需要一些python函数来操作它吗?

I need to compare the 2 values i.e value and run and find the maximum of 2. I need some python function to operate it?

推荐答案

使用内置函数

Use the builtin function max.

示例: max(2, 4)返回4.

只是为咯咯笑,还有一个min ...您是否需要它. :P

Just for giggles, there's a min as well...should you need it. :P

这篇关于如何找到最多2个数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆