UrbanPro

Learn Python Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Can a variable be defined as a string in a Python class?

Asked by Last Modified  

3 Answers

Learn Python

Follow 1
Answer

Please enter your answer

yes. we can.
Comments

7Zero 3Zero 2Zero 82 86 _ IT Professional Trainer with 4 years of experience in IT Industry

Yes, we can define variable as string e.g. class Test( name = "Python" ):pass
Comments

Understand Expectations - Profile Analysis - Career Guidance - Training.

Yes, Python is a dynamically typed language, means, the type of variable is automatically declared based upon the value you assign; x=10 y='hello' here, x will be of type Int and y will be of type 'str'. But, if for some reason you want to create a string variable without any value, you can declare...
read more

Yes, Python is a dynamically typed language, means, the type of variable is automatically declared based upon the value you assign;

x=10

y='hello'

here, x will be of type Int and y will be of type 'str'.  But, if for some reason you want to create a string variable without any value, you can declare like this;

y=''

This tells python, that the variable y has to be created as string, but any value can be assigned later.

similarly you can also declare for a list, x=[]

read less
Comments

View 1 more Answers

Related Questions

I want full details of the Python training, topics covered timing and duration. How much Fee for full course?
We conduct hands-on Python workshop at Kochi with personal attention to each participant. Classes with a batch of l1 or 2 students are also conducted based on the convenience of learner and tutor. Workshop...
Ravi
Is learning Python good or bad?
Its depend on your requirement, I mean if you are seeking for good opportunity to move from one Org. to another, or migrating some applications into your project, or your manager are eagerly requesting...
Harish
0 0
7

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

A Python Program to calculate Variance and Standard Deviation
Finding the variance and the standard deviation. Variance and Standard Deviation are related measures of dispersion that tell us more about a list of numbers,like are they...

Learn Python : Formatting with the .format () method
A good way to format objects into your strings for print statements is with the string.format() method. The syntax is :'String here {} then also {}'.format('something1','something2')Example 1:print("This...
B

Biswanath Banerjee

0 1
0

Write a python program to display dictonary details from list of dictonary
Print the Following: Print all dictonary in a seperate line. Name of all the products. Total quantity of all the products. Details of any product name when provided. Convert all the product name to upper case and print.
A

Ankit P.

0 0
0

Decorators In Python
A decorator takes in a function, adds some functionality and returns it. Functions and methods are called callable as they can be called. Any object which implements the special method __call__() is...

Why is the Hadoop essential?
Capacity to store and process large measures of any information, rapidly. With information volumes and assortments always expanding, particularly from web-based life and the Internet of Things (IoT), that...

Recommended Articles

Python is one of the most popular programming languages in the world. It is general-purpose, object oriented, high-level programming language used in a number of programming fields. Python is a great programming language to learn as it will introduce you to the world of programming. If you are from the technical background...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Looking for Python Training classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Python Training Classes?

The best tutors for Python Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Python Training with the Best Tutors

The best Tutors for Python Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more