Foundations-of-Programming-Python 試験問題を無料オンラインアクセス

試験コード:Foundations-of-Programming-Python
試験名称:Foundations of Programming (Python) - E010 JIV1
認定資格:WGU
無料問題数:62
更新日:2026-06-17
評価
100%

問題 1

Fix the indexing error in this function that should return the last character of a string.
def get_last_character(text):
return text[len(text)]

問題 2

Complete the function is_positive(number) that returns True if the number is greater than 0, and False otherwise.
def is_positive(number):
# TODO: Return True if number > 0, False otherwise
pass

問題 3

Write a complete function password_strength(password) that returns " Strong " if the password is at least 8 characters long and contains both letters and numbers, " Weak " otherwise.
For example, password_strength( " abc123def " ) should return " Strong " .
def password_strength(password):
# TODO: Return " Strong " or " Weak " based on password criteria
if len(password) < 8:
return " Weak "
has_letter = False
has_number = False
for char in password:
if char.isalpha():
has_letter = True
elif char.isdigit():
has_number = True
# TODO: Add your return logic here based on has_letter and has_number
pass

問題 4

In the code for item in my_list:, what does item represent?

問題 5

Which loop structure processes every individual item in a list called grades?

コメントを追加

あなたのメールアドレスが公開されることはありません。個人情報に関する内容は隠されます *

insert code
画面にある文字を入力してください。