Skip to content

IT Notes

IT Notes

  • Home
  • Privacy Policy
  • Sample Page
    • Home
    • Interview Questions
    • Python Interview Questions
    • Page 7
Python Interview Questions

Explain how can you generate random numbers in Python?

To generate random numbers in Python, you need to import command as import random random.random() This returns a random floating-point number in the range [0,1)

Python Interview Questions

Explain how to delete a file in Python?

By using a command os.remove (filename) or os.unlink(filename)

Python Interview Questions

Explain how can you make a Python Script executable on Unix?

To make a Python Script executable on Unix, you need to do two things, Script file’s mode must be executable, and the first line must begin with # ( #!/usr/local/bin/python)

Python Interview Questions

How can you share global variables across modules?

To share global variables across modules within a single program, create a special module. Import the config module in all modules of your application. The module will be available as…

Python Interview Questions

What are the rules for local and global variables in Python?

Here are the rules for local and global variables in Python: Local variables: If a variable is assigned a new value anywhere within the function’s body, it’s assumed to be…

Python Interview Questions

What is module and package in Python?

In Python, module is the way to structure a program. Each Python program file is a module, which imports other modules like objects and attributes. The folder of Python program…

Python Interview Questions

What is the difference between xrange and range?

Xrange returns the xrange object while range returns the list and uses the same memory and no matter what the range size is.

Python Interview Questions

How can you convert a number to a string?

In order to convert a number into a string, use the inbuilt function str(). If you want a octal or hexadecimal representation, use the inbuilt function oct() or hex().

Python Interview Questions

What is negative index in Python?

Python sequences can be index in positive and negative numbers. For positive index, 0 is the first index, 1 is the second index, and so forth. For the negative index,…

Python Interview Questions

How can you copy an object in Python?

To copy an object in Python, you can try a copy.copy () or copy.deepcopy() for the general case. You cannot copy all objects but most of them.

Posts navigation

1 … 6 7 8 9

« Previous Page — Next Page »

Recent Posts

  • What is Blade?
  • What are the features of Laravel?
  • What is Laravel?
  • Explain the for keyword
  • Explain the enum keyword

Recent Comments

No comments to show.

Archives

  • June 2025
  • November 2024
  • August 2024
  • July 2024
  • April 2024
  • September 2023
  • May 2023

Categories

  • Android Interview Questions
  • Angular JS interview Questions
  • C Programming
  • C Programs
  • C++ Programming
  • Codeigniter Interview Questions
  • Computer Network
  • CSS Interview Questions
  • HTML Interview Questions
  • Java
  • Java Interview Questions
  • Javascript Interview Questions
  • jQuery interview Questions
  • Laravel Interview Questions
  • Mobile Application Development
  • MySQL Interview Questions
  • PHP
  • PHP Interview Questions
  • Python
  • Python Interview Questions
  • React JS Interview Questions
  • Software Engineering
  • System Analysis and Design (SAAD)
  • Uncategorized
  • Vtiger CRM

You Missed

Laravel Interview Questions

What is Blade?

Laravel Interview Questions

What are the features of Laravel?

Laravel Interview Questions

What is Laravel?

C Programming

Explain the for keyword

IT Notes

Copyright © All rights reserved | Blogus by Themeansar.