Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8972197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:09:35+00:00 2026-06-15T18:09:35+00:00

I am attempting to clear lines of code in Python and came across a

  • 0

I am attempting to clear lines of code in Python and came across a post at Any way to clear python's IDLE window? on how to do so however when I run the function below in IDLE 3.3 I get the error below. It does however work in version 2.7.3.

ERROR

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    cls()
  File "<pyshell#6>", line 2, in cls
    print('\n') * 100
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

CODE

def cls():
    print('\n') * 100
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:09:36+00:00Added an answer on June 15, 2026 at 6:09 pm

    You probably mean

    print('\n' * 100)
    

    When you multiply a string by an int, it is repeated:

    >>> 'ha' * 3
    'hahaha'
    

    But what you do is multiply the value of print('\n') by 100. But print() doesn’t return anything (read: returns None), hence the error: you can’t multiply None and int.

    In Python 2 there is no difference, because there are no parentheses:

    print '\n' * 100
    

    Still, it’s interpreted by Python the same way as in Python 3 (and not the same way you seem to iterpret it).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to inject some text (specifically a few lines of javascript code), into
I am attempting to create something along the lines of How to Implement Basic
Using NPOI and attempting to follow a tutorial here: http://www.zachhunter.com/2010/05/npoi-excel-template/ , I'm coming across
I am attempting to create a way in which hermetic builds can be achieved
We're attempting to clean up a big bunch of brown field code, while at
I'm attempting to write find/replace code for Word documents using Word Automation through Interop.Word
I am attempting to run the following query: (IF(book.book_type_id = 1, IF(inventory.cost < (follette_title.usedbuyingprice
I am attempting to clear all the contents of the hosts file with a
Am attempting to port some code to a Debian install on an ARM processor.
I'm attempting to work with the Console.ReadKey() function in order to intercept the user's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.