Python Syntax

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

How do you combine two strings

String1 + string2

What is python syntax for creating a variable and setting it equal to the number 10

Variable_name = 10

How does one define a multi-line string in python

" " " Like this " " "

What character begins a comment in python

#

What is the value of total_cost that gets printed Total_cost = 5 Total_cost += 10 Print (total cost)

15

What number is saved to exponented_variable in the following expression 2 ** 4

16

What is the value of modulo_variable in the following expression Modulo_variable = 14%4

2

What is the output of the following code Cool_number = 12 + 30 Cool_number *5 Print (cool_number)

42

What is the difference between float and an int

A float represents decimal quantities. An int represents whole numbers

This produces a SyntaxError

Answer= "is this an error'

This defined variable is a string

Cool_variable_3 = "important message!"

What function outputs text to the terminal

Print ()

What happens when running the following code Message = what a cool message ! Print (message)

Python throws a syntax error because the string is not surrounded by quotes


संबंधित स्टडी सेट्स

Chapter 16 Fluid and electrolytes

View Set

Chapter 11 - Marginal Cost and Average Cost

View Set

Sociology 170: Population Problems

View Set

La Belle Dame Sans Merci: A Ballad by John Keats (English Lit A2)

View Set

Chapter 13: Promoting Patient Comfort During Labor and Birth

View Set