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

What are the two techniques of Machine Learning?

There are three main techniques: 1) Supervised learning 2) Unsupervised learning 3) Reinforcement learning
Janvi
How to remove matching elements from two nested lists while iterating
for i in list_1: for j in list_2: if i==j: list_1.remove(i) list_2.remove(j)
Lalitha
Is it possible to learn Python without any coaching class?
Certainly it is possible. What is required is some dedicated time, self-discipline and the willingness to learn by trial and error.
Neetu
0 0
7
Which is best to build web applications: PHP, Python, or Ruby? Why?
I have used almost all of the three language in my web working experience.PHP:It may be not that cool and I think it doesn't rely too much on the framework. Yes, PHP is just a language, but it is the only...
Sunil
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

Shallow And Deep Copying
The difference between shallow and deep copying is only relevant for compound objects (objects that contain other objects, like lists or class instances): A shallow copy constructs a new compound object...

Decorator in Python - Simplified
By definition, a decorator is a function that takes another function andextends(/decorates) the behaviour of the latter function without explicitly modifying it.Let see how we can apply decorators for...

Assignment operators
Operation Syntax Comment Assignment = Control flow right to left Add AND += Incremental Subtract AND -= Decremental Multiply AND *= Multiplicative increment Division...

Big Data & Hadoop - Introductory Session - Data Science for Everyone
Data Science for Everyone An introductory video lesson on Big Data, the need, necessity, evolution and contributing factors. This is presented by Skill Sigma as part of the "Data Science for Everyone" series.

The Zen of Python
Writing programs that actually do what they are supposed to do is just one component of being a good python programmer. It's also important to write clean code that is easily understood, even weeks after...

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