我在从Codecademy +其他来源学到的东西上做了一些练习。我正在尝试运行此代码(由于此错误而未完成):
word = input("What word do you want analyzed? ")
word = str(word)
print("word: " + word,
"length of word" + len(word))
但每次我尝试这样做时都会收到此错误:
"length of word" + len(word))
TypeError: must be str, not int
我做错了什么?我应该在len()方法中放入一个str()方法吗?
答案 0 :(得分:1)
我应该在len()方法中放入str()方法吗?
不,在它之外
function ExportRange() {
var destination = SpreadsheetApp.openById(DESTINATION SPREADSHEET ID HERE);
var destinationSheet = destination.getActiveSheet();
var destinationCell = destinationSheet.getRange(SET DESTINATION CELL EXAMPLE:"A1");
var cellData = '=IMPORTRANGE(origin spreadsheet_key, range_string)';
destinationCell.setValue(cellData);
}