Fibonacci sequence output Here's the code I'm having trouble shortening. I am currently a beginner in Python 3.x.
from os import system

def fibonacci(terms):
    count = 0
    x = 0
    y = 1
    z = x + y
    if terms &lt;= 0:
        print(&quot;Enter a positive integer.&quot;)
    elif terms == 1:
        print(&quot;Fibonacci sequence in &quot; + str(terms) + &quot; terms.&quot;)
        print(x)
    else:
        print(&quot;Printing &quot; + str(terms) + &quot; terms.&quot;)
        while count &lt; terms:
            print(x)
            z = x + y
            x = y
            y = z
            count += 1

while True:
    user_input = int(input(&quot;How many terms? &quot;))
    fibonacci(user_input)
    loop = input(&quot;Again? (Y/n) &quot;)
    if loop == &quot;Y&quot; or loop == &quot;&quot;:
        system(&quot;cls&quot;)
    else:
        exit()

I would appreciate if there will be someone who will be able to make this as efficient as possible.
Separate responsibilities
Your functions should, where possible, limit themselves to doing one thing only. This is the  single-responsibility principle. In case of fibonacci(), I expect this function to just calculate the desired Fibonacci number, and not deal with user input and output. This shortens the function and makes it easier to reason about. So:
def fibonacci(terms):
    count = 0
    x = 0
    y = 1
    z = x + y

    while count &lt; terms:
        yield x
        z = x + y
        x = y
        y = z
        count += 1

Instead of printing the values, it yields them. To print the values, use the following:
terms = int(input(&quot;How many terms? &quot;))
for number in fibonacci(terms):
    print(number)

You can even go futher and make fibonacci() an infinite generator, and leave it up to the caller to decide when to stop:
import itertools

def fibonacci():
    x = 0
    y = 1

    while True:
        yield x
        z = x + y
        x = y
        y = z

terms = int(input(&quot;How many terms? &quot;))
for number in itertools.islice(fibonacci(), terms):
    print(number)

Here I used itertools.islice() to take only the first terms items from the generator.
If you want to handle invalid input gracefully, I suggest you write another function whose responsibility is asking the user for a postivive integer:
def get_positive_integer(prompt):
    while True:
        user_input = int(input(prompt))
        if ...:            
            return user_input
        print(&quot;Enter a positive integer.&quot;)

Avoid using os.system()
Using os.system() to clear the screen is very inefficient and not portable. Of course it is prettier to clear the screen, but if it is not really important for your program, I would just not do it; portability is more important.