问题一

初始化一个变量“my_variable”,令它等于10,并打印这个变量。

# YOUR CODE HERE
my_variable=10
print(my_variable)
#raise NotImplementedError()
10

问题二

请打印出1+2的结果

# YOUR CODE HERE
print (1+2)
#raise NotImplementedError()
3

问题三

给出Hello的值,打印Hello以及Hello的最后一位。 这里我们定义: <center>Hello = “nkaldyfhjkdnsfjhadf abkdjbfhjadf”<center>

# YOUR CODE HERE
Hello = "nkaldyfhjkdnsfjhadf abkdjbfhjadf"
print(Hello)
print(Hello[-1])
#raise NotImplementedError()
nkaldyfhjkdnsfjhadf abkdjbfhjadf
f

问题四

涛涛是一个20岁主修计算机科学的老男孩。请设置他的关键词像姓名、年龄、专业,并用这些关键词打印一份关于他的介绍。例如: <center>my_name = “Ya Tao”<center> <center>print (“Let’s talk about %s.”% my_name)<center>


# YOUR CODE HERE
name = "Ya Tao"
age = 20
major = "Computer"
print ("Let's talk about ",name,". He is ",age," years old. His major is ",major,".",sep='')
#raise NotImplementedError()
Let's talk about Ya Tao. He is 20 years old. His major is Computer.

问题五

定义x=2,请打印x以及x*2的值。

# YOUR CODE HERE
x =2
print(x)
print(x*2)
#raise NotImplementedError()
2
4
最大平方数是199
#by不做评论
说点什么
欢迎留言~
支持Markdown语法
暂时没有评论。
Loading...