Predict Outcome

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Predict the Output: num = 1 while(num <= 5): print(num)

Output: 1 (accept it literslly doesnt stop)

Predict the Output: tot =0 for n in range(5): tot = tot + n print(tot)

Output: 10 (its adding 1, 2, 3 and 4 to get 10)

Predict the Output: for num in range(2,10): print(num)

Output: 2 3 4 5 6 7 8 9

Predict the Output: print('2' + '3')

Output: 23

Predict the Output: print(14//4, 14%4, 14/4)

Output: 3 2 3.5 // = no decimal (slash off decimal) % = remainder / = normal division

Predict the Output: print('how\nis it\nnow')

Output: How Is it now

Predict the Output: print(2*'No' + 3*'!') print(2 * ('No' + 3*'!'))

Output: NoNo !!! No!!!No!!!

Predict the Output: x = 5 y = x + 3 x = x - 1 z = 10 x = x + z print('x: ',x,' y: ',y,' z: ',z)

Output: X: 5 y: 8 z: 14


Set pelajaran terkait

Chapter 3: Accrual Accounting and Income

View Set

California Real Estate Principles Chapter 3

View Set

American Government Final Review

View Set

Chapter 11 The Powers of Congress

View Set

Level 22: Income Tax in Real Estate - Chapter 3: The Tax Implications of Acquiring a Home or Asset

View Set