Question : PCEP Q1-15 A

Python Quiz

1. What will this code print?

games = ['roblox','minecraft','NeedForSpeed']
print(games[0])

A. minecraft
B. roblox
C. NeedForSpeed
D. Error


2. What type of data is 50.5?

A. Integer
B. String
C. Float
D. Boolean


3. What will this code print?

for number in range(3):
    print(number)

4. What will this code print?

print(1_000_000)

A. 1000000
B. 1_000_000
C. Error
D. 1000


5. What will be the new list after this code runs?

games = ['roblox','minecraft','NeedForSpeed']
games.append('WWE')
print(games)

6. What type of data is 'Sam'?

A. Integer
B. String
C. Float
D. Boolean


7. What will this code print?

speed = 1

while speed < 10:
    speed *= 2
    print(speed)

8. What will this code print?

for number in range(5,8):
    print(number)

9. Which command is used to add an item to a list?

A. append()
B. add()
C. push()
D. include()


10. What will this code print?

games = ['roblox','minecraft','NeedForSpeed']
games[1] = 'FIFA'
print(games)

11. What type of data is True?

A. String
B. Float
C. Boolean
D. Integer


12. What will this code print?

total = 0

for number in range(4):
    if 2 * number > 4:
        total += 1

print(total)

13. What will be printed if the user enters 65?

score = int(input('Enter your final score: '))

if score >= 70:
    print('you passed')

elif score >= 60 and score < 70:
    print('you did well')

else:
    print('you failed')

14. What will this code print?

grade4 = ['sam','jeida','jane']

for student in grade4:
    print('Welcome',student)

15. What will this code print?

day = '31'
month = '01'
year = 2026

print(day,month,year,sep='/')

 

Write what you are looking for, and press enter to begin your search!