Introduction to Programming in Python - C859 WGU C859 Actual Exam

Study Guides Aug 17, 2025
Loading...

Loading document viewer...

Page 0 of 0

Document Text

Introduction to Programming in Python - C859/ WGU C859 Actual Exam Updated 2023-2024 Latest Version

  • / 6
  • function displays variables or expression values print()
  • to keep the output of a subsequent print statement on
  • the same line separated by a single space end=' '

  • newline character. \n
  • what is put in, taken in, or operated on by any process
  • or system.

  • to read in a string from the user and then convert that
  • string to an integer for use in a calculation input() int(input())

  • returns the type of an object type()
  • that gives the value of an object's identity id()
  • when reading the input to convert the input string into
  • a float

  • The syntax for outputting the float myFloat with two
  • digits after the decimal point is

  • Which of the following arguments completes
  • print() to output two digits after the decimal point?print( .format(7.0 / 3.0)) float(input())

print('{:.2f}'.for-

mat(myFloat))

'{:.2f}'

11. What is output by print('{:.1f}'.format(0.125))? 0.1

12. What is output by print('{:.3f}'.format(9.1357))? 9.136

  • The exponent operator is **

14. Compound operator: addition +=

15. Compound operator: Subtraction -=

16. Compound operator: Multiplication *=

17. Compound operator: Division /=

  • / 2

Introduction to Programming in Python - C859/ WGU C859 Actual Exam Updated 2023-2024 Latest Version

  • / 6

18. Compound operator: Modulo %=

  • can be used to round down the result of a float-
  • ing-point division to the closest whole number value.

  • evaluates the remainder of the division of two integer
  • operands.Ex. 23 10 is 3

  • Executes the contents of a file containing Python
  • code and makes the definitions from that file avail- able.

  • ensures that our file runs if we called it up by name
  • and not if we included this file by importing it in some other file //

%

import

if name == ' main '

  • import built in math module import math
  • calling a math module function for sqrt function variable =
  • math.sqrt(num)

  • you want to generate the help of the given math help(math)
  • built-in function can be used to find the length of a
  • string

  • Write a statement that prints the length of the string
  • variable first_name.

  • A programmer can access a character at a specific
  • index by appending containing the index

  • Write an expression that accesses the first character
  • of the string my_country.len() print(len(first_name)) [ ] my_country[0]

  • creates an empty list my_list = [ ]
  • Write a statement that creates a list called my_nums,
  • containing the elements 5, 10, and 20.my_nums = [5, 10, 20]

  • / 2

Download Document

Buy This Document

$30.00 One-time purchase
Buy Now
  • Full access to this document
  • Download anytime
  • No expiration

Document Information

Category: Study Guides
Added: Aug 17, 2025
Description:

Introduction to Programming in Python - C859/ WGU C859 Actual Exam Updated 2023-2024 Latest Version 1. function displays variables or expression values print() 2. to keep the output of a subsequent...

Get this document $30.00