2023 Youth Software Programming Python Level 1 Exam Paper
30 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the correct way to prompt a user to input a string in Python?

  • int(input('Please enter a string:'))
  • float(input('Please enter a string:'))
  • eval(input('Please enter a string:'))
  • input('Please enter a string:') (correct)
  • What will be the output of the following code snippet?

    print('hello')
    print('world')
    

  • helloworld
  • 'hello''world'
  • hello world (correct)
  • hello world (correct)
  • Which Python operator has the highest precedence among the following?

  • >
  • +
  • -
  • * (correct)
  • Which of the following code snippets can set the pen color to red in Python?

    <p>turtle.pencolor('red')</p> Signup and view all the answers

    What will be the output of the following code snippet?

    a = '90'
    b = '80'
    c = int(a)
    d = int(b)
    print(c + d)
    

    <p>170</p> Signup and view all the answers

    If a=145, b=90, and c=a>b, what is the value of c in Python?

    <p>True</p> Signup and view all the answers

    In a Tower of Hanoi puzzle, if Xiao Ming wants to move three disks from the middle pole to the right pole, using the minimum number of steps, how many steps are required?

    <p>6</p> Signup and view all the answers

    After executing the given Python code, where is the position of the coordinate (turtle)?

    <p>(50,-50)</p> Signup and view all the answers

    Which of the following is the correct way to import the Turtle library in Python?

    <p>import turtle</p> Signup and view all the answers

    What will be the output of the following code snippet?

    a=5
    b=2
    a-=b
    print(a)
    

    <p>4</p> Signup and view all the answers

    In the given program, identify any incorrect use of comments:

    <p>No errors in comments</p> Signup and view all the answers

    Which of the following is an incorrect way to name a Python variable?

    <p>123</p> Signup and view all the answers

    What is the result of print(2023 % 10 ** 2)?

    <p>23</p> Signup and view all the answers

    After executing the following turtle library commands, what color will the pen end up being?

    <p>Red</p> Signup and view all the answers

    Which software or editor cannot open Python3 programs?

    <p>Official Scratch</p> Signup and view all the answers

    Running the program print(not(5*2+6) &gt; 8+3*3), what will be the output?

    <p>False</p> Signup and view all the answers

    In Python, what is the functionality of the statement print(a,b)?

    <p>Prints a, b</p> Signup and view all the answers

    Which of the following expressions results in an integer type?

    <p>$5 // 2$</p> Signup and view all the answers

    What command should be used to make the turtle face downwards on the screen in turtle graphics?

    <p>turtle.setheading(-180)</p> Signup and view all the answers

    After executing turtle.goto(100,0), where does the turtle move and in what direction does it face?

    <p>The turtle moves 100 units to the right and faces right.</p> Signup and view all the answers

    What does the function circle(100, steps=4) represent in turtle graphics?

    <p>It represents drawing a square with side length 100.</p> Signup and view all the answers

    Are Python strings, integers, and floats completely interchangeable with each other?

    <p>No</p> Signup and view all the answers

    Will running print('Hello, World!') result in an error in Python?

    <p>Yes</p> Signup and view all the answers

    Is it necessary to switch to script mode after launching IDLE's interactive mode to write and run programs?

    <p>No</p> Signup and view all the answers

    What is the correct statement about variable declaration and assignment in Python?

    <p>Variable declaration and assignment are separate processes.</p> Signup and view all the answers

    What is the purpose of the program described in the text?

    <p>To calculate the sum and average of the digits of a three-digit number.</p> Signup and view all the answers

    Which of the following best describes the usage of double quotes and triple quotes in Python?

    <p>Double quotes are used for single-line strings, and triple quotes are used for multi-line strings.</p> Signup and view all the answers

    What is the main significance of the number 144 degrees in drawing a five-pointed star?

    <p>It indicates the outer angle of each point on the star.</p> Signup and view all the answers

    What is required to draw a red five-pointed star with a border length of 200, as described in the text?

    <p>Keep the pen visible throughout the drawing process.</p> Signup and view all the answers

    What does the program output if the input from the keyboard is 467?

    <p>The sum of digits: 17, Average: 5</p> Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser