Coursera课程Python for everyone:chapter 2
Chapter 2
10 试题
Which of the following is a comment in Python?
# This is a test
* This is a test
/* This is a test */
// This is a test
What does the following code print out?
print "123" + "abc"
This is a syntax error because you cannot add strings
hello world
123+abc
123abc
Which of the following is a bad Python variable name?
Spam
_spam
SPAM23
23spam
Which of the following is not a Python reserved word?
iterate
continue
else
break
Assume the variable x has been initialized to an integer value (e.g., x = 3). What does the following statement do?
x = x + 2
This would fail as it is a syntax error
Exit the program
Increase the speed of the program by a factor of 2
Retrieve the current value for x, add two to it, and put the sum back into x
Which of the following elements of a mathematical expression in Python is evaluated first?
Parenthesis ( )
Multiplication *
Addition +
Subtraction -
What is the value of the following expression
42 % 10
Hint - the "%" is the remainder operator
10
1042
2
420
What will be the value of x after the following statement executes:
x = 1 + 2 * 3 - 8 / 4
5
8
2
4
What will be the value of x when the following statement is executed:
x = int(98.6)
98
100
99
6
What does the Python raw_input() function do?
Pause the program and read data from the user
Connect to the network and retrieve a web page.
Read the memory of the running program
Take a screen shot from an area of the screen
Coursera课程Python for everyone:chapter 2相关推荐
- Coursera课程Python for everyone:chapter10
Chapter 10 Quiz 10 试题 1. What is the difference between a Python tuple and Python list? Lists are mu ...
- Coursera课程Python for everyone:chapter9
Chapter 9 Quiz 10 试题 1. How are Python dictionaries different from Python lists? Python lists mainta ...
- Coursera课程Python for everyone:chapter8
Chapter 8 Quiz 10 试题 1. How are "collection" variables different from normal variables? Co ...
- Coursera课程Python for everyone:chapter7
Chapter 7 Quiz 10 试题 1. Given the architecture and terminology we introduced in Chapter 1, where are ...
- Coursera课程Python for everyone:chapter6
Chapter 6 Quiz 10 试题 1. What does the following Python Program print out? str1 = "Hello" s ...
- Coursera课程Python for everyone:chapter5
Chapter 5 10 试题 1. What is wrong with this Python loop: n = 5 while n > 0 :print n print 'All don ...
- Coursera课程Python for everyone:chapter4
Chapter 4 10 试题 1. Which Python keyword indicates the start of a function definition? def help sweet ...
- Coursera课程Python for everyone:chapter3
Chapter 3 10 试题 1. What do we do to a Python statement that is immediately after an if statement to ...
- Coursera课程Python for everyone:Quiz: Many-to-Many Relationships and Python
Many-to-Many Relationships and Python 9 试题
最新文章
- category使用 objc_setAssociatedObject/objc_getAssociatedObject 实现添加属性
- 图像重建算法_降噪重建技术路在何方?
- mysql jdbc无法连接_jdbc无法连接mysql
- struts2 跳转类型 result type=chain、dispatcher、redirect
- Karma和Jasmine自动化单元测试
- Android之Lollipop DevicePolicyManager学习(下)
- android 复制字符串,Cocos2dx 复制文本到剪切板(Android 和 ios)
- 清华大学医学院 | 体外成熟人卵单细胞多组学研究及总结干细胞分化为配子进展文章...
- 计组之数据运算:12、加法器设计
- windows环境 logstash file input fail 解决
- struts2上传文件
- JavaScriptJQ 004_JS闭包
- idea git将多余的代码提交到本地,如何退回。
- 计算机ppt咋弄,ppt打不开怎么办?教您详细解决方法
- m4a怎么转换成mp3,m4a转mp3方法
- python好学么零基础_python编程好学吗 自学行吗
- 正点原子开发板STM32F407ZG-基于AD7606进行八路数据采集
- [转] 教师的备课主要解决哪些问题?
- Anaconda入门:安装及包与环境的管理(conda命令)
- 常用的行列式和矩阵的性质