CS1101 - Unit 5 Questions and Answers Already Passed
CS1101 - Unit 5 Questions and Answers Already Passed What does function subroutine do? def subroutine( n ): while n > 0: print (n,) n -= 1 Counts from n down to 1 and displays each number What output will the following python command produce: >>> percentage = float ( 60 * 100) / 55 >>> print (percentage) 109. What output will the following python commands produce: n = 10000 count = 0 while n: count = count + 1 n = n // 10 print (count) 5 What output will the following python commands produce: x = 5 if x % 2 == 0: print (x) else: print (x, x%2) 5 1 What does function subroutine do? def subroutine(n): while n > 0: print (n,) n -= 1 Counts from n down to 1 and displays each number What is the output of the following statements? pi = float(3.14159) print (pi) 3.14159 What is the output of the following statements? pi = int(3.14159)
Written for
- Institution
- CS1101 -
- Course
- CS1101 -
Document information
- Uploaded on
- May 18, 2024
- Number of pages
- 5
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cs1101 unit 5 questions and answers already pas
Also available in package deal