python - 如果在变量资源管理器中没有打印
问题描述
我正在使用 Spyder IDE。我想计算该值,为此,我使用了 if else 条件。但我看不到变量资源管理器中的计算值。请建议我解决方案。
p = pd.read_excel('Data1.xlsx')
p.head()
a = p.iloc[:12,0].values
b = p.iloc[:12,1].values
c = 200.00
d = 150.00
s = int()
def s(a, b):
if a + b < c:
s = c
elif a + b > d:
s = d
else:
s = a + b
return s
print(s)
解决方案
a=50 #example a
b=100 #example b
c = 200
d = 120
s=int()
def s(a, b):
if a + b < c:
s = c
elif a + b > d:
s = d
else:
s = a + b
return s
print(s(a,b))#Use the same arguments as in your def statement
推荐阅读
- python - 一个非常大的数组的行的笛卡尔积
- python - 循环遍历行并根据条件分配值
- c# - 使用 services.AddHttpClient 时,HttpClient 是在哪里创建的?
- python - 处理 GAN 框架时如何解决“您必须为占位符张量提供值”?
- python - 使用 OpenCV 将图像列表转换为灰度
- batch-file - 批处理文件向文件夹和子文件夹中的多个 .txt 文件添加一行
- c# - 在 mvc 中查看页面加载时 Html Action Link 不隐藏
- .net - 如何解决 .Net SDK 相关问题?
- c++ - 在C++中找到数组的最大元素
- autohotkey - 如何检测自动热键中同时按下两个键?