473,385 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

What does the following code give us?

What does the following code give us?
>>> b=(1)
Jan 2 '19 #1
1 1298
Not a tuple. This gives us a plain integer.

>>> type(b)
<class ‘int’>
To let it be a tuple, we can declare so explicitly with a comma after 1:

>>> b=(1,)
>>> type(b)
<class ‘tuple’>
Jan 3 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Sier | last post by:
CL_ConsoleWindow console("Console"); Is this some c++ idiom or a macro? I know you can't tell without the headers, but I want a quick explanation.
3
by: RobertTG | last post by:
Someone please translate the code below into English... Particularly the indicated line Thanks function attachComment() { var aForms = document.getElementsByTagName("FORM"); for (var i = 0;...
16
by: Mars | last post by:
I am reading the code of a program from the examples, but really don't understand this one........ int i,j; ..................................................... while (scanf("%d",&i),j) {...
1
by: John Ramsden | last post by:
I have ported a PHP MySQL app to PostgreSQL, and a pg_send_query() call is returning error code 2 (PGSQL_TUPLES_OK). Unfortunately the PHP manual lists the error codes but doesn't indicate what...
1
by: locy | last post by:
can someone explain to me "what does this code do" class baseclass { public: virtual void runme() { std::cout<<"are you"<<std::endl; }
1
maher5
by: maher5 | last post by:
hi i had some help completing my assignment which i still dont understand fully. i dont know what this bit of the code means/do. the assignment was the morse code convertion. ...
3
by: qianz99 | last post by:
Hi I am not sure what this code does. I have the following questions 1. where is the case? 2. #define TLV_INTEGER(name, octets) p->name = -1; Is it define a function TLV_INTEGER(name, octets) ...
5
by: naeemzi | last post by:
plz sir, solve me the following problum. #include <iostream.h> #include <windows.h> char customer_name; char description; void output(char customer_name, char movie_name, char nights,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.