WGU Foundations-of-Programming-Python - Foundations of Programming (Python) - E010 JIV1
Total 60 questions
Write a complete function convert_temperature(celsius) that converts Celsius to Fahrenheit using the formula: F = C * 9/5 + 32.
For example, convert_temperature(0) should return 32.0.
def convert_temperature(celsius):
# TODO: Convert Celsius to Fahrenheit using F = C * 9/5 + 32
pass
Which data type is the value 3.14 in Python?
Complete the function add_item(numeric_list, new_number) that takes a list of numbers and a new number, and returns a new list that appends the new number to the end of the list.
For example, add_item([1, 2, 3], 4) should return [1, 2, 3, 4] .
Which index position is returned when the string method .find( ' python ' ) is applied to the string ' learning python programming ' ?
A program needs to display only positive, non-zero numbers from a list containing a mixture of integer and decimal values. Which conditional statement should be placed inside the loop?
What does the string method ' ' .join() return when applied to the list [ ' Hello ' , ' World ' ]?
Write a complete function word_count(text) that counts and returns the number of words in the given text. Words are separated by spaces.
For example, word_count( " Hello world Python " ) should return 3.
def word_count(text):
# TODO: Count and return the number of words in text
pass
What must a developer do to run Python code written in a text editor?
