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

  • SEARCH
  • Home
  • 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 3781176
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:54:31+00:00 2026-05-19T10:54:31+00:00

I have some confusion about its meaning or definition. Isn’t that some code that

  • 0

I have some confusion about its meaning or definition.

Isn’t that some code that produce or calculate new data values? (Says Zelle in his book)

Then I wonder if a string data type is an expression.

If it is, then what does eval() do when its argument is a string?

The book by Zelle sayseval(<string>) evaluates string as an expression, what does that exactly mean if string is already an expression?

And if string is not an expression, then how come it can occur after print?

  • 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-05-19T10:54:32+00:00Added an answer on May 19, 2026 at 10:54 am

    Expressions represent something, like a number, a string, or an instance of a class. Any value is an expression!

    Anything that does something is a statement. Any assignment to a variable or function call is a statement. Any value contained in that statement in an expression.

    foo = "hello" is a statement that assigns foo to the value of the expression “hello”. Since the code "hello" is a simple expression, meaning it contains no operations, nothing is actually evaluated, so foo is just assigned to "hello“. More complex expressions actually evaluate things, like adding numbers. Using the word expression seems like it is making things more confusing. Expressions are nothing but values, except they can have operations like addition or subtraction.

    eval evaluates the string as if it were a python expression. Eval does takes an expression as an argument. However, there’s nothing special about this since every single value is an expression. Saying “eval takes a value as an argument” is saying exactly the same thing, but it sounds much simpler. 😀

    eval( "2+2" ) passes the string "2+2" to the function. The function evaluates the expression contained in the string, which comes out to 4.

    The book by Zelle says eval(<string>) evaluates string as an expression, what does that exactly mean if string is already an expression?

    Any string is an expression since it represents a value. However, what is in the string has absolutely no impact on it being an expression. If its a value, its an expression. When it is “evaluated as an expression by eval”, the characters inside the string are executed as if they were a python expression.

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

Sidebar

Related Questions

We have some input data that sometimes appears with &nbsp characters on the end.
I have some confusion related to the .NET platform build options in Visual Studio
I have some UI in VB 2005 that looks great in XP Style, but
I have some code for starting a thread on the .NET CF 2.0: ThreadStart
I have some C# / asp.net code I inherited which has a textbox which
I have some code like this in a winforms app I was writing to
I have some kind of test data and want to create a unit test
I have been starting to write some reasonably large and or confusing MySQL queries
I have some ASP.NET web services which all share a common helper class they
I have some classes layed out like this class A { public virtual void

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.