number1 = int(input("请输入第一个数:")) number2 = int(input("请输入第二个数:")) # 方法一:字符串拼接,注意数字需要str()转化为字符串再拼接 print(str(number1) + " + " + str(number2) + " = " + str(number1 + number2)) …
本文将使用open, pandas, numpy三种方式对txt文档进行读,写,追加 [alert]在此不推荐使用此方式操作➡ f = open(’test.txt’, ‘w’),因为该方法结束时候需要使用f.close(),如果忘记写close,则可能出现数据丢失的情况[/alert] 1. with open()方式 读: with open(…
一、GPU基本信息 1. 查看cuda是否可用: torch.cuda.is_available() >>> import torch >>> torch.cuda.is_available() True 2. 查看gpu数量: torch.cuda.device_count() >> torch.c…