Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 939 Bytes

File metadata and controls

34 lines (23 loc) · 939 Bytes

Problems to Practice CS Fundamentals

  1. Write a program that prints "Getting Started With Python Is Fun" to the screen.

  2. Write a program that takes a number and checks if its even or not.

  3. Write a program that asks for user's name and prints out their name.

  4. Modify the program in Problem 3 to print("Sorry no name provided!") if no name is provided by the user.

  5. What is a loop in programming? Write two sentence or give a pseudocode.

  6. What is a function in programming? What are its uses?

  7. Consider the program below and answer what the comment asks.

    x = input("Enter a number")
    
    if x % 2 == 0:
        # what should be the print statement here
    else:
        # what should be the print statement here
  8. Consider the pseudocode below:

    function newFunc(x, y):
    	result = x * y
    	return result
    
    newFunc(3, 9)
    
    

    What does the function return?