CSC401 - Introduction to Programming, Ch2 - CSC401, CSC 401 Test 2, python, Python Programming Review, Introduction to Computer Programming: Python, Python Programming Test, Introduction to Python 3 Programming, Introduction to Programming in Python exam
Data Type - correct answer String, Int, Float, Boolean Class - correct answer Same as data type How do you iterate through a list? - correct answer For Loop! scores = [1,2,3,4] for s in scores: print(s) Write a function named powers() that takes a positive integer n as input and prints, on the screen, all the powers of 2 from 2^1 to 2^n. - correct answer def powers(n): for i in range(1,n+1): print(2**i) How do you identify the length of a list? - correct answer len(list) How do you iterate through a list by index instead of value? - correct answer range(len(list))
Written for
- Institution
- CSC401 - Introduction to Programming, Ch2 - CSC401
- Course
- CSC401 - Introduction to Programming, Ch2 - CSC401
Document information
- Uploaded on
- December 20, 2023
- Number of pages
- 71
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
csc401 introduction to programming ch2 csc401