Game Preview

python data type

  •  English    11     Public
    Python
  •   Study   Slideshow
  • What data type does input() always return?
    String
  •  10
  • How do we convert input to a whole number?
    int()
  •  10
  • write a line correctly that takes a number as input?
    num = int(input("Enter a number: "))
  •  15
  • What will be the output if the user enters 10? age = int(input("Enter your age") / print(age + 5)
    15
  •  15
  • What does float() do?
    Converts to a decimal number
  •  10
  • True or False: input() returns an integer .. and why?
    False .. it returns string
  •  10
  • What will be the output if x="3" ? / print( x * 2)
    33
  •  15
  • What is wrong with this code? x = input("Enter: ") / print(x + 5)
    x is a string
  •  15
  • Write one line that asks for age and prints age + 1
    age = int(input("Enter age: ")) / print(age + 1)
  •  15
  • Why do we use type conversion?
    To calculate with numbers
  •  10
  • Which function shows output?
    print()
  •  5