Computer Science  >  JOURNAL  >  CS 1101 Programming Fundamentals- Term2, 2019-2020 (All)

CS 1101 Programming Fundamentals- Term2, 2019-2020

Document Content and Description Below

1. If you are trying to print a string, what happens if you leave out one of the quotation marks or both and why? ANS: In python we have integer, String, float data types all these initialized wit ... hout quotation except string the compiler ignore what ever come in between quotation because is referred as natural language, When trying print a string without “” the interpreter will consider it as an integer or double, when interpreter trying to interpret and found was a string not integer it print an error eg: >>> print (Abubakar) Traceback (most recent call last): File "<stdin>", line 1, in <module>NameError: name 'Abubakar' is not defined >>> in this example python recognized Abubakar as variable but is not defined anywhere in the code and that is why return error. let put quotation and see; >>> print ('Abubakar') Abubakar >>> now after putting quotation before and after string latter the out print without error, because its now recognized as string not integer nor variable. Let remove one quotation; >>> print (Abubakar') File "<stdin>", line 1 print (Abubakar') ^ SyntaxError: EOL while scanning string literal >>> “EOL (End of Line) error in python occurs when while scanning a string of a program the python hit the end of the line due to the following reasons:  Missing Quotes for closing the string  String Extends Past one Line”(STechies,2019) 2. you can use minus to get negative number like -2. What happen of each of the following?  >>>2++2  >>>2—2  >>>2+-2  >>>2-+2 [Show More]

Last updated: 3 years ago

Preview 1 out of 4 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of CS 1101 Programming Fundamentals- Term2, 2019-2020 document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$10.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

160
0

Document information


Connected school, study & course


About the document


Uploaded On

Nov 23, 2021

Number of pages

4

Written in

All

Seller


Profile illustration for Leslie Kline
Leslie Kline

Member since 4 years

0 Documents Sold

Additional information

This document has been written for:

Uploaded

Nov 23, 2021

Downloads

 0

Views

 160

Document Keyword Tags

Recommended For You

Get more on JOURNAL »

$10.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·