题目内容

Correct the following codes to print the string"I am 18 years old."改正下列代码输出字符串"I am 18 years old."age = 18print("I am "+ age + " years old.")

查看答案
更多问题

Correct the syntex error in the following codes.改正下列代码中的语法错误。x = eval(input('input a number: '))if x<0:y = -1elif x = 0:y = 0else:y = 1print('y = ', y)

Correct the following code to print the last item in the following list.改正下列代码输出列表中最后一个元素。spam = ['cat','ant', 'dog', 'elephant', 'mouse']print(spam[5])

Print the titlecased form of the following names.改正代码将列表names中的字符串首字母大写输出。names = ['tom', 'harry', 'amy']for s in names:print(s.title, end = ' ')

Correct the definition of the following class to print 'Hello'.改正下列类的定义输出'Hello'。class Foo:def show():print('Hello')a = Foo()a.show()

答案查题题库