Computer Networking > EXAM > CS 1101 Programming Fundamentals Final Exam (All)

CS 1101 Programming Fundamentals Final Exam

Document Content and Description Below

CS 1101 Programming Fundamentals Final Exam 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 without 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 ANS: [Show More]

Last updated: 4 months ago

Preview 1 out of 4 pages

Buy Now

Instant download

We Accept:

We Accept
document-preview

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

We Accept

Also available in bundle (1)

CS 1101 Programming Fundamentals. all terms questions and answers, practice questions with correct answers and project.

CS 1101 Programming Fundamentals. all terms questions and answers, practice questions with correct answers and project. the right A grade materials to pass.

By Professor Lynne 4 years ago

$11

13  

Reviews( 0 )

$7.00

Buy Now

We Accept:

We Accept

Instant download

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

237
0

Document information


Connected school, study & course


About the document


Uploaded On

Jun 06, 2021

Number of pages

4

Written in

Seller


seller-icon
Professor Lynne

Member since 4 years

369 Documents Sold

Reviews Received
34
13
4
0
4
Additional information

This document has been written for:

Uploaded

Jun 06, 2021

Downloads

 0

Views

 237

More From Professor Lynne

View all Professor Lynne's documents »

$7.00
What is Scholarfriends

In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

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·